Skip to content

Commit

Permalink
[Simplyfy] 필요없는 fragment 수정 #140
Browse files Browse the repository at this point in the history
빈 <></> 삭제
  • Loading branch information
WooYeonSeo committed Dec 5, 2019
1 parent baaaae9 commit fc5269f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 55 deletions.
18 changes: 8 additions & 10 deletions client/src/composition/Feed/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ function Feed({ content, createdAt, feedinfo }: Iprops) {
<CommentDiv>
{feedinfo.comments && feedinfo.comments.length > 0 ? (
feedinfo.comments.map(comment => {
if (comment) {
return (
<>
<CommentContainer comment={comment} />
<WriteCommentPresentor />
</>
);
} else {
return <></>;
}
return comment ? (
<>
<CommentContainer comment={comment} />
<WriteCommentPresentor />
</>
) : (
<></>
);
})
) : (
<>
Expand Down
8 changes: 1 addition & 7 deletions client/src/composition/Feed/FeedComment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import { Comment } from 'react-components.d';

// 역할 :
const CommentContainer = ({ comment }: { comment: Comment }) => {
return (
<>
<div>
<CommentPresentor content={comment.content} />
</div>
</>
);
return <CommentPresentor content={comment.content} />;
};

export default CommentContainer;
8 changes: 3 additions & 5 deletions client/src/composition/Feed/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ const ImageBox = styled.img`
const ImagePreview = ({ url }: Image) => {
if (!url) return <></>;
return (
<>
<span>
<ImageBox src={url} alt="My Image" />
</span>
</>
<span>
<ImageBox src={url} alt="My Image" />
</span>
);
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/composition/Feed/ImageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Iprops {
}

const ImageContainer = ({ images }: Iprops) => {
if (!images) return <>______</>;
if (!images) return <></>;
return (
<>
{images.map(image =>
Expand Down
24 changes: 11 additions & 13 deletions client/src/composition/Feed/WritingFeed/WritingPresenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,17 @@ function WritingFeedPresenter({
</ContentRow>
<ContentRow>
{files && files.length > 0 && (
<>
<FilesContainer>
{files.map((file: { fileUrl: string; fileId: number }) => (
<UploadPreviewImg
key={file.fileId}
fileUrl={file.fileUrl}
fileId={file.fileId}
deleteFile={deleteFile}
/>
))}
<UploadPlusButton targetId={FILE_INPUT_ID} />
</FilesContainer>
</>
<FilesContainer>
{files.map((file: { fileUrl: string; fileId: number }) => (
<UploadPreviewImg
key={file.fileId}
fileUrl={file.fileUrl}
fileId={file.fileId}
deleteFile={deleteFile}
/>
))}
<UploadPlusButton targetId={FILE_INPUT_ID} />
</FilesContainer>
)}
</ContentRow>
</ContentWrapper>
Expand Down
24 changes: 10 additions & 14 deletions client/src/composition/Search/CardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,19 @@ function CardContainer({ location }: IProps) {
if (loading) return <p>로딩중...</p>;
if (error)
return (
<>
<UserCard
nickname="데이터를 가져오는데 에러가 발생하였습니다!"
imageUrl={
process.env.PUBLIC_URL + '/images/search_notfound.png'
}></UserCard>
</>
<UserCard
nickname="데이터를 가져오는데 에러가 발생하였습니다!"
imageUrl={
process.env.PUBLIC_URL + '/images/search_notfound.png'
}></UserCard>
);
if (data.searchUser.length === 0)
return (
<>
<UserCard
nickname={`${keyword}에 대한 검색 결과가 없습니다`}
imageUrl={
process.env.PUBLIC_URL + '/images/search_notfound.png'
}></UserCard>
</>
<UserCard
nickname={`${keyword}에 대한 검색 결과가 없습니다`}
imageUrl={
process.env.PUBLIC_URL + '/images/search_notfound.png'
}></UserCard>
);

function sendFriendRequest(email: string) {
Expand Down
6 changes: 1 addition & 5 deletions client/src/pages/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ interface IProps {
}

const Search = (props: IProps) => {
return (
<>
<CardContainer location={props.location} />
</>
);
return <CardContainer location={props.location} />;
};

export default Search;

0 comments on commit fc5269f

Please sign in to comment.