-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/139/gathering card UI #151
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
8 commits
Select commit
Hold shift + click to select a range
edcba37
๐ Style: ๋์ ์ฝ์ ์นด๋ ๋์์ธ ์์
minkyung5x5 d68f01c
๐ style: ๋์ ์ฝ์ ์นด๋ ui ์์ , location ์ถ๊ฐ
minkyung5x5 cac61dc
๐ fix: formatDate ์์ผ ๋ถ๋ฆฌ
minkyung5x5 7df1a87
๐ Style: gathering-detail-modal ui ๋ณ๊ฒฝ
minkyung5x5 764b9bd
๐ Style: ํญ ui ์์
minkyung5x5 4ac96cd
๐ Style: tailwind class order ์์
minkyung5x5 4782113
Merge branch 'develop' into Feat/139/gathering-card-ui
minkyung5x5 addb265
๐ Style: ๋ง์ดํ์ด์ง ํญ ์์
minkyung5x5 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
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
97 changes: 28 additions & 69 deletions
97
src/components/common/gathering-card/scheduled-gathering-card/presenter.tsx
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,98 +1,57 @@ | ||
| import Image from 'next/image'; | ||
| import { Badge } from '@mantine/core'; | ||
| import { formatDate } from '@/src/utils/format-date'; | ||
| import LikeBtn from '@/src/components/common/input/button/like-btn'; | ||
| import IcoPerson from '@/public/assets/icons/person.svg'; | ||
| import { GatheringCardProps } from '@/src/types/gathering-data'; | ||
| import IcoPerson from '@/public/assets/icons/ic-gathering-person.svg'; | ||
| import Button from '../../input/button'; | ||
|
|
||
| interface ScheduledGatheringCardPresenterProps { | ||
| data: { | ||
| id: number; | ||
| crewTitle: string; | ||
| crewMainLocation: string; | ||
| crewSubLocation: string; | ||
| title: string; | ||
| dateTime: string; | ||
| currentCount: number; | ||
| totalCount: number; | ||
| imageUrl: string; | ||
| liked: boolean; | ||
| }; | ||
| data: GatheringCardProps; | ||
| onClick: () => void; | ||
| } | ||
|
|
||
| export default function ScheduledGatheringCardPresenter({ | ||
| data, | ||
| onClick, | ||
| }: ScheduledGatheringCardPresenterProps) { | ||
| const { | ||
| id, | ||
| crewTitle, | ||
| crewMainLocation, | ||
| crewSubLocation, | ||
| title, | ||
| dateTime, | ||
| currentCount, | ||
| totalCount, | ||
| imageUrl, | ||
| liked, | ||
| } = data; | ||
| const { crewTitle, title, dateTime, location, currentCount, totalCount, imageUrl } = data; | ||
|
|
||
| const { date, time } = formatDate(dateTime); | ||
| const { date, dayOfWeek, time } = formatDate(dateTime); | ||
|
|
||
| return ( | ||
| <div className="space-y-2"> | ||
| <div className="ml-2 flex items-center"> | ||
| <span className="text-xl font-semibold text-gray-800">{crewTitle}</span> | ||
| <div className="ml-2 mr-1 h-[18px] w-[2px] bg-black" /> | ||
| <span className="text-base font-medium text-gray-700"> | ||
| {crewMainLocation} {crewSubLocation} | ||
| </span> | ||
| </div> | ||
| <span className="text-xl font-semibold text-gray-800">{crewTitle}</span> | ||
| {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} | ||
| <div | ||
| onClick={onClick} | ||
| role="button" | ||
| tabIndex={0} | ||
| className="relative flex h-44 cursor-pointer items-center space-x-4 rounded-xl bg-white p-6 shadow-xs md:space-x-6 lg:space-x-6" | ||
| className="h-80 cursor-pointer items-center rounded-xl bg-white shadow-xs md:flex md:h-44" | ||
|
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. ๐ ๏ธ Refactor suggestion ์ ๊ทผ์ฑ ๊ฐ์ ์ ์ํ ์ ์์ฌํญ์ด ์์ต๋๋ค.
- {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
<div
onClick={onClick}
role="button"
tabIndex={0}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ onClick();
+ }
+ }}
className="h-80 cursor-pointer items-center rounded-xl bg-white shadow-xs md:flex md:h-44"
>
- <Image src={IcoPerson} alt="person icon" width={16} height={16} className="pb-0.5" />
+ <Image src={IcoPerson} alt="์ฐธ์ฌ ์ธ์ ์์ด์ฝ" width={16} height={16} className="pb-0.5" />
- <Button className="lg:w-1/ btn-filled w-40 md:w-1/2" onClick={onClick}>
+ <Button
+ className="lg:w-1/ btn-filled w-40 md:w-1/2"
+ onClick={onClick}
+ aria-label={`${title} ๋ชจ์ ์์ธ ์ ๋ณด ๋ณด๊ธฐ`}
+ >Also applies to: 31-31, 34-53 |
||
| > | ||
| {/* Image Section */} | ||
| <div className="relative h-28 w-28 flex-shrink-0 overflow-hidden rounded-lg md:h-32 md:w-32 lg:h-32 lg:w-32"> | ||
| <div className="relative h-1/2 w-full flex-shrink-0 overflow-hidden rounded-t-lg md:h-full md:w-1/3 md:rounded-l-lg md:rounded-r-none"> | ||
| <Image src={imageUrl} alt={title} layout="fill" className="object-cover" /> | ||
| </div> | ||
|
|
||
| {/* Content Section */} | ||
| <div className="flex h-full w-full min-w-0 flex-grow flex-col justify-between"> | ||
| <div className="space-y-2"> | ||
| <h3 className="w-full overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold text-gray-800"> | ||
| {title} | ||
| </h3> | ||
| <div className="space-x-2"> | ||
| <Badge | ||
| size="lg" | ||
| color="#111827" | ||
| radius="sm" | ||
| classNames={{ | ||
| label: 'font-pretendard, gathering-badge', | ||
| }} | ||
| > | ||
| {date} | ||
| </Badge> | ||
| <Badge | ||
| size="lg" | ||
| color="#111827" | ||
| radius="sm" | ||
| classNames={{ | ||
| label: 'font-pretendard, gathering-badge', | ||
| }} | ||
| > | ||
| {time} | ||
| </Badge> | ||
| <div className="flex h-1/2 w-full min-w-0 flex-grow flex-col justify-between p-4 md:h-full"> | ||
| <div className="overflow-hidden text-ellipsis whitespace-nowrap"> | ||
| <div className="mb-2 flex items-center space-x-2 text-sm font-semibold text-blue-500 md:text-base"> | ||
| <p>{`${date} ${dayOfWeek}`}</p> | ||
| <div className="h-[18px] w-[1px] bg-gray-300" /> | ||
| <p>{time}</p> | ||
| </div> | ||
| <h3 className="text-lg font-semibold text-gray-800 md:text-xl">{title}</h3> | ||
| <p className="text-xm mb-2 font-normal text-gray-700">{location}</p> | ||
| </div> | ||
| <div className="flex justify-between"> | ||
| <div className="flex items-end space-x-1 pb-2 md:pb-0"> | ||
| <Image src={IcoPerson} alt="person icon" width={16} height={16} className="pb-0.5" /> | ||
| <p className="text-sm font-normal text-gray-900"> | ||
| ์ฐธ์ฌ์ธ์ <span className="text-blue-500">{currentCount}</span>/{totalCount} | ||
| </p> | ||
| </div> | ||
| <Button className="lg:w-1/ btn-filled w-40 md:w-1/2" onClick={onClick}> | ||
| ์ฝ์ ์์ธํ ๋ณด๊ธฐ | ||
| </Button> | ||
| </div> | ||
| <p className="flex items-center text-base font-medium text-gray-700"> | ||
| <Image src={IcoPerson} alt="person icon" width={16} height={16} /> | ||
| ์ฐธ์ฌ์ธ์ {currentCount}/{totalCount} | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
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
Oops, something went wrong.
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.
๐ก Codebase verification
๋ฐ์ดํฐ ์ฒ๋ฆฌ์ ๋ํ ๋ฐฉ์ด ๋ก์ง์ด ํ์ํฉ๋๋ค
์ฝ๋ ๊ฒํ ๊ฒฐ๊ณผ, ๋ค์๊ณผ ๊ฐ์ ๊ฐ์ ์ด ํ์ํฉ๋๋ค:
data?.location์ดundefined์ผ ๋ ๋์ฒด ํ ์คํธ๊ฐ ์์ต๋๋ค.title,dateTime๋ฑ)์ ์ต์ ๋ ์ฒด์ด๋์ผ๋ก ์ฒ๋ฆฌ๋์ด ์์ง๋ง, ๋น ๊ฐ์ ๋ํ ๋์ฒด ํ ์คํธ๊ฐ ์์ต๋๋ค.๊ฐ์ ์ ์:
๐ Analysis chain
์์น ์ ๋ณด์ ๊ณต์ง์ฌํญ ์น์ ์ด ์ ๊ตฌ์ฑ๋์์ต๋๋ค!
์์น ์ ๋ณด ์ถ๊ฐ์ ๊ณต์ง์ฌํญ ์น์ ์ ๊ตฌ์กฐํ๊ฐ ์ ๋์์ต๋๋ค. ๋ค๋ง, ๋ฐ์ดํฐ ์ฒ๋ฆฌ ๊ด๋ จ ๋ณด์์ด ํ์ํด ๋ณด์ ๋๋ค.
๋ค์ ์ฌํญ๋ค์ ํ์ธํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค:
location๋ฐ์ดํฐ๊ฐ ์๋ ๊ฒฝ์ฐ์ ๋ํ ์ฒ๋ฆฌdata๊ฐ์ฒด๊ฐundefined์ธ ๊ฒฝ์ฐ์ ๋ํ ๋ฐฉ์ด ๋ก์ง์๋ ์คํฌ๋ฆฝํธ๋ก ๊ด๋ จ ์ฝ๋๋ฅผ ํ์ธํด๋ณด๊ฒ ์ต๋๋ค:
๐ Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 89
Script:
Length of output: 29688
Script:
Length of output: 383
Script:
Length of output: 3064