-
Notifications
You must be signed in to change notification settings - Fork 3
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: 프로필 내 모임추가 #1286
Closed
Closed
feat: 프로필 내 모임추가 #1286
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8486739
feat: 프로필 내 모임추가
seojisoosoo 0ce6bef
Merge branch 'main' into feat/#1274-meetingCard
seojisoosoo dc13ab4
refactor: meetingList undefined 아닐 때에 length 구하도록 수정
seojisoosoo 20e4179
refactor: 코드리뷰 반영
seojisoosoo efdd0f7
chore: 모임 없는 경우 워딩 수정
seojisoosoo 47a1523
Merge branch 'main' into feat/#1274-meetingCard
seojisoosoo 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 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,53 @@ | ||
import axios from 'axios'; | ||
import { z } from 'zod'; | ||
|
||
// FIXME: 1/28 데모데이 due date가 얼마 남지 않은 이슈로 크루 api와 바로 통신했습니다. | ||
// 플그 서버와 통신하도록 수정 + zod, createEndPoint 사용하도록 변경 필요합니다. 담당자: FE 서지수, BE 이승헌 | ||
// 무한스크롤 적용해야합니다. | ||
|
||
const MeetingSchema = z.object({ | ||
id: z.number(), | ||
isMeetingLeader: z.boolean(), | ||
title: z.string(), | ||
imageUrl: z.string(), | ||
category: z.string(), | ||
isActiveMeeting: z.boolean(), | ||
mstartDate: z.string(), | ||
mendDate: z.string(), | ||
}); | ||
|
||
const MetaSchema = z.object({ | ||
page: z.number(), | ||
take: z.number(), | ||
itemCount: z.number(), | ||
pageCount: z.number(), | ||
hasPreviousPage: z.boolean(), | ||
hasNextPage: z.boolean(), | ||
}); | ||
|
||
export const CREW_ORIGIN = | ||
process.env.NODE_ENV === 'development' ? `https://crew.api.dev.sopt.org` : `https://crew.api.prod.sopt.org`; | ||
|
||
// export const getMeetings = createEndpoint({ | ||
// request: (orgUserId: number) => ({ | ||
// method: 'GET', | ||
// url: `${CREW_ORIGIN}/meeting/v2/org-user?orgUserId=${orgUserId}`, | ||
// }), | ||
// serverResponseScheme: z.object({ | ||
// meetings: z.array(MeetingSchema), | ||
// meta: MetaSchema, | ||
// }), | ||
// }); | ||
|
||
// export const getMeetings = async (orgUserId: number) => { | ||
// await axios.request({ | ||
// method: 'GET', | ||
// baseURL: `${CREW_ORIGIN}/meeting/v2/org-user?orgUserId=${orgUserId}`, | ||
// }); | ||
// }; | ||
|
||
export async function getMeetings(orgUserId: number) { | ||
const data = await axios.get(`https://crew.api.dev.sopt.org/meeting/v2/org-user?orgUserId=${orgUserId}`); | ||
|
||
return data.data?.meetings; | ||
} |
This file contains 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 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,3 +1,68 @@ | ||
export default function MemberMeetingCard() { | ||
return <div>MemberGroupCard</div>; | ||
import styled from '@emotion/styled'; | ||
import { colors } from '@sopt-makers/colors'; | ||
import dayjs from 'dayjs'; | ||
import Link from 'next/link'; | ||
|
||
import ContentsCard from '@/components/common/ContentsCard'; | ||
import { playgroundLink } from '@/constants/links'; | ||
|
||
interface Meeting { | ||
id: number; | ||
isMeetingLeader: boolean; | ||
title: string; | ||
category: string; | ||
imageUrl: string; | ||
isActiveMeeting: boolean; | ||
mstartDate: string; | ||
mendDate: string; | ||
} | ||
|
||
interface MeetingProps extends Meeting { | ||
userName: string; | ||
} | ||
|
||
export default function MemberMeetingCard({ | ||
id, | ||
isMeetingLeader, | ||
title, | ||
category, | ||
imageUrl, | ||
mstartDate, | ||
mendDate, | ||
isActiveMeeting, | ||
userName, | ||
}: MeetingProps) { | ||
const meetingCategory = isMeetingLeader ? `${category} | ${userName}님이 만든 모임` : category; | ||
const startDate = dayjs(mstartDate).format('YYYY.MM.DD'); | ||
const endDate = dayjs(mendDate).format('YYYY.MM.DD'); | ||
const date = startDate === endDate ? startDate : `${startDate} - ${endDate}`; | ||
|
||
return ( | ||
<Link href={playgroundLink.groupDetail(id)}> | ||
<ContentsCard | ||
thumbnail={imageUrl} | ||
title={title} | ||
top={meetingCategory} | ||
bottom={ | ||
<Bottom> | ||
<Circle isActiveMeeting={isActiveMeeting} /> | ||
{date} | ||
</Bottom> | ||
} | ||
/> | ||
</Link> | ||
); | ||
} | ||
|
||
const Circle = styled.div<{ isActiveMeeting: boolean }>` | ||
border-radius: 50%; | ||
background-color: ${({ isActiveMeeting }) => (isActiveMeeting ? '#CDF47C' : colors.gray300)}; | ||
width: 6px; | ||
height: 6px; | ||
`; | ||
|
||
const Bottom = styled.footer` | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
`; |
This file contains 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 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.
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.
쿼리키는 꼭 넣어주시구 이대로도 잘 동작한다면 2번은 나중에 반영해도 될 것 같아요!
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.
급하게 하느라 꼼꼼하지 못했는데.. 챙겨주셔서 넘 감사합니다ㅜㅜ