File tree Expand file tree Collapse file tree 13 files changed +104
-13
lines changed Expand file tree Collapse file tree 13 files changed +104
-13
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Deploy
33on :
44 workflow_dispatch :
55 branches :
6- - ' dev'
6+ - ' dev'
77
88jobs :
99 ci :
1515 NEXT_PUBLIC_GA_ID : ${{ secrets.GA_ID }}
1616 NEXT_PUBLIC_HJID : ${{ secrets.HOTJAR_HJID }}
1717 NEXT_PUBLIC_HJSV : ${{ secrets.HOTJAR_HJSV }}
18+ NEXT_PUBLIC_FIREBASE_API_KEY : ${{ secrets.FIREBASE_API_KEY }}
19+ NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN : ${{ secrets.FIREBASE_AUTH_DOMAIN }}
20+ NEXT_PUBLIC_FIREBASE_PROJECT_ID : ${{ secrets.FIREBASE_PROJECT_ID }}
21+ NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET : ${{ secrets.FIREBASE_STORAGE_BUCKET }}
22+ NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID : ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
23+ NEXT_PUBLIC_FIREBASE_APP_ID : ${{ secrets.FIREBASE_MESSAGING_APP_ID }}
24+ NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID : ${{ secrets.FIREBASE_MESSAGING_MEASUREMENT_ID }}
1825
1926 strategy :
2027 matrix :
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { CategoryBottomSheet } from './toks-main/components/CategoryBottomSheet'
99export default function Template ( { children } : StrictPropsWithChildren ) {
1010 // TODO: useAuth hook 구현
1111 // TODO: useLogin Modal hook 구현
12+ // TODO: GlobalPortal 제거
1213 const pathName = usePathname ( ) ;
1314
1415 return (
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { useQuizListInfinityQuery } from '@/queries/useQuizListInfinityQuery';
99
1010import { QuizNotice } from './QuizNotice' ;
1111import { SkeletonCardList } from './SkeletonCard' ;
12- import { CARD_LIST_QUERY_DEFAULT } from '../constants' ;
12+ import { CARD_LIST_QUERY_DEFAULT } from '../constants/constants ' ;
1313
1414export const CardList = ( ) => {
1515 const router = useRouter ( ) ;
Original file line number Diff line number Diff line change 1+ export const SkeletonSlider = ( ) => {
2+ return (
3+ < div className = "aspect-w-3 aspect-h-1 z-0 h-130px w-full animate-pulse rounded-12px bg-gray-110" > </ div >
4+ ) ;
5+ } ;
Original file line number Diff line number Diff line change 1+ import { useQuery } from '@tanstack/react-query' ;
2+
3+ import { NoticeSlider } from '@/common' ;
4+
5+ import { SkeletonSlider } from './SkeletonSlider' ;
6+ import { QUERY_KEYS } from '../../constants/queryKeys' ;
7+ import { getNotices } from '../../remotes/notice' ;
8+
9+ export const MainPageSlider = ( ) => {
10+ const {
11+ data : notices ,
12+ isLoading,
13+ isSuccess,
14+ } = useQuery ( {
15+ queryKey : [ QUERY_KEYS . GET_NOTICES ] ,
16+ queryFn : async ( ) => {
17+ try {
18+ return await getNotices ( ) ;
19+ } catch ( err ) {
20+ throw new Error ( '배너를 가져오는데 실패했습니다.' ) ;
21+ }
22+ } ,
23+ } ) ;
24+
25+ if ( isLoading ) {
26+ return < SkeletonSlider /> ;
27+ }
28+
29+ if ( isSuccess ) {
30+ const imageInfo = notices . bottomBanners . map ( ( el ) => {
31+ return { imageUrl : el . imageUrl , landingUrl : el . landingUrl } ;
32+ } ) ;
33+ return < NoticeSlider images = { imageInfo } /> ;
34+ }
35+
36+ return null ;
37+ } ;
File renamed without changes.
Original file line number Diff line number Diff line change 1+ export const QUERY_KEYS = {
2+ GET_NOTICES : ( ) => [ 'GET_NOTICE' ] ,
3+ } as const ;
Original file line number Diff line number Diff line change 1+ interface NoticeInfo {
2+ id : number ;
3+ title : string ;
4+ seq : number ;
5+ imageUrl : string ;
6+ landingUrl : string ;
7+ isActive : boolean ;
8+ }
9+
10+ export interface NoticeResponse {
11+ bottomBanners : NoticeInfo [ ] ;
12+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { isVisibleFloatingButtonBottomSheetAtom } from '@/store';
88
99import { CardList } from './components/CardList' ;
1010import { MainPageBottomSheet } from './components/MainPageBottomSheet' ;
11+ import { MainPageSlider } from './components/MainPageSlider' ;
1112
1213function ToksMainPage ( ) {
1314 const { getSavedToastInfo, clearSavedToast } = useToast ( ) ;
@@ -32,6 +33,8 @@ function ToksMainPage() {
3233 title = { toastData . title }
3334 />
3435 ) }
36+ < MainPageSlider />
37+ < div className = "h-24px" />
3538 < CardList />
3639
3740 < FloatingButton
Original file line number Diff line number Diff line change 1+ import { http } from '@/common' ;
2+
3+ import { NoticeResponse } from '../models/notice' ;
4+
5+ export const getNotices = async ( ) => {
6+ return await http . get < NoticeResponse > ( 'api/v1/bottom-banners' ) ;
7+ } ;
You can’t perform that action at this time.
0 commit comments