From fc5269f57ca2096d0195bda743ae88a3ce688a5e Mon Sep 17 00:00:00 2001 From: yeon Date: Thu, 5 Dec 2019 17:24:36 +0900 Subject: [PATCH] =?UTF-8?q?[Simplyfy]=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20fragment=20=EC=88=98=EC=A0=95=20#140?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 빈 <> 삭제 --- client/src/composition/Feed/Feed.tsx | 18 +++++++------- .../composition/Feed/FeedComment/index.tsx | 8 +------ client/src/composition/Feed/Image.tsx | 8 +++---- .../src/composition/Feed/ImageContainer.tsx | 2 +- .../Feed/WritingFeed/WritingPresenter.tsx | 24 +++++++++---------- .../src/composition/Search/CardContainer.tsx | 24 ++++++++----------- client/src/pages/Search/index.tsx | 6 +---- 7 files changed, 35 insertions(+), 55 deletions(-) diff --git a/client/src/composition/Feed/Feed.tsx b/client/src/composition/Feed/Feed.tsx index 4ae1b0b9..939e6018 100644 --- a/client/src/composition/Feed/Feed.tsx +++ b/client/src/composition/Feed/Feed.tsx @@ -77,16 +77,14 @@ function Feed({ content, createdAt, feedinfo }: Iprops) { {feedinfo.comments && feedinfo.comments.length > 0 ? ( feedinfo.comments.map(comment => { - if (comment) { - return ( - <> - - - - ); - } else { - return <>; - } + return comment ? ( + <> + + + + ) : ( + <> + ); }) ) : ( <> diff --git a/client/src/composition/Feed/FeedComment/index.tsx b/client/src/composition/Feed/FeedComment/index.tsx index f1f3049a..d7125703 100644 --- a/client/src/composition/Feed/FeedComment/index.tsx +++ b/client/src/composition/Feed/FeedComment/index.tsx @@ -4,13 +4,7 @@ import { Comment } from 'react-components.d'; // 역할 : const CommentContainer = ({ comment }: { comment: Comment }) => { - return ( - <> -
- -
- - ); + return ; }; export default CommentContainer; diff --git a/client/src/composition/Feed/Image.tsx b/client/src/composition/Feed/Image.tsx index 5d6bb631..8c7d16e1 100644 --- a/client/src/composition/Feed/Image.tsx +++ b/client/src/composition/Feed/Image.tsx @@ -14,11 +14,9 @@ const ImageBox = styled.img` const ImagePreview = ({ url }: Image) => { if (!url) return <>; return ( - <> - - - - + + + ); }; diff --git a/client/src/composition/Feed/ImageContainer.tsx b/client/src/composition/Feed/ImageContainer.tsx index dbfe8017..10fb36e4 100644 --- a/client/src/composition/Feed/ImageContainer.tsx +++ b/client/src/composition/Feed/ImageContainer.tsx @@ -7,7 +7,7 @@ interface Iprops { } const ImageContainer = ({ images }: Iprops) => { - if (!images) return <>______; + if (!images) return <>; return ( <> {images.map(image => diff --git a/client/src/composition/Feed/WritingFeed/WritingPresenter.tsx b/client/src/composition/Feed/WritingFeed/WritingPresenter.tsx index aaad53a6..3d13fe97 100644 --- a/client/src/composition/Feed/WritingFeed/WritingPresenter.tsx +++ b/client/src/composition/Feed/WritingFeed/WritingPresenter.tsx @@ -160,19 +160,17 @@ function WritingFeedPresenter({ {files && files.length > 0 && ( - <> - - {files.map((file: { fileUrl: string; fileId: number }) => ( - - ))} - - - + + {files.map((file: { fileUrl: string; fileId: number }) => ( + + ))} + + )} diff --git a/client/src/composition/Search/CardContainer.tsx b/client/src/composition/Search/CardContainer.tsx index 86946fd2..027fe3c5 100644 --- a/client/src/composition/Search/CardContainer.tsx +++ b/client/src/composition/Search/CardContainer.tsx @@ -33,23 +33,19 @@ function CardContainer({ location }: IProps) { if (loading) return

로딩중...

; if (error) return ( - <> - - + ); if (data.searchUser.length === 0) return ( - <> - - + ); function sendFriendRequest(email: string) { diff --git a/client/src/pages/Search/index.tsx b/client/src/pages/Search/index.tsx index a537a642..a21446a3 100644 --- a/client/src/pages/Search/index.tsx +++ b/client/src/pages/Search/index.tsx @@ -6,11 +6,7 @@ interface IProps { } const Search = (props: IProps) => { - return ( - <> - - - ); + return ; }; export default Search;