-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor : 리스트 아이템 컴포넌트 수정&리팩토링 (#462)
* chore : 메뉴 카테고리 반복되는 코드 map으로 정리 * asset : 누락된 svg 파일 추가 * chore : url 파라미터명을 selectedLetterType로 수정 * feat : 스토어 내부 편지 관련 타입 정의 수정 * chore : 변경된 url 파라미터명으로 코드 갱신 * feat : 카테고리 렌더링 부분을 분리 * chore : 타입명 수정 * refactor : 리스트 아이템 컴포넌트 리팩토링
- Loading branch information
Showing
11 changed files
with
210 additions
and
129 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
type BoxType = 'SEND' | 'RECEIVE'; | ||
type LetterType = 'LETTER' | 'REPLY_LETTER'; | ||
|
||
interface CategoryProps { | ||
boxType: BoxType; | ||
letterType: LetterType; | ||
} | ||
|
||
const categoryStyle = 'text-sm'; | ||
|
||
export const Category = ({ boxType, letterType }: CategoryProps) => { | ||
const classification = `${boxType}-${letterType}`; | ||
switch (classification) { | ||
case 'SEND-LETTER': | ||
return <div className={categoryStyle}>보낸 편지</div>; | ||
case 'SEND-REPLY_LETTER': | ||
return <div className={categoryStyle}>보낸 답장</div>; | ||
case 'RECEIVE-LETTER': | ||
return <div className={categoryStyle}>받은 편지</div>; | ||
case 'RECEIVE-REPLY_LETTER': | ||
return <div className={categoryStyle}>받은 답장</div>; | ||
default: | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.