-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/60/my-gathering-page #73
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
17 commits
Select commit
Hold shift + click to select a range
301244a
β¨ Feat: my-gathering λ²νΌ μΆκ° λ° νμ μ»΄ν¬λνΈ λΆλ¦¬
minkyung5x5 cdd2d66
β¨ Feat: νμ νμ΄μ§λ‘ λΆλ¦¬
minkyung5x5 6ac5383
Merge branch 'develop' into Feat/60/my-gathering-page
minkyung5x5 a8ace8f
β¨ Feat: GatheringList μΆκ°
minkyung5x5 e37ca96
Merge branch 'develop' into Feat/60/my-gathering-page
minkyung5x5 57f9da5
π Style: gatheringlist max-w μμ
minkyung5x5 76df121
π Style: μ 체 λ μ΄μμμ flex-1 μΆκ°
minkyung5x5 b7f92d1
β¨ Feat: gatheringListWithDate μ»΄ν¬λνΈ μΆκ°
minkyung5x5 7c9cbf3
π Style: gatheringListWithDate UI μμ
minkyung5x5 706cac6
β¨ Feat: popoverCalendar μΆκ°, π Fix: card λͺ¨λ°μΌνκ²½ μ΄λ―Έμ§ μ¬μ΄μ¦ μμ
minkyung5x5 5ecbd76
β¨ Feat: μ°Έμ¬ν λͺ¨μ νμ΄μ§ μΆκ°
minkyung5x5 1d78a85
β¨ Feat: gathering Detail Modal API μΆκ°
minkyung5x5 a61c8be
Merge branch 'develop' into Feat/60/my-gathering-page
minkyung5x5 83bc73c
Merge branch 'develop' into Feat/60/my-gathering-page
minkyung5x5 46df06f
π fix: κ²½λ‘μμ
minkyung5x5 1fc4c03
π fix: prettier error μμ
minkyung5x5 eb84994
π fix: api dummydataλ‘ μμ μμ
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -335,5 +335,40 @@ | |
| "isConfirmed": true, | ||
| "gatheringCount": 5 | ||
| } | ||
| ], | ||
| "gatheringDetail": [ | ||
| { | ||
| "id": 1, | ||
| "title": "μ λλ μ΄λ...μ¦κ±°μ΄..μ½λ©..", | ||
| "introduce": "곡μ§μ¬νμ λλ€. λ€λ€ μ΄λ² μ½μ μμ§ μμΌμ ¨μ£ ? κΌ μ°Έμ¬ λΆνλ립λλ€~", | ||
| "dateTime": "2024-10-29T00:32:12.306Z", | ||
| "location": "μμΈμ κ°λ¨κ΅¬ μμΌλ μ€νΌμ€νμ 3μΈ΅", | ||
| "currentCount": 3, | ||
| "totalCount": 10, | ||
| "imageUrl": "https://www.dabur.com/Blogs/Doshas/Importance%20and%20Benefits%20of%20Yoga%201020x450.jpg", | ||
| "isLiked": false, | ||
| "isGatherCaptain": false, | ||
| "isParticipant": true, | ||
| "participants": [ | ||
| { | ||
| "id": 1, | ||
| "profileImageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQUMrcQB5OJ-ETzPc6wHnjxjC-36__MGw3JcA&s", | ||
| "nickname": "λ½μμ¦μ¬", | ||
| "email": "[email protected]" | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "profileImageUrl": "https://imgcdn.stablediffusionweb.com/2024/5/13/c0541236-e690-4dff-a27e-30a0355e5ea0.jpg", | ||
| "nickname": "λͺ¨λλ¬λ", | ||
| "email": "[email protected]" | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "profileImageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQUMrcQB5OJ-ETzPc6wHnjxjC-36__MGw3JcA&s", | ||
| "nickname": "λκΈλκΈμ΄", | ||
| "email": "[email protected]" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
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,11 @@ | ||
| import { fetchApi } from '@/src/utils/api'; | ||
| import { GatheringDetailType } from '@/src/types/gathering-data'; | ||
|
|
||
| export function getGathering(): Promise<GatheringDetailType> { | ||
| return fetchApi<GatheringDetailType>('/gatheringDetail/1', { | ||
| method: 'GET', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| }).then((response) => response); // TODO: data μΆμΆ | ||
| } |
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,11 @@ | ||
| import { getGathering } from '@/src/_apis/gathering/gathering-apis'; | ||
| import { transformKeysToCamel } from '@/src/utils/transform-keys'; | ||
| import { GatheringDetailType } from '@/src/types/gathering-data'; | ||
|
|
||
| export function useGetGatheringQuery() { | ||
| return { | ||
| queryKey: ['gatheringDetail'], | ||
| queryFn: getGathering, | ||
| select: (data: GatheringDetailType) => transformKeysToCamel(data), | ||
| }; | ||
| } |
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
44 changes: 44 additions & 0 deletions
44
src/app/(crew)/my-gathering/_component/gathering-list-with-date.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 |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| 'use client'; | ||
|
|
||
| import { useMemo } from 'react'; | ||
| import { formatDate } from '@/src/utils/format-date'; | ||
| import ScheduledGatheringCard from '@/src/components/common/gathering-card/scheduled-gathering-card/container'; | ||
| import { GatheringCardProps } from '@/src/types/gathering-data'; | ||
|
|
||
| interface GatheringListWithDateProps { | ||
| gatheringList: GatheringCardProps[]; | ||
| } | ||
|
|
||
| export default function GatheringListWithDate({ gatheringList }: GatheringListWithDateProps) { | ||
| const gatheringListWithDateInfo = useMemo(() => { | ||
| return gatheringList.map((gathering, index) => { | ||
| const isNewDate = | ||
| index === 0 || | ||
| formatDate(gathering.dateTime).date !== formatDate(gatheringList[index - 1].dateTime).date; | ||
| return { ...gathering, isNewDate }; | ||
| }); | ||
| }, [gatheringList]); | ||
|
|
||
| return ( | ||
| <div className="m-4 md:mt-[32.5px]"> | ||
| {gatheringListWithDateInfo.map((gathering) => ( | ||
| <div key={gathering.id} className="md:flex"> | ||
| <div className="relative w-1/6 md:border-r-2 md:border-gray-200"> | ||
| {gathering.isNewDate && ( | ||
| <div> | ||
| <div className="md:corner-dot" /> | ||
| <div className="hidden flex-nowrap md:block"> | ||
| <div className="text-lg font-semibold">{formatDate(gathering.dateTime).date}</div> | ||
| <div className="text-base font-medium text-gray-500">μμμΌ</div> | ||
| </div> | ||
| </div> | ||
| )} | ||
| </div> | ||
| <div className={`${gathering.isNewDate ? 'pb-' : 'p-'} flex-1 pb-6 md:pl-8`}> | ||
| <ScheduledGatheringCard key={gathering.id} data={gathering} /> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| 'use client'; | ||
|
|
||
| import { useEffect, useState } from 'react'; | ||
| import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date'; | ||
| import PopOverCalendar from '@/src/components/common/input/pop-over-calendar'; | ||
| import { GatheringCardProps } from '@/src/types/gathering-data'; | ||
|
|
||
| export default function CreationPage() { | ||
| const [selectedDate, setSelectedDate] = useState(new Date()); | ||
|
|
||
| useEffect(() => {}, [selectedDate]); | ||
| const creationGatheringList: GatheringCardProps[] = [ | ||
| { | ||
| id: 1, | ||
| crewTitle: 'Power Pole', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-10-30T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| { | ||
| id: 2, | ||
| crewTitle: 'ν μ κ·Έλ μ΄μ€ μ€νλμ€', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-10-30T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| { | ||
| id: 3, | ||
| crewTitle: 'ν μ κ·Έλ μ΄μ€ μ€νλμ€', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-11-11T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| { | ||
| id: 4, | ||
| crewTitle: 'ν μ κ·Έλ μ΄μ€ μ€νλμ€', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-11-21T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <div className=""> | ||
| <div className="pl-4 md:pt-2"> | ||
| <PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} /> | ||
| </div> | ||
| <GatheringListWithDate gatheringList={creationGatheringList} /> | ||
| </div> | ||
| ); | ||
| } | ||
| function setState(arg0: Date) { | ||
| throw new Error('Function not implemented.'); | ||
| } |
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,10 @@ | ||
| import GatheringList from '@/src/components/gathering-list/gathering-list'; | ||
| import { gatheringData } from '@/src/mock/gathering-data'; | ||
|
|
||
| export default function FavoritePage() { | ||
| return ( | ||
| <div className="md:mt-[45px]"> | ||
| <GatheringList gatheringData={gatheringData} /> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| 'use client'; | ||
|
|
||
| import { useEffect, useState } from 'react'; | ||
| import Link from 'next/link'; | ||
| import { usePathname } from 'next/navigation'; | ||
| import { Button } from '@mantine/core'; | ||
|
|
||
| const buttonData = [ | ||
| { id: 1, label: 'μ°Έμ¬ν μ½μ', route: '/my-gathering/participation' }, | ||
| { id: 2, label: 'λ§λ μ½μ', route: '/my-gathering/creation' }, | ||
| { id: 3, label: 'μ°ν μ½μ', route: '/my-gathering/favorite' }, | ||
| ]; | ||
|
|
||
| const getSelectedButtonIndex = (currentPath: string) => { | ||
| return buttonData.findIndex(({ route }) => currentPath.endsWith(route.split('/').pop()!)) + 1; | ||
| }; | ||
|
|
||
| export default function MyGatheringLayout({ | ||
| children, | ||
| }: Readonly<{ | ||
| children: React.ReactNode; | ||
| }>) { | ||
| const currentPath = usePathname(); | ||
|
|
||
| const [selectedButton, setSelectedButton] = useState(getSelectedButtonIndex(currentPath)); | ||
|
|
||
| useEffect(() => { | ||
| const newIdx = getSelectedButtonIndex(currentPath); | ||
| setSelectedButton(newIdx); | ||
| }, [currentPath]); | ||
|
|
||
| return ( | ||
| <div className="mt-4 md:mx-[46px] md:mt-[45px]"> | ||
| <div className="m-4 grid grid-cols-3 gap-2 md:gap-4"> | ||
| {buttonData.map(({ id, label, route }) => ( | ||
| <Link key={id} href={route}> | ||
| <Button | ||
| className={`${id === selectedButton ? 'btn-filled' : 'btn-outlined'} w-full text-sm font-bold md:text-lg`} | ||
| > | ||
| {label} | ||
| </Button> | ||
| </Link> | ||
| ))} | ||
| </div> | ||
| {children} | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,6 @@ | ||
| 'use client'; | ||
|
|
||
| import { useState } from 'react'; | ||
| import CalendarFilter from '@/src/components/common/input/calendar-filter'; | ||
|
|
||
| const toDoDates = [new Date('2024-10-12'), new Date('2024-10-15')]; | ||
| import { redirect } from 'next/navigation'; | ||
|
|
||
| export default function MyGatheringPage() { | ||
| const [date, setDate] = useState<Date>(new Date()); | ||
|
|
||
| return ( | ||
| <div className="container mx-auto my-0 max-w-pc px-5 lg:px-0"> | ||
| <CalendarFilter value={date} toDoDates={toDoDates} onChange={setDate} /> | ||
| </div> | ||
| ); | ||
| redirect('/my-gathering/participation'); | ||
| return null; | ||
| } |
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,65 @@ | ||
| 'use client'; | ||
|
|
||
| import { useEffect, useState } from 'react'; | ||
| import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date'; | ||
| import PopOverCalendar from '@/src/components/common/input/pop-over-calendar'; | ||
| import { GatheringCardProps } from '@/src/types/gathering-data'; | ||
|
|
||
| export default function ParticipationPage() { | ||
| const [selectedDate, setSelectedDate] = useState(new Date()); | ||
|
|
||
| useEffect(() => {}, [selectedDate]); | ||
| const creationGatheringList: GatheringCardProps[] = [ | ||
| { | ||
| id: 1, | ||
| crewTitle: 'ν μ κ·Έλ μ΄μ€ μ€νλμ€', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-10-30T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| { | ||
| id: 2, | ||
| crewTitle: 'ν μ κ·Έλ μ΄μ€ μ€νλμ€', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-10-30T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| { | ||
| id: 3, | ||
| crewTitle: 'ν μ κ·Έλ μ΄μ€ μ€νλμ€', | ||
| crewMainLocation: 'μμΈμ', | ||
| crewSubLocation: 'κ°λ¨κ΅¬ μμΌλ', | ||
| title: 'κ°λλ€λΌλ§κ°λλ€λΌλ§κ°λλ€λΌλ§κ°', | ||
| dateTime: '2024-10-31T00:30', | ||
| currentCount: 8, | ||
| totalCount: 12, | ||
| imageUrl: | ||
| 'https://images.unsplash.com/photo-1601758260892-a62c486ace97?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', | ||
| isLiked: true, | ||
| }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <div className=""> | ||
| <div className="pl-4 md:pt-2"> | ||
| <PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} /> | ||
| </div> | ||
| <GatheringListWithDate gatheringList={creationGatheringList} /> | ||
| </div> | ||
| ); | ||
| } | ||
| function setState(arg0: Date) { | ||
| throw new Error('Function not implemented.'); | ||
| } |
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.
μ΄λ°μμΌλ‘λ νλκ΅°μ.... μμ κΉλ~~~ πππ