From 7a819c04d16da4990764d242f6daf50b6b1cf488 Mon Sep 17 00:00:00 2001 From: gwagjiug Date: Tue, 24 Feb 2026 02:00:06 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EC=9D=98=20props=20=EC=A0=95=EB=A6=AC=20=EB=B0=8F=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community-edit/community-edit.tsx | 3 +-- .../comment-input-box/comment-input-box.tsx | 20 +++++++++---------- .../community-line/community-line.tsx | 2 +- .../feed-detail-info/feed-detail-info.tsx | 12 +++++------ .../feed-list-item/feed-list-item.tsx | 16 +++++++-------- .../account-menu-bar/account-menu-bar.tsx | 2 +- .../widgets/mypage/components/body/body.tsx | 1 + .../report/components/accordion/accordion.tsx | 4 +--- .../widgets/report/components/ipwon/ipwon.tsx | 4 +--- .../report/components/maturity/maturity.tsx | 10 ++-------- .../widgets/report/components/price/price.tsx | 7 ++----- .../report/components/recommend/recommend.tsx | 3 +-- .../report/components/samang/samang.tsx | 4 +--- .../widgets/report/components/susul/susul.tsx | 4 +--- .../widgets/report/hooks/use-move-scroll.tsx | 5 ++++- 15 files changed, 41 insertions(+), 56 deletions(-) diff --git a/apps/client/src/pages/community/community-edit/community-edit.tsx b/apps/client/src/pages/community/community-edit/community-edit.tsx index a0cbcb93d..d674a7f54 100644 --- a/apps/client/src/pages/community/community-edit/community-edit.tsx +++ b/apps/client/src/pages/community/community-edit/community-edit.tsx @@ -36,6 +36,7 @@ const CommunityEdit = () => { const navigate = useNavigate(); const queryClient = useQueryClient(); const { postId } = useParams<{ postId: string }>(); + const { uploadImageFiles } = useImageUpload(); if (!postId) { throw new Error('게시글 Id가 존재하지 않습니다.'); @@ -55,8 +56,6 @@ const CommunityEdit = () => { }, }); - const { uploadImageFiles } = useImageUpload(); - if (!feedDetailData) { throw new Error( '글 수정 페이지에서 원본 피드 데이터를 불러오지 못했습니다.', diff --git a/apps/client/src/widgets/community/components/comment-input-box/comment-input-box.tsx b/apps/client/src/widgets/community/components/comment-input-box/comment-input-box.tsx index d659e7df1..7d4858cde 100644 --- a/apps/client/src/widgets/community/components/comment-input-box/comment-input-box.tsx +++ b/apps/client/src/widgets/community/components/comment-input-box/comment-input-box.tsx @@ -14,26 +14,26 @@ import * as styles from './comment-input-box.css'; interface CommentInputBoxProps { value: string; - onChange: (e: ChangeEvent) => void; - errorState?: boolean; - onSubmit: (file?: File) => void; focusKey?: string; - selectedFile: File | null; + errorState?: boolean; previewUrl?: string; - onImageChange: (file: File | null) => void; + selectedFile: File | null; + onChange: (e: ChangeEvent) => void; + onSubmit: (file?: File) => void; onClearImage?: () => void; + onImageChange: (file: File | null) => void; } const CommentInputBox = ({ value, - onChange, - errorState, - onSubmit, focusKey, - selectedFile, + errorState, previewUrl, - onImageChange, + selectedFile, + onChange, + onSubmit, onClearImage, + onImageChange, }: CommentInputBoxProps) => { const fileInputRef = useRef(null); const wrapperRef = useRef(null); diff --git a/apps/client/src/widgets/community/components/community-line/community-line.tsx b/apps/client/src/widgets/community/components/community-line/community-line.tsx index 570756ac5..534b246d1 100644 --- a/apps/client/src/widgets/community/components/community-line/community-line.tsx +++ b/apps/client/src/widgets/community/components/community-line/community-line.tsx @@ -9,8 +9,8 @@ import * as styles from './community-line.css'; interface CommunityLineProps { value: string; - onChange: (e: React.ChangeEvent) => void; onSubmit?: () => void; + onChange: (e: React.ChangeEvent) => void; } const CommunityLine = ({ value, onChange, onSubmit }: CommunityLineProps) => { diff --git a/apps/client/src/widgets/community/components/feed-detail-info/feed-detail-info.tsx b/apps/client/src/widgets/community/components/feed-detail-info/feed-detail-info.tsx index 0dcfcc87e..ab3d68a8d 100644 --- a/apps/client/src/widgets/community/components/feed-detail-info/feed-detail-info.tsx +++ b/apps/client/src/widgets/community/components/feed-detail-info/feed-detail-info.tsx @@ -7,25 +7,25 @@ import { Image } from '@shared/types/type.ts'; import * as styles from './feed-detail-info.css'; interface FeedDetailInfoProps { + title: string; + content: string; nickname: string; + imageUrl: Image[]; createdAt: string; profileImage: string; isOwner: boolean; - imageUrl: Image[]; - title: string; - content: string; onEditClick: () => void; onDeleteClick: () => void; } export const FeedDetailInfo = ({ + title, + content, nickname, + imageUrl, createdAt, profileImage, isOwner, - imageUrl, - title, - content, onEditClick, onDeleteClick, }: FeedDetailInfoProps) => { diff --git a/apps/client/src/widgets/community/components/feed-list-item/feed-list-item.tsx b/apps/client/src/widgets/community/components/feed-list-item/feed-list-item.tsx index 4feb04b0b..09f3b11e4 100644 --- a/apps/client/src/widgets/community/components/feed-list-item/feed-list-item.tsx +++ b/apps/client/src/widgets/community/components/feed-list-item/feed-list-item.tsx @@ -7,27 +7,27 @@ import { getTimeAgo } from '@shared/utils/utils'; import * as styles from './feed-list-item.css'; interface FeedListItemProps { - title?: string; text?: string; - writerNickname?: string; + title?: string; createdAt?: string; - commentCount?: number; likeCount?: number; + commentCount?: number; + writerNickname?: string; + profileImageUrl: string; isLiked?: boolean; onClick: () => void; - profileImageUrl: string; } const FeedListItem = ({ - title, text, - writerNickname, + title, createdAt, - commentCount, likeCount, + commentCount, + writerNickname, + profileImageUrl, isLiked, onClick, - profileImageUrl, }: FeedListItemProps) => { return (
diff --git a/apps/client/src/widgets/mypage/components/account-menu-bar/account-menu-bar.tsx b/apps/client/src/widgets/mypage/components/account-menu-bar/account-menu-bar.tsx index 9f6548a61..95bd00cfc 100644 --- a/apps/client/src/widgets/mypage/components/account-menu-bar/account-menu-bar.tsx +++ b/apps/client/src/widgets/mypage/components/account-menu-bar/account-menu-bar.tsx @@ -13,6 +13,7 @@ import { routePath } from '@shared/router/path'; import * as styles from './account-menu-bar.css'; const AccountMenuBar = () => { + const { openModal, closeModal } = useModal(); const queryClient = useQueryClient(); const { mutate: kakaoLogout } = useMutation({ @@ -36,7 +37,6 @@ const AccountMenuBar = () => { authService.logout(); }, }); - const { openModal, closeModal } = useModal(); const handleLogout = () => { openModal( diff --git a/apps/client/src/widgets/mypage/components/body/body.tsx b/apps/client/src/widgets/mypage/components/body/body.tsx index 8891f9086..2a14e5fb8 100644 --- a/apps/client/src/widgets/mypage/components/body/body.tsx +++ b/apps/client/src/widgets/mypage/components/body/body.tsx @@ -40,6 +40,7 @@ const Body = ({ nickname, profileImage }: ContentProps) => { const handleProfileEdit = () => { toggleEditing(); + if (isEditing) { handlePatchUserProfile(); } diff --git a/apps/client/src/widgets/report/components/accordion/accordion.tsx b/apps/client/src/widgets/report/components/accordion/accordion.tsx index 39512a089..77337b9bc 100644 --- a/apps/client/src/widgets/report/components/accordion/accordion.tsx +++ b/apps/client/src/widgets/report/components/accordion/accordion.tsx @@ -37,10 +37,8 @@ interface AccordionPanelStyle extends React.CSSProperties { } export const Accordion = ({ children }: accordionProps) => { - const defaultExpanded = false; - return ( - +
{children}
); diff --git a/apps/client/src/widgets/report/components/ipwon/ipwon.tsx b/apps/client/src/widgets/report/components/ipwon/ipwon.tsx index 07f05717f..919504780 100644 --- a/apps/client/src/widgets/report/components/ipwon/ipwon.tsx +++ b/apps/client/src/widgets/report/components/ipwon/ipwon.tsx @@ -21,8 +21,6 @@ interface IpwonProps { reportId: string; } -const TEXT_TITLE = '입원'; - const IPWON_COMPONENT = [ { Component: Jilbyeong, key: ACCORDION_CATEGORY.IPWON.JILBYEONG }, { Component: Sanghae, key: ACCORDION_CATEGORY.IPWON.SANGHAE }, @@ -54,7 +52,7 @@ const Ipwon = ({ sectionData, reportId }: IpwonProps) => { return (
- {TEXT_TITLE} + 입원
{ return (
-

{MATURITY}

-

- {age} - {AGELABEL} -

+

만기

+

{age}세

); }; diff --git a/apps/client/src/widgets/report/components/price/price.tsx b/apps/client/src/widgets/report/components/price/price.tsx index c872fb32c..cae565ac9 100644 --- a/apps/client/src/widgets/report/components/price/price.tsx +++ b/apps/client/src/widgets/report/components/price/price.tsx @@ -6,17 +6,14 @@ interface PriceProps { price: number; } -const MONTH = '월'; -const WON = '원'; - const Price = ({ price }: PriceProps) => { const formattedPrice = formatPrice(price); return (
-

{MONTH}

+

{formattedPrice}

-

{WON}

+

); }; diff --git a/apps/client/src/widgets/report/components/recommend/recommend.tsx b/apps/client/src/widgets/report/components/recommend/recommend.tsx index cac651135..00a9fa2de 100644 --- a/apps/client/src/widgets/report/components/recommend/recommend.tsx +++ b/apps/client/src/widgets/report/components/recommend/recommend.tsx @@ -6,7 +6,6 @@ interface RecommendProps { reasonList: string[]; } -const REASON = '추천 이유'; const BULLET = '\u2022'; const Recommend = ({ reasonList }: RecommendProps) => { @@ -21,7 +20,7 @@ const Recommend = ({ reasonList }: RecommendProps) => { height="1.92rem" />
-

{REASON}

+

추천 이유

    {reasonList.map((item, index) => ( diff --git a/apps/client/src/widgets/report/components/samang/samang.tsx b/apps/client/src/widgets/report/components/samang/samang.tsx index e1f81ef99..24b141eae 100644 --- a/apps/client/src/widgets/report/components/samang/samang.tsx +++ b/apps/client/src/widgets/report/components/samang/samang.tsx @@ -21,8 +21,6 @@ interface SamangProps { reportId: string; } -const TEXT_TITLE = '사망'; - const SAMANG_COMPONENT = [ { Component: Jilbyeong, key: ACCORDION_CATEGORY.SAMANG.JILBYEONG }, { Component: Sanghae, key: ACCORDION_CATEGORY.SAMANG.SANGHAE }, @@ -54,7 +52,7 @@ const Samang = ({ sectionData, reportId }: SamangProps) => { return (
    - {TEXT_TITLE} + 사망
    { return (
    - {TEXT_TITLE} + 수술
    { }; window.addEventListener('scroll', onScroll); - return () => window.removeEventListener('scroll', onScroll); + + return () => { + window.removeEventListener('scroll', onScroll); + }; }, [scrollRefs]); const handleCategoryClick = (category: HOME_CATEGORY_TAB) => {