-
+
+ {/* 첫 번째 스켈레톤 */}
+
+
+
+
+ {/* Title Skeleton */}
+
+ {/* Description Skeleton */}
+
+
+
-
- {/* Number and Title Skeleton */}
-
- {/* Description Skeleton */}
-
+
+ {/* 두 번째 스켈레톤 */}
+
+
+
+
+ {/* Title Skeleton */}
+
+ {/* Description Skeleton */}
+
+
+
- {/* Image Skeleton */}
-
);
};
diff --git a/src/factory/ReportLists.ts b/src/factory/ReportLists.ts
index 162d668..5b27aa5 100644
--- a/src/factory/ReportLists.ts
+++ b/src/factory/ReportLists.ts
@@ -2,14 +2,14 @@ import { useInfiniteQuery } from '@tanstack/react-query';
import axios from 'axios';
const fetchStudyGuides = async ({ pageParam = 1 }) => {
- const { data } = await axios.get(`https://api.moaguide.com/study/guide?page=${pageParam}&size=3`);
+ const { data } = await axios.get(`https://api.moaguide.com/study/guide?page=${pageParam}&size=10`);
return {
- content: data.roadmaps,
+ content: data.roadmap,
nextPage: pageParam + 1,
totalPages: data.total,
- totalElements: data.roadmaps.length,
+ totalElements: data.roadmap.length,
currentPage: data.page,
- isLast: data.page + 1 >= data.total
+ isLast: data.page + 1 >= data.total,
};
};
@@ -19,7 +19,7 @@ export const getStudyGuides = (category: string, subCategory: string, sort: stri
const { data, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage, isLoading } =
useInfiniteQuery({
queryKey,
- queryFn: fetchStudyGuides,
+ queryFn: fetchStudyGuides,
getNextPageParam: (lastPage) => {
return lastPage.isLast ? undefined : lastPage.nextPage;
},
@@ -28,12 +28,12 @@ export const getStudyGuides = (category: string, subCategory: string, sort: stri
});
return {
- data: data?.pages.flatMap((page) => page.content) || [],
+ data: data?.pages.flatMap((page) => page.content) || [],
fetchNextPage,
hasNextPage,
isFetching,
isFetchingNextPage,
- isLoading
+ isLoading,
};
};
diff --git a/src/service/auth.ts b/src/service/auth.ts
index 10c9f57..b13acf8 100644
--- a/src/service/auth.ts
+++ b/src/service/auth.ts
@@ -92,9 +92,11 @@ export const login = async (email: string, password: string) => {
memberEmail: userInfo.email,
memberNickName: userInfo.nickname,
memberPhone: userInfo.phonenumber,
- subscribe: '1개월 플랜',
+ loginType: userInfo.loginType,
});
+ console.log(userInfo);
+
return response.data;
} catch (error) {
console.error('로그인 오류:', error);
diff --git a/src/store/user.store.ts b/src/store/user.store.ts
index 8b0c461..e441801 100644
--- a/src/store/user.store.ts
+++ b/src/store/user.store.ts
@@ -7,7 +7,7 @@ interface IUserInfo {
memberEmail: string;
memberNickName: string;
memberPhone: string;
- subscribe: string;
+ loginType: string;
}
interface IMember {
@@ -23,7 +23,7 @@ export const useMemberStore = create(
memberEmail: '',
memberNickName: '',
memberPhone: '',
- subscribe: ''
+ loginType: '',
},
setMember: (userInfo: IUserInfo) => set({ member: userInfo }),
clearMember: () => set({
@@ -31,7 +31,7 @@ export const useMemberStore = create(
memberEmail: '',
memberNickName: '',
memberPhone: '',
- subscribe: ''
+ loginType: '',
}
}),
}),
@@ -39,4 +39,4 @@ export const useMemberStore = create(
name: 'userInfo'
}
)
-);
+);
\ No newline at end of file
diff --git a/src/types/homeComponentsType.ts b/src/types/homeComponentsType.ts
index b97251b..51e17b9 100644
--- a/src/types/homeComponentsType.ts
+++ b/src/types/homeComponentsType.ts
@@ -66,9 +66,8 @@ export interface SearchedItem {
export interface StudyGuidesItem {
id: number;
- difficulty: string;
title: string;
- description: string;
+ link: string;
}
export interface SubLoadmap {
@@ -89,23 +88,16 @@ export interface CategorySubloadmapSkeletonItemProps {
isBottom: boolean;
}
-export interface SubLoadmapBottomArticle {
+export interface InvestmentGuideProps {
id: number;
title: string;
description: string;
imageLink: string;
date: string;
- content: string;
- pdfLink: string;
+ link: string;
}
-export interface SubLoadmapBottomArticleItemsProps {
- data: SubLoadmapBottomArticle;
- isTop: boolean;
- isBottom: boolean;
-}
-
export interface ArticleItem {
id: number;
title: string;
diff --git a/src/utils/checkEmail.ts b/src/utils/checkEmail.ts
index 7e07b51..23b3a85 100644
--- a/src/utils/checkEmail.ts
+++ b/src/utils/checkEmail.ts
@@ -1,33 +1,30 @@
-/*
-유저의 이메일을 받아와서 도메인에 맞는 주소를 출력하는 함수입니다
-e.g. input) test@gmail.com -> output) 구글
-*/
-export const checkEmail = (email: string): string | null => {
- const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
-
- if (!emailPattern.test(email)) {
- return null;
- }
-
- const domainPattern = /@([^@.]+)\./;
- const match = email.match(domainPattern);
-
- if (match && match[1] === 'naver') {
- return '네이버';
- } else if (match && match[1] === 'kakao') {
- return '카카오';
- } else if (match && match[1] === 'gmail') {
- return '구글';
- } else if (match && match[1] === 'nate') {
- return '네이트';
- } else if (match && match[1] === 'daum') {
- return '다음';
- } else if (match && match[1] === 'hanmail') {
- return '다음';
- } else if (match && match[1]) {
- return match[1];
- } else {
- return null;
+export const getSocialInfo = (loginType: string, email: string) => {
+ switch (loginType) {
+ case 'kakao':
+ return {
+ platform: '카카오',
+ imgSrc: '/images/mypage/kakaoSocial.svg',
+ };
+ case 'google':
+ return {
+ platform: '구글',
+ imgSrc: '/images/mypage/googleSocial.svg',
+ };
+ case 'naver':
+ return {
+ platform: '네이버',
+ imgSrc: '/images/mypage/naverSocial.svg',
+ };
+ case 'local':
+ return {
+ platform: '일반',
+ imgSrc: null,
+ };
+ default:
+ return {
+ platform: '알 수 없음',
+ imgSrc: null,
+ };
}
-};
+};
\ No newline at end of file