-
Notifications
You must be signed in to change notification settings - Fork 2
design: 내 편지함 페이지 퍼블리싱 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d2e9377
design: 내 편지함 목록 페이지 퍼블리싱
AAminha e300fe0
refactor: 리스트 디자인 컴포넌트로 분리
AAminha b680166
design: 컴포넌트 props명 수정 및 sender, receiver 디자인 변경
AAminha 8e5e69d
design: 내 편지함 상세 페이지 퍼블리싱
AAminha 95fb630
Merge branch 'develop' of https://github.com/prgrms-web-devcourse-fin…
AAminha a7da53e
refactor: 배경 이미지 삽입되는 로직 컴포넌트로 분리
AAminha 6f0a6ae
design: 필요한 모달 퍼블리싱 및 버튼과 연결
AAminha ca6e2c2
rename: ListItemContainer -> ListItemWrapper로 컴포넌트명 수정
AAminha e20e38d
refactor: 페이지 제목에 PageTitle 컴포넌트 적용
AAminha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
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 hidden or 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 hidden or 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,29 @@ | ||
| import { twMerge } from 'tailwind-merge'; | ||
|
|
||
| interface BackgroundImageWrapperProps { | ||
| as?: React.ElementType; | ||
| imageUrl: string; | ||
| className?: string; | ||
| children?: React.ReactNode; | ||
| onClick?: () => void; | ||
| } | ||
|
|
||
| const BackgroundImageWrapper = ({ | ||
| as: Component = 'div', | ||
| imageUrl, | ||
| className, | ||
| children, | ||
| onClick, | ||
| }: BackgroundImageWrapperProps) => { | ||
| return ( | ||
| <Component | ||
| className={twMerge('background-image-filled', className)} | ||
| style={{ '--bg-image': `url(${imageUrl})` } as React.CSSProperties} | ||
| onClick={onClick} | ||
| > | ||
| {children} | ||
| </Component> | ||
| ); | ||
| }; | ||
|
|
||
| export default BackgroundImageWrapper; |
This file contains hidden or 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 hidden or 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,31 @@ | ||
| import { twMerge } from 'tailwind-merge'; | ||
|
|
||
| interface ListItemWrapperProps { | ||
| isSender?: boolean; | ||
| className?: string; | ||
| children: React.ReactNode; | ||
| onClick?: (e: React.MouseEvent<HTMLElement>) => void; | ||
| } | ||
|
|
||
| const ListItemWrapper = ({ | ||
| isSender = false, | ||
| className, | ||
| children, | ||
| onClick, | ||
| }: ListItemWrapperProps) => { | ||
| return ( | ||
| <article | ||
| className={twMerge( | ||
| 'relative flex overflow-hidden rounded-sm p-4', | ||
| isSender ? 'list-sender-bg' : 'list-receiver-bg', | ||
| className, | ||
| )} | ||
| onClick={onClick} | ||
| > | ||
| <div className="z-10 w-full">{children}</div> | ||
| <div className="absolute inset-0 z-0 bg-white/50 blur-xl" /> | ||
| </article> | ||
| ); | ||
| }; | ||
|
|
||
| export default ListItemWrapper; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| import { Link } from 'react-router'; | ||
| import { twMerge } from 'tailwind-merge'; | ||
|
|
||
| interface LetterBoxItemProps { | ||
| zipCode: string; | ||
| letterCount: number; | ||
| isChecked?: boolean; | ||
| isClosed?: boolean; | ||
| } | ||
|
|
||
| const LetterBoxItem = ({ | ||
| zipCode, | ||
| letterCount, | ||
| isChecked = false, | ||
| isClosed = false, | ||
| }: LetterBoxItemProps) => { | ||
| return ( | ||
| <Link to="id"> | ||
| <article className="flex h-fit w-fit flex-col items-center"> | ||
| <div className="text-gray-70 flex h-25 w-20 flex-col gap-1.5 bg-linear-to-b from-[#D5B695] to-[#B3895D] p-1.5"> | ||
| <p | ||
| className={twMerge( | ||
| 'body-m from-white px-1', | ||
| isClosed | ||
| ? 'bg-[repeating-linear-gradient(#D9D9D9,#D9D9D9_17px,#C2C2C2_17px,#C2C2C2_23px)]' | ||
| : 'bg-linear-to-b', | ||
| isChecked ? 'to-[#FFF5ED]' : 'to-[#FFF4F2]', | ||
| )} | ||
| > | ||
| {zipCode} | ||
| </p> | ||
| {isClosed ? ( | ||
| <div className="flex grow flex-col bg-[repeating-linear-gradient(#D9D9D9,#D9D9D9_15px,#C2C2C2_15px,#C2C2C2_20px)]" /> | ||
| ) : ( | ||
| <div | ||
| className={twMerge( | ||
| 'flex grow flex-col bg-linear-to-b', | ||
| isChecked ? 'from-[#FFF7E3] to-[#FFE197]' : 'from-[#FFF4F2] to-[#FFE6E3]', | ||
| )} | ||
| > | ||
| <p className="body-r mt-auto mr-[1px] text-right">{letterCount}통</p> | ||
| </div> | ||
| )} | ||
| </div> | ||
| <div className="flex flex-col items-center"> | ||
| <div className="h-[7px] w-23 bg-[#D7A877]" /> | ||
| <div className="h-[3px] w-20 bg-[#A88156]" /> | ||
| <div className="h-1 w-18 bg-[#917B63]" /> | ||
| </div> | ||
| </article> | ||
| </Link> | ||
| ); | ||
| }; | ||
|
|
||
| export default LetterBoxItem; |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 창문의 갯수가 3의 배수가 아니거나, 창문갯수가 늘어나면 어떻게 처리 될까요? |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,45 @@ | ||
| import DoorImg from '@/assets/images/door.png'; | ||
| import PageTitle from '@/components/PageTitle'; | ||
| import { chunkBox } from '@/utils/chunkBox'; | ||
|
|
||
| import LetterBoxItem from './components/LetterBoxItem'; | ||
|
|
||
| const DUMMY_COUNT = 200; | ||
|
|
||
| const LetterBoxPage = () => { | ||
| return <div>LetterBoxPage</div>; | ||
| return ( | ||
| <main className="flex grow flex-col items-center px-5 pt-20"> | ||
| <PageTitle>내 편지함</PageTitle> | ||
| <div className="w-full max-w-94"> | ||
| <p className="body-sb mt-16 mb-[7px] place-self-start text-gray-50"> | ||
| 나와 연락한 사람들 {DUMMY_COUNT} | ||
| </p> | ||
| <section className="letter-box-bg flex grow flex-col items-center px-4 pt-5"> | ||
| <div className="flex w-full flex-col gap-5"> | ||
| {chunkBox( | ||
| Array.from({ length: 12 }).map((_, index) => ( | ||
| <LetterBoxItem | ||
| key={index} | ||
| zipCode="12E12" | ||
| letterCount={90} | ||
| isChecked={index % 2 === 0} | ||
| /> | ||
| )), | ||
| ).map((row, index) => ( | ||
| <div key={index} className="flex justify-between"> | ||
| {row} | ||
| </div> | ||
| ))} | ||
| <div className="flex justify-between"> | ||
| <LetterBoxItem zipCode="12E12" letterCount={90} isClosed /> | ||
| <img src={DoorImg} alt="출입문 이미지" /> | ||
| <LetterBoxItem zipCode="12E12" letterCount={90} isClosed /> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </div> | ||
| </main> | ||
| ); | ||
| }; | ||
|
|
||
| export default LetterBoxPage; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오옹 컴포넌트 타입을 따로 받을 수도 있군요! 그런데 왜 따로 받은 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시맨틱 태그에 신경쓰신다면 적절한 태그가 상황마다 다를 것 같아서 props로 받을 수 있게 했습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디테일 귀신 ㄷㄷㄷㄷ