Skip to content

Commit c69e2c3

Browse files
Merge branch 'develop' of https://github.com/SOPT-36-NINEDOT/NINEDOT-CLIENT into feat/#206/404
2 parents ae2893a + e307c4c commit c69e2c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+364
-188
lines changed

src/App.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1+
import { Suspense } from 'react';
12
import { RouterProvider } from 'react-router-dom';
23

34
import { router } from '@/route';
5+
import Loading from '@/common/component/Loading/Loading';
46

57
function App() {
6-
return <RouterProvider router={router} />;
8+
return (
9+
<Suspense
10+
fallback={
11+
<Loading
12+
type="goal"
13+
// type="default"
14+
/>
15+
}
16+
>
17+
<RouterProvider router={router} />
18+
</Suspense>
19+
);
720
}
821

922
export default App;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useMutation } from '@tanstack/react-query';
22

33
import { postSignUp } from '@/api/domain/signup';
4-
import type { SignupResponse } from '@/api/domain/signup/type/SignupResponse';
4+
import type { SignupRequest } from '@/api/domain/signup/type/SignupRequest';
55

66
export const usePostSignUp = () => {
77
return useMutation({
8-
mutationFn: (payload: SignupResponse) => postSignUp(payload),
8+
mutationFn: (payload: SignupRequest) => postSignUp(payload),
99
});
1010
};

src/api/domain/signup/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import axiosInstance from '@/api/axiosInstance';
22
import { END_POINT } from '@/api/constant/endPoint';
33
import type { JobResponse } from '@/api/domain/signup/type/JobResponse';
44
import type { PersonaResponse } from '@/api/domain/signup/type/PersonaResponse';
5-
import type { SignupResponse } from '@/api/domain/signup/type/SignupResponse';
5+
import type { SignupRequest } from '@/api/domain/signup/type/SignupRequest';
66
import type { UserType } from '@/store/types/authTypes';
77
import type { BaseResponse } from '@/type/api';
88

@@ -15,7 +15,7 @@ export const getPersona = async () => {
1515
const { data } = await axiosInstance.get<BaseResponse<PersonaResponse>>(`/${END_POINT.PERSONA}`);
1616
return data.data;
1717
};
18-
export const postSignUp = async (payload: SignupResponse) => {
18+
export const postSignUp = async (payload: SignupRequest) => {
1919
const { data } = await axiosInstance.post('/auth/signup', payload);
2020
return data.data;
2121
};

src/api/domain/signup/type/SignupResponse.ts renamed to src/api/domain/signup/type/SignupRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface SignupResponse {
1+
export interface SignupRequest {
22
socialProvider: string;
33
socialToken: string;
44
name: string;

src/common/component/Loading/Loading.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import loadingAnimation from '@/assets/lottie/loading.json';
44
import * as styles from '@/common/component/Loading/Loading.css';
55

66
type LoadingProps = {
7-
type: 'goal' | 'todo' | 'history' | 'entireTodo';
7+
type: 'default' | 'goal' | 'todo' | 'history' | 'entireTodo';
88
};
99

1010
const Loading = ({ type }: LoadingProps) => {
1111
let message = '';
1212

1313
switch (type) {
14+
case 'default':
15+
message = '데이터를 불러오는 중이에요';
16+
break;
1417
case 'goal':
1518
message = 'AI가 목표를 추천해주고 있어요';
1619
break;

src/common/component/TextField/signup/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function formatBirthDate(value: string): string {
44
return digits;
55
}
66
if (digits.length < 7) {
7-
return `${digits.slice(0, 4)}-${digits.slice(4)}`;
7+
return `${digits.slice(0, 4)}.${digits.slice(4)}`;
88
}
9-
return `${digits.slice(0, 4)}-${digits.slice(4, 6)}-${digits.slice(6)}`;
9+
return `${digits.slice(0, 4)}.${digits.slice(4, 6)}.${digits.slice(6)}`;
1010
}

src/common/component/TextField/signup/validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ERROR_MESSAGES } from './constants';
22

33
export const NAME_REGEX = /^[A-Za-z---\s]{1,10}$/;
44
export const JOB_REGEX = /^[A-Za-z---\s]{1,15}$/;
5-
export const BIRTH_REGEX = /^\d{4}-\d{2}-\d{2}$/;
5+
export const BIRTH_REGEX = /^\d{4}.\d{2}.\d{2}$/;
66

77
export function validateName(value: string): string | undefined {
88
const v = (value ?? '').trim();
@@ -24,7 +24,7 @@ export function validateBirth(value: string): string | undefined {
2424
return ERROR_MESSAGES.birth;
2525
}
2626

27-
const [yy, mm, dd] = v.split('-');
27+
const [yy, mm, dd] = v.split('.');
2828
const yearNum = parseInt(yy, 10);
2929
const monthNum = parseInt(mm, 10);
3030
const dayNum = parseInt(dd, 10);

src/common/hook/useGoogleAuth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const useGoogleAuth = (): UserData | null => {
2222

2323
try {
2424
const data = await getAccessToken(code);
25-
localStorage.setItem('accessToken', data.accessToken);
25+
if (data.accessToken) {
26+
localStorage.setItem('accessToken', data.accessToken);
27+
}
2628
setUserData(data);
2729
} catch (error) {
2830
console.error('로그인 실패:', error);

src/page/history/History.css.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const titleContainer = style({
2424
});
2525

2626
export const descriptionContainer = style({
27-
marginTop: '2rem',
28-
padding: '7.6rem 5rem',
27+
marginTop: '2.3rem',
28+
padding: '6.7rem 8.6rem',
2929
backgroundColor: colors.grey2,
3030
borderRadius: '12px',
3131
color: colors.grey11,
@@ -37,7 +37,7 @@ export const descriptionContainer = style({
3737
});
3838

3939
export const streakTrackerWrapper = style({
40-
paddingTop: '8rem',
40+
paddingTop: '7.7rem',
4141
paddingBottom: '9.8rem',
4242
});
4343

src/page/history/History.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import StreakTracker from '@/page/history/StreakTrackerSection/StreakTrackerSect
55
import { useGetHistory } from '@/api/domain/history/hook/useGetHistory';
66
import { useMandalartId } from '@/common/hook/useMandalartId';
77
import Loading from '@/common/component/Loading/Loading';
8+
import { useAuthStore } from '@/store/useAuthStore';
89

910
const STREAK_BANNER_MESSAGE = '작은 실천을 66일 이어가면 나의 목표에 도달합니다';
1011
const STREAK_DESCRIPTION_MESSAGE = '하루에 하나라도 실천하면 오늘의 점이 찍혀요!';
@@ -14,6 +15,7 @@ const History = () => {
1415
const mandalartId = useMandalartId();
1516

1617
const { data, isLoading } = useGetHistory(mandalartId);
18+
const user = useAuthStore((state) => state.user);
1719

1820
const handleOutsideClick = () => {
1921
setSelectedDay(null);
@@ -28,7 +30,7 @@ const History = () => {
2830
<div className={styles.layoutContainer}>
2931
<h1 className={styles.titleContainer}>{data.title}</h1>
3032
<p className={styles.descriptionContainer}>
31-
김도트님, 목표를 향해 <br />
33+
{user.name}, 목표를 향해 <br />
3234
<strong className={styles.progressText}>{data.progressDays}</strong>일째 달려가고 있어요
3335
</p>
3436
<section className={styles.streakTrackerWrapper}>

0 commit comments

Comments
 (0)