Skip to content
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

[FEAT] MemberList에서 리더가 가장 처음에 위치하도록 수정 #243

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/features/MeetingDetail/MemberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { UuidProps } from './MeetingDetail.type';

export const MemberList = ({ uuid }: UuidProps) => {
const { data: memberData } = useSuspenseQuery(queries.meeting.participants(uuid));

const leader = memberData.participantInfoList.find((member) => member.isLeader);
const member = memberData.participantInfoList.filter((member) => !member.isLeader);

const totalParticipant = leader ? [leader, ...member] : memberData.participantInfoList;

return (
<FlexBox width="100%" padding="0 20px">
<Card>
Expand All @@ -19,7 +25,7 @@ export const MemberList = ({ uuid }: UuidProps) => {
{memberData.isAnonymous ? '익명' : '실명'}
</Chip>
<FlexBox flexDir="row" flexWrap="wrap" justifyContent="flex-start" gap={10}>
{memberData.participantInfoList.map((member, index) => (
{totalParticipant.map((member, index) => (
<Member
key={index}
isSubmitted={member.isAssigned}
Expand Down
Loading