-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
73 additions
and
50 deletions.
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
3 changes: 3 additions & 0 deletions
3
src/app/toks-main/components/MainPageSlider/SkeletonSlider.tsx
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,3 @@ | ||
export const SkeletonSlider = () => { | ||
return <div></div>; | ||
}; |
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,26 @@ | ||
'use client'; | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
|
||
import { NoticeSlider } from '@/common'; | ||
|
||
import { QUERY_KEYS } from '../../constants/queryKeys'; | ||
import { getNotices } from '../../remotes/notice'; | ||
|
||
export const MainPageSlider = () => { | ||
const { data: notices } = useSuspenseQuery({ | ||
queryKey: [QUERY_KEYS.GET_NOTICES], | ||
queryFn: async () => { | ||
try { | ||
return await getNotices(); | ||
} catch (err) { | ||
throw new Error('배너를 가져오는데 실패했습니다.'); | ||
} | ||
}, | ||
}); | ||
|
||
const imageInfo = notices.bottomBanners.map((el) => { | ||
return { imageUrl: el.imageUrl, landingUrl: el.landingUrl }; | ||
}); | ||
|
||
return <NoticeSlider images={imageInfo} />; | ||
}; |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
export const CARD_LIST_QUERY_DEFAULT = { | ||
pageParams: [], | ||
pages: [], | ||
}; |
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,3 @@ | ||
export const QUERY_KEYS = { | ||
GET_NOTICES: () => ['GET_NOTICE'], | ||
} as const; |
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,12 @@ | ||
interface NoticeInfo { | ||
id: number; | ||
title: string; | ||
seq: number; | ||
imageUrl: string; | ||
landingUrl: string; | ||
isActive: boolean; | ||
} | ||
|
||
export interface NoticeResponse { | ||
bottomBanners: NoticeInfo[]; | ||
} |
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
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,7 @@ | ||
import { http } from '@/common'; | ||
|
||
import { NoticeResponse } from '../models/notice'; | ||
|
||
export const getNotices = async () => { | ||
return await http.get<NoticeResponse>('api/v1/bottom-banners'); | ||
}; |
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,13 +1,9 @@ | ||
import { http } from '@/common'; | ||
|
||
import { NoticeResponse, ProgressResponse } from '../models/progress'; | ||
import { ProgressResponse } from '../models/progress'; | ||
|
||
export const getProgress = async (month: number, year: number) => { | ||
return await http.get<ProgressResponse>( | ||
`api/v1/fab/user?year=${year}&month=${month}` | ||
); | ||
}; | ||
|
||
export const getNotices = async () => { | ||
return await http.get<NoticeResponse>('api/v1/bottom-banners'); | ||
}; |
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