-
Notifications
You must be signed in to change notification settings - Fork 0
[Style] 모임상세 페이지 참여자 더보기 적용 #69
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
5 commits
Select commit
Hold shift + click to select a range
b3b0494
style: 모임상세 페이지 참여자 더보기 적용
HopeFullee f62db75
Merge branch 'main' into somang-style/meetup
HopeFullee bd41123
fix: 모임상세 더보기 400px 이하에서 고장현상 수리
HopeFullee a14cc4c
Merge branch 'main' into somang-style/meetup
HopeFullee dcef211
Merge branch 'main' into somang-style/meetup
HopeFullee 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,91 @@ | ||
| 'use client'; | ||
|
|
||
| import Image from 'next/image'; | ||
| import Link from 'next/link'; | ||
|
|
||
| import { useState } from 'react'; | ||
|
|
||
| import clsx from 'clsx'; | ||
|
|
||
| import type { DUMMY_MEETUP_DATA } from '@/app/meetup/[id]/page'; | ||
| import { Icon } from '@/components/icon'; | ||
| import { Button } from '@/components/ui'; | ||
|
|
||
| interface Props { | ||
| members: typeof DUMMY_MEETUP_DATA.members; | ||
| } | ||
|
|
||
| export const MeetupMembers = ({ members }: Props) => { | ||
| const [showMore, setShowMore] = useState(false); | ||
| const [coverMember, setCoverMember] = useState(2 < Math.ceil(members.length / 3)); | ||
|
|
||
| const hasMoreMember = 2 < Math.ceil(members.length / 3); | ||
|
|
||
| const onShowMoreClick = () => { | ||
| setShowMore((prev) => !prev); | ||
| setCoverMember((prev) => !prev); | ||
| }; | ||
|
|
||
| return ( | ||
| <section className='bg-gray-50 px-4 pt-6 pb-4'> | ||
| <section className='relative bg-gray-50 px-4 pt-6 pb-4'> | ||
| <h3 className='text-text-md-semibold px-2 text-gray-800'>참여자 정보</h3> | ||
| <ul className='flex-center mt-5 flex-wrap gap-y-4'> | ||
| {members.map(({ name, profileImage }) => ( | ||
| <li key={name} className='w-34 shrink-0'> | ||
| <Link href={'#'} className='flex-col-center gap-[6px]'> | ||
| <Image | ||
| width={64} | ||
| className='h-16 w-16 rounded-full' | ||
| alt='프로필 사진' | ||
| height={64} | ||
| objectFit='cover' | ||
| src={profileImage} | ||
| /> | ||
| <p className='text-text-xs-medium line-clamp-1 w-full text-center break-all text-gray-800'> | ||
| {name} | ||
| </p> | ||
| </Link> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
|
|
||
| <div className='mt-5'> | ||
| <ul className='flex-center flex-wrap'> | ||
| {members.map(({ name, profileImage }, idx) => ( | ||
| <li | ||
| key={name} | ||
| className={clsx( | ||
| 'relative h-25 w-34 shrink-0', | ||
| hasMoreMember && !showMore ? '[&:nth-child(n+7)]:hidden' : 'block', | ||
| )} | ||
| > | ||
| <div className='flex-col-center gap-[6px]'> | ||
| <Link href={'#'} className='select-none'> | ||
| <Image | ||
| width={64} | ||
| className='h-16 w-16 rounded-full' | ||
| alt='프로필 사진' | ||
| height={64} | ||
| objectFit='cover' | ||
| src={profileImage} | ||
| /> | ||
| </Link> | ||
| <p | ||
| className={clsx( | ||
| 'text-text-xs-medium line-clamp-1 w-full text-center break-all text-gray-800', | ||
| coverMember && idx === 5 ? 'hidden' : 'block', | ||
| )} | ||
| > | ||
| {name} | ||
| </p> | ||
| </div> | ||
|
|
||
| {coverMember && idx === 5 && ( | ||
| <div className='absolute inset-0'> | ||
| <span className='flex-center text-text-md-semibold mx-auto h-[65px] w-[65px] rounded-full bg-gray-200 text-gray-600'> | ||
| {members.length - 5}+ | ||
| </span> | ||
| </div> | ||
| )} | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
|
|
||
| {hasMoreMember && ( | ||
| <div className='flex-center'> | ||
| <Button | ||
| className='flex-center h-9 w-auto border-none bg-gray-50 px-4' | ||
| size='sm' | ||
| variant='secondary' | ||
| onClick={onShowMoreClick} | ||
| > | ||
| {showMore ? '접기' : '더보기'} | ||
| <Icon id={showMore ? 'chevron-up' : 'chevron-down'} width={16} height={16} /> | ||
| </Button> | ||
| </div> | ||
| )} | ||
| </section> | ||
| ); | ||
| }; |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
테일윈드 Customizing Spacing
이렇게도 가능