diff --git a/app/(route)/alarm/page.tsx b/app/(route)/alarm/page.tsx index e9e96ca..d553f23 100644 --- a/app/(route)/alarm/page.tsx +++ b/app/(route)/alarm/page.tsx @@ -1,20 +1,24 @@ +import { UserContextProvider } from '@/app/_components/providers/UserProvider' + import BackButton from './_components/BackButton' import RequestAlarm from './_components/requestAlarm' export default function AlarmPage() { return ( -
-
- -

알림

-
-
+ +
+
+ +

알림

+
+
-
- - - -
-
+
+ + + +
+
+ ) } diff --git a/app/(route)/challenge/_components/ChallengeFormDialog.tsx b/app/(route)/challenge/_components/ChallengeFormDialog.tsx index f0a64ca..45a7b2e 100644 --- a/app/(route)/challenge/_components/ChallengeFormDialog.tsx +++ b/app/(route)/challenge/_components/ChallengeFormDialog.tsx @@ -65,12 +65,11 @@ export default function ChallengeFormDialog() { }, { onSuccess: ({ data: { challengeId } }) => { - console.log('challengeId', challengeId) share.kakao({ title: `${user.nickname}님이 초대장을 보냈어요!`, description: '1:1 목표 매칭 서비스', imageUrl: 'https://dodals3.s3.ap-northeast-2.amazonaws.com/asset/dodaldodal_square.png', - link: `https://dodaldodal-frontend-vercel.app/challenge/${challengeId}`, + sendUrl: `https://dodaldodal-frontend-vercel.app/challenge/${challengeId}`, }) }, } diff --git a/app/(route)/challenge/_utils/index.ts b/app/(route)/challenge/_utils/index.ts index 8895c34..4d52bb0 100644 --- a/app/(route)/challenge/_utils/index.ts +++ b/app/(route)/challenge/_utils/index.ts @@ -3,12 +3,12 @@ export const share = { title, description, imageUrl, - link, + sendUrl, }: { title: string description: string imageUrl: string - link: string + sendUrl: string }) => { const { Kakao } = window if (!Kakao.isInitialized()) { @@ -22,16 +22,16 @@ export const share = { description, imageUrl, link: { - mobileWebUrl: link, - webUrl: link, + mobileWebUrl: sendUrl, + webUrl: sendUrl, }, }, buttons: [ { title: '웹으로 보기', link: { - mobileWebUrl: link, - webUrl: link, + mobileWebUrl: sendUrl, + webUrl: sendUrl, }, }, ], diff --git a/app/(route)/challenge/layout.tsx b/app/(route)/challenge/layout.tsx index db511d7..287f8fa 100644 --- a/app/(route)/challenge/layout.tsx +++ b/app/(route)/challenge/layout.tsx @@ -3,6 +3,7 @@ import { useRouter } from 'next/navigation' import Script from 'next/script' +import { UserContextProvider } from '@/app/_components/providers/UserProvider' import BottomNavigation from '@/app/_components/shared/bottom-navigation' import Header from '@/app/_components/shared/header' @@ -10,23 +11,25 @@ export default function Layout({ children }: { children: React.ReactNode }) { const router = useRouter() return ( -
-
- { - router.back() - }} - /> - 챌린지 -
-
- {children} - - -
+ +
+
+ { + router.back() + }} + /> + 챌린지 +
+
+ {children} + + +
+
) } diff --git a/app/(route)/invitation/[id]/layout.tsx b/app/(route)/invitation/[id]/layout.tsx index 80a0cfb..a63753d 100644 --- a/app/(route)/invitation/[id]/layout.tsx +++ b/app/(route)/invitation/[id]/layout.tsx @@ -1,20 +1,23 @@ 'use client' +import { UserContextProvider } from '@/app/_components/providers/UserProvider' import Header from '@/app/_components/shared/header' export default function layout({ children }: { children: React.ReactNode }) { return ( -
-
-
- 초대장 도착 - { - window.close() - }} - /> -
- {children} -
+ +
+
+
+ 초대장 도착 + { + window.close() + }} + /> +
+ {children} +
+
) } diff --git a/app/(route)/me/layout.tsx b/app/(route)/me/layout.tsx index 59a1c65..7b632b9 100644 --- a/app/(route)/me/layout.tsx +++ b/app/(route)/me/layout.tsx @@ -1,16 +1,19 @@ +import { UserContextProvider } from '@/app/_components/providers/UserProvider' import BottomNavigation from '@/app/_components/shared/bottom-navigation' import Header from '@/app/_components/shared/header' export default function Layout({ children }: { children: React.ReactNode }) { return ( -
-
-
- MY -
-
- {children} - -
+ +
+
+
+ MY +
+
+ {children} + +
+
) } diff --git a/app/_components/providers/CoreProvider.tsx b/app/_components/providers/CoreProvider.tsx index fcbdcc8..d18e1a8 100644 --- a/app/_components/providers/CoreProvider.tsx +++ b/app/_components/providers/CoreProvider.tsx @@ -4,16 +4,13 @@ import { useAxiosInterceptor } from '@/app/_hooks/useAxiosInterceptor' import AxiosProvider from './AxiosInterceptorProvider' import QueryClientProvider from './QueryClientProvider' -import { UserContextProvider } from './UserProvider' export default function CoreProvider({ children }: { children: React.ReactNode }) { useAxiosInterceptor() return ( - - {children} - + {children} ) } diff --git a/app/_service/challenge/challenge.types.ts b/app/_service/challenge/challenge.types.ts index 792d2c9..522f9e4 100644 --- a/app/_service/challenge/challenge.types.ts +++ b/app/_service/challenge/challenge.types.ts @@ -18,3 +18,31 @@ export interface CreateChallengeParams { export interface CreateChallengeResponse { challengeId: number } + +export interface GetUpcomingChallengeParams { + challengeId: number +} + +export interface Challenge { + id: number + name: string + category: Category + authentication_method: string + reward: string + is_deleted: 0 + created_at: '2023-12-16T13:59:18.000Z' + updated_at: '2023-12-16T13:59:18.000Z' + target_count: 10 + challenge_status: 'WAITING' +} + +export interface GetUpcomingChallengeResponse { + challengeId: number + name: string + category: Category + authenticationMethod: string + reward: string + champion: Champion + explorationCount: number + certificatedCount: number +} diff --git a/app/_service/challenge/index.ts b/app/_service/challenge/index.ts index dc1bfe5..0448a19 100644 --- a/app/_service/challenge/index.ts +++ b/app/_service/challenge/index.ts @@ -1,6 +1,12 @@ import api from '../core/api' -import { type CreateChallengeResponse, type CreateChallengeParams, type GetTodayStatus } from './challenge.types' +import { + type CreateChallengeResponse, + type CreateChallengeParams, + type GetTodayStatus, + type GetUpcomingChallengeParams, + type GetUpcomingChallengeResponse, +} from './challenge.types' export const getTodayStatus = () => { return api.get('/challenges/today') @@ -14,3 +20,7 @@ export const createChallenge = ({ name, category, authenticationMethod, reward } reward, }) } + +export const getUpcomingChallenge = ({ challengeId }: GetUpcomingChallengeParams) => { + return api.get(`/challenges/upcoming/${challengeId}`) +}