-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/wineid #49
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
Feature/wineid #49
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
31c6320
feat: [wineid]ui๊ตฌํ+๋ฆฌ๋ทฐ์นด๋ ์์น์กฐ์
626-ju 61a4e6e
fix: gnb z์ธ๋ฑ์ค ์์น ์์
626-ju d36663d
feat: shadcn progress์ถ๊ฐ
626-ju 97cfb38
feat:ํ๋ก๊ทธ๋ ์ค ui์ถ๊ฐ
626-ju 2e45e7d
refactor: WineRating.tsx ๋ฐฐ์น ๊ฐ์
626-ju 6996733
Merge branch 'dev' into feature/wineid
626-ju c904f73
feat:ํ๊ท ๋ณ์ ์ปดํฌ๋ํธ ์ถ๊ฐ + ๋ณ์ ๋ฑ์ง ๋ด๋ถ๊ฐ๊ฒฉ ์ํญ ์กฐ์
626-ju 275c726
Merge branch 'dev' into feature/wineid
626-ju 6a07a20
feat: FlavorSliderList ์ถ๊ฐ+์ผ๋ฐฅ+์ข์์๋ฒํผ ์ถ๊ฐ
626-ju b6d0cd7
feat: ReviewCard์ปดํฌ๋ํธ์ useClickToggle ํ
์ถ๊ฐํ๊ธฐ
626-ju e769a1b
feat: ์นด๋ ์ด๊ณ ๋ซ๊ณ ์ ๋๋ฉ์ด์
์ถ๊ฐ
626-ju f8b1e8d
style: ํฌ๋งทํ
626-ju e9fe01b
refactor: ํ
์คํธ์ฉ ๋๋ฏธ ํ์ผ ๋ถ๋ฆฌ
626-ju 813f3e5
refactor: 1์ฐจ qa ํผ๋๋ฐฑ ๋ฐ์
626-ju 4c0cbe9
build: svgํ์ผ๋ค ํด๋ ๋ณ๊ฒฝ์ ๋ฐ๋ฅธ ์ํฌํธ ๊ฒฝ๋ก ์์
626-ju dca39e1
Merge branch 'dev' into feature/wineid
626-ju 91064d0
chore: ๋ถํ์ํ ์ฃผ์ ์ ๊ฑฐ
626-ju fc5f8c1
feat: ์ผ๋ฐฅ์ ์ถ๊ฐ ๋๋๋ค์ด ์ถ๊ฐ+์ถํ ์ ์ง๋ ๊ป๋ก ๊ต์ฒด
626-ju e4007fc
feat: og ์ด๋ฏธ์ง ์ถ๊ฐ
626-ju 49419ad
fix: env๋ค์ด๊ฐ ๊ฑฐ ๋นผ๊ธฐ
626-ju 16d5e45
fix:og์ด๋ฏธ์ง ๋๋ฝ ์์
626-ju 60ab8e4
refactor(mentor): hidden->sr-only
626-ju a04e9a4
refactor(mentor): ๋ฆฌ๋ทฐ์นด๋ -> ์ฃผ์คํ๋๊ธฐ๋ฐ ํฉ์ฑ์ปดํฌ๋ํธ
626-ju d62a492
fix: ํ
์คํธ์ ์ ์ฉ๋๋ ํธ๋์ง์
์ ๊ฑฐ
626-ju 4b8c7bd
chore: ์ค๋ช
์ฃผ์ ์ถ๊ฐ
626-ju 2e26ed2
chore: ์ฌ์ฉํ์ง ์๋ useClickToggle.tsx์ญ์ (hooksํด๋๋ ๊ฐ์ด)
626-ju 8f8152a
chore:์คํ
์ด์ง ๋๋ฝ๋ ํ์ผ ์ถ๊ฐ
626-ju ee8b03d
Merge branch 'dev' into feature/wineid
626-ju 26d2e5c
refactor:wineid ์ด๋ฏธ์ง ์นด๋ ๊ทธ๋ผ๋ฐ์ด์
์ถ๊ฐ+์ฒ์ ๋ฆฌ๋ทฐ๋ ์ด๋ฆฌ๊ฒ
626-ju 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ yarn-error.log* | |
|
|
||
| # local env files | ||
| .env*.local | ||
| .env* | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
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.
File renamed without changes
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 |
|---|---|---|
| @@ -1,70 +1,114 @@ | ||
| import React from 'react'; | ||
|
|
||
| import ShowMoreBtn from '@/assets/icons/showMoreBtn.svg'; | ||
| import Star from '@/assets/icons/star.svg'; | ||
| import { Badge } from '@/components/ui/badge'; | ||
| import { Button } from '@/components/ui/button'; | ||
| import { cn } from '@/lib/utils'; | ||
| import useReviewCardStore from '@/stores/reviewCardStore'; | ||
|
|
||
| import { | ||
| ReviewCardProps, | ||
| UserHeaderProps, | ||
| TagAndRatingProps, | ||
| ReviewBodyProps, | ||
| ToggleButtonProps, | ||
| } from './ReviewCardTypes'; | ||
|
|
||
| interface ReviewCardProps { | ||
| userIcon: React.ReactNode; // ์ ์ ์์ด์ฝ | ||
| username: string; // ์ ์ ์ด๋ฆ | ||
| timeAgo: string; // ์์ฑ ์๊ฐ | ||
| tags: string[]; // ํ๊ทธ ๋ชฉ๋ก | ||
| rating: React.ReactNode; // ๋ณ์ ์์ญ slot | ||
| likeSlot: React.ReactNode; // ์ข์์ ๋ฒํผ slot | ||
| menuSlot: React.ReactNode; // ๋ฉ๋ด ๋ฒํผ slot | ||
| reviewText?: string; // ๋ฆฌ๋ทฐ ๋ชฉ๋ก | ||
| flavorSliderSlot?: React.ReactNode; // ์ฌ๋ผ์ด๋ | ||
| className?: string; // ์ปจํ ์ด๋ ํด๋์ค | ||
| /* | ||
| ์ฌ๊ธฐ ์ ํผ์๋ง ์ฌ์ฉํ๋ ๊ฒ ๊ฐ์์ | ||
| ์ ๊ฐ ์์๋ก ๊ฑด๋๋ ธ์ต๋๋ค. | ||
| ํน์ ๋ค๋ฅธ ๋ถ๋ค๋ ์ฐ๊ฒ ๋๋ค๋ฉด ๋ง์ํด์ฃผ์ธ์ | ||
| */ | ||
| export function ReviewCard({ children }: ReviewCardProps) { | ||
| return ( | ||
| <div className='rounded-xl bg-white p-4 md:p-8 xl:p-4 xl:px-6 shadow-sm border border-gray-300 md:pb-6 xl:pb-5 w-full xl:w-[800px]'> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function ReviewCard({ | ||
| userIcon, | ||
| username, | ||
| timeAgo, | ||
| tags, | ||
| rating, | ||
| likeSlot, | ||
| menuSlot, | ||
| reviewText, | ||
| flavorSliderSlot, | ||
| className, | ||
| }: ReviewCardProps) { | ||
| ReviewCard.UserHeader = function UserHeader({ userIcon, reviewId, children }: UserHeaderProps) { | ||
| const username = useReviewCardStore((state) => state.allReviews[reviewId]?.user.name); | ||
| const timeAgo = useReviewCardStore((state) => state.allReviews[reviewId]?.updatedAt); | ||
|
|
||
| return ( | ||
| <div | ||
| className={cn('w-full rounded-xl bg-white p-4 shadow-sm border border-gray-300', className)} | ||
| > | ||
| {/* ์๋จ: ์ ์ ์ ๋ณด & ์ฐ์ธก slot */} | ||
| <div className='flex justify-between items-start'> | ||
| <div className='flex items-center gap-3'> | ||
| <div className='w-8 h-8 rounded-full bg-gray-200 overflow-hidden'>{userIcon}</div> | ||
| <div className='flex flex-col'> | ||
| <span className='text-sm font-medium text-gray-900'>{username}</span> | ||
| <span className='text-xs text-gray-500'>{timeAgo}</span> | ||
| </div> | ||
| <div className='flex justify-between items-start'> | ||
| <div className='flex items-center gap-4'> | ||
| <div className='w-10 h-10 md:w-16 md:h-16 rounded-full bg-gray-200 overflow-hidden'> | ||
| {userIcon} | ||
| </div> | ||
|
|
||
| {/* ์ข์์ & ๋ฉ๋ด */} | ||
| <div className='flex items-center gap-2'> | ||
| {likeSlot} | ||
| {menuSlot} | ||
| <div className='flex flex-col'> | ||
| <span className='custom-text-lg-semibold text-gray-900'>{username}</span> | ||
| <span className='custom-text-md-regular text-gray-500'>{timeAgo}</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* ํ๊ทธ & ๋ณ์ */} | ||
| <div className='mt-3 flex justify-between items-center'> | ||
| <div className='flex flex-wrap gap-2'> | ||
| {tags.map((tag, idx) => ( | ||
| <span key={idx} className='rounded-full bg-gray-100 px-3 py-1 text-xs text-gray-700'> | ||
| {tag} | ||
| </span> | ||
| ))} | ||
| </div> | ||
| {rating} | ||
| {/* ์ข์์ & ๋ฉ๋ด */} | ||
| <div className='flex items-center gap-2'>{children}</div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| ReviewCard.TagAndRating = function TagAndRating({ reviewId }: TagAndRatingProps) { | ||
| const tags = useReviewCardStore((state) => state.allReviews[reviewId]?.aroma ?? []); | ||
| const rating = useReviewCardStore((state) => state.allReviews[reviewId]?.rating); | ||
| return ( | ||
| <div className='mt-3 flex justify-between items-center'> | ||
| <div className='flex flex-wrap gap-2'> | ||
| {tags.map((tag) => ( | ||
| <Badge | ||
| key={tag} | ||
| className='mt-4 rounded-full bg-white border-gray-300 px-[10px] py-[6px] md:px-[15px] md:py-2 custom-text-lg-regular text-gray-700' | ||
| variant='flavor' | ||
| > | ||
| {tag} | ||
| </Badge> | ||
| ))} | ||
| </div> | ||
| <Badge variant='star' className='inline-flex gap-1 items-center'> | ||
| <Star className='size-3 md:size-4 md:mt-[-2px]' /> {rating} | ||
| </Badge> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| {/* ๋ฆฌ๋ทฐ ํ ์คํธ */} | ||
| {reviewText && <p className='mt-3 text-sm text-gray-800 leading-relaxed'>{reviewText}</p>} | ||
| ReviewCard.ReviewBody = function ReviewBody({ reviewId, flavorSliderSlot }: ReviewBodyProps) { | ||
| const reviewText = useReviewCardStore((state) => state.allReviews[reviewId]?.content); | ||
| const isOpen = useReviewCardStore((state) => state.allReviews[reviewId]?.isOpen); | ||
|
|
||
| {/* ์ฌ๋ผ์ด๋ */} | ||
| {flavorSliderSlot && <div className='mt-4'>{flavorSliderSlot}</div>} | ||
| const cardTransition = cn('overflow-hidden transition-all duration-500 ease-in-out', { | ||
| 'opacity-100 translate-y-0 max-h-[1000px]': isOpen, | ||
| 'opacity-0 -translate-y-4 max-h-0': !isOpen, | ||
| }); | ||
|
|
||
| if (!reviewText && !flavorSliderSlot) null; | ||
|
|
||
| return ( | ||
| <div className={cardTransition}> | ||
| <p className='mt-9 text-[14px] md:text-[16px] leading-6 md:leading-[26px] text-gray-800'> | ||
| {reviewText} | ||
| </p> | ||
| <div className='mt-4 md:mt-6 xl:mt-5'>{flavorSliderSlot}</div> | ||
| </div> | ||
| ); | ||
| } | ||
| }; | ||
|
|
||
| ReviewCard.ToggleButton = function TogleButton({ reviewId }: ToggleButtonProps) { | ||
| const isOpen = useReviewCardStore((state) => state.allReviews[reviewId]?.isOpen); | ||
| const toggleReviewOpen = useReviewCardStore((state) => state.toggleReviewOpen); | ||
| return ( | ||
| <Button | ||
| size={null} //๋ฒํผ ๋ํดํธ ๋ฎ์ด์์ฐ๊ธฐ | ||
| width={null} | ||
| variant='onlyCancel' | ||
| onClick={() => toggleReviewOpen(reviewId)} | ||
| className={cn( | ||
| 'border-0 mx-auto [&_svg]:w-[30px] [&_svg]:h-[30px] block transition-all duration-500 ease-in-out mt-[-30px]', | ||
| { | ||
| 'scale-y-[-1] mt-0': isOpen, | ||
| }, | ||
| )} | ||
| > | ||
| <ShowMoreBtn /> | ||
| </Button> | ||
| ); | ||
| }; | ||
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,32 @@ | ||
| import { ReactNode } from 'react'; | ||
|
|
||
| interface ReviewCardProps { | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| interface UserHeaderProps { | ||
| userIcon: ReactNode; | ||
| reviewId: string; | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| interface TagAndRatingProps { | ||
| reviewId: string; | ||
| } | ||
|
|
||
| interface ReviewBodyProps { | ||
| reviewId: string; | ||
| flavorSliderSlot: ReactNode; | ||
| } | ||
|
|
||
| interface ToggleButtonProps { | ||
| reviewId: string; | ||
| } | ||
|
|
||
| export type { | ||
| ReviewCardProps, | ||
| UserHeaderProps, | ||
| TagAndRatingProps, | ||
| ReviewBodyProps, | ||
| ToggleButtonProps, | ||
| }; |
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,24 @@ | ||
| import * as React from 'react'; | ||
|
|
||
| import * as ProgressPrimitive from '@radix-ui/react-progress'; | ||
|
|
||
| import { cn } from '@/lib/utils'; | ||
|
|
||
| const Progress = React.forwardRef< | ||
| React.ElementRef<typeof ProgressPrimitive.Root>, | ||
| React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> | ||
| >(({ className, value, ...props }, ref) => ( | ||
| <ProgressPrimitive.Root | ||
| ref={ref} | ||
| className={cn('relative h-2 w-full overflow-hidden rounded-full bg-primary/20', className)} | ||
| {...props} | ||
| > | ||
| <ProgressPrimitive.Indicator | ||
| className='h-full w-full flex-1 bg-primary transition-all' | ||
| style={{ transform: `translateX(-${100 - (value || 0)}%)` }} | ||
| /> | ||
| </ProgressPrimitive.Root> | ||
| )); | ||
| Progress.displayName = ProgressPrimitive.Root.displayName; | ||
|
|
||
| export { Progress }; |
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.
ํฉ์ฑ ์ปดํฌ๋ํธ๋ก ๋ณ๊ฒฝํ๋ ์ปดํฌ๋ํธ์ ์ญํ ๊ตฌ๋ถ์ด ์ ๋์ด๋ณด์ด๋ค์