Skip to content

Commit 8c575f4

Browse files
Merge pull request #41 from ds-TopHat/feat/#40/auth
[Feat/#40] 가입, 리이슈, 토큰 로직 변경
2 parents 98d33ed + f9e9a93 commit 8c575f4

35 files changed

Lines changed: 396 additions & 49 deletions

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"framer-motion": "^12.15.0",
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
23+
"react-error-boundary": "^6.0.0",
2324
"react-router-dom": "^7.6.1"
2425
},
2526
"devDependencies": {

‎pnpm-lock.yaml‎

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎public/svg/ic_error.svg‎

Lines changed: 9 additions & 0 deletions
Loading

‎src/App.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ import { QueryClientProvider } from '@tanstack/react-query';
22
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
33
import { RouterProvider } from 'react-router-dom';
44
import { router } from '@routes/router';
5+
import '@styles/index.css';
56
import ThemeProvider from '@styles/themeProvider';
7+
import { GlobalErrorBoundary } from '@routes/globalErrorBoundary';
68

7-
import { queryClient } from '@/queryClient';
8-
import '@styles/index.css';
9+
import queryClient from './queryClient';
910

1011
const App = () => {
1112
return (
1213
<QueryClientProvider client={queryClient}>
1314
<ThemeProvider>
14-
<RouterProvider router={router} />
15-
{import.meta.env.DEV && <ReactQueryDevtools initialIsOpen={false} />}
15+
<GlobalErrorBoundary>
16+
<RouterProvider router={router} />
17+
{import.meta.env.DEV && <ReactQueryDevtools initialIsOpen={false} />}
18+
</GlobalErrorBoundary>
1619
</ThemeProvider>
1720
</QueryClientProvider>
1821
);

‎src/pages/error/Error.tsx‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { IcError } from '@components/icons';
2+
import Button from '@components/button/Button';
3+
import { useNavigate } from 'react-router-dom';
4+
import { routePath } from '@routes/routePath';
5+
6+
import * as styles from './error.css';
7+
8+
const Error = () => {
9+
const navigate = useNavigate();
10+
const goHome = () => {
11+
navigate(routePath.HOME);
12+
};
13+
14+
return (
15+
<main className={styles.container}>
16+
<IcError width={120} height={120} />
17+
<h1 className={styles.title}>서비스 이용에 불편을 드려 죄송합니다. </h1>
18+
<p className={styles.description}>
19+
요청하신 페이지를 처리하는 도중 예기치 못한 에러가 발생했어요. <br />
20+
다시 한번 시도하거나 홈으로 이동해 주세요.
21+
</p>
22+
<div className={styles.buttonWrapper} onClick={goHome}>
23+
<Button isActive>홈으로 이동</Button>
24+
</div>
25+
</main>
26+
);
27+
};
28+
29+
export default Error;

‎src/pages/error/error.css.ts‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { themeVars } from '@styles/theme.css';
2+
import { style } from '@vanilla-extract/css';
3+
4+
export const container = style({
5+
display: 'flex',
6+
flexDirection: 'column',
7+
alignItems: 'center',
8+
paddingTop: '14rem',
9+
height: '100dvh',
10+
background: 'linear-gradient(0deg, #E7F0FF 0%, #FFF 100%)',
11+
});
12+
13+
export const title = style({
14+
margin: '4rem 0 2rem',
15+
color: themeVars.color.point,
16+
...themeVars.font.bodyMedium,
17+
});
18+
19+
export const description = style({
20+
textAlign: 'center',
21+
color: themeVars.color.gray500,
22+
...themeVars.font.labelSmall,
23+
});
24+
25+
export const buttonWrapper = style({
26+
position: 'fixed',
27+
bottom: 0,
28+
width: '100%',
29+
padding: '2.4rem 2rem',
30+
});

‎src/pages/loading/Loading.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as styles from './loading.css';
2+
3+
const Loading = () => {
4+
return (
5+
<main className={styles.container}>
6+
<div className={styles.dots}>
7+
<span className={styles.dot} />
8+
<span className={styles.dot} />
9+
<span className={styles.dot} />
10+
</div>
11+
</main>
12+
);
13+
};
14+
15+
export default Loading;

‎src/pages/loading/loading.css.ts‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { style, keyframes } from '@vanilla-extract/css';
2+
import { themeVars } from '@styles/theme.css';
3+
4+
// 위아래로 점프하는 애니메이션
5+
const bounce = keyframes({
6+
'0%, 80%, 100%': { transform: 'translateY(0)' },
7+
'40%': { transform: 'translateY(-12px)' },
8+
});
9+
10+
export const container = style({
11+
display: 'flex',
12+
justifyContent: 'center',
13+
alignItems: 'center',
14+
height: '100dvh',
15+
background: 'linear-gradient(0deg, #E7F0FF 0%, #FFF 100%)',
16+
});
17+
18+
export const dots = style({
19+
display: 'flex',
20+
gap: '0.8rem',
21+
});
22+
23+
export const dot = style({
24+
width: '1rem',
25+
height: '1rem',
26+
borderRadius: '50%',
27+
backgroundColor: themeVars.color.point,
28+
animation: `${bounce} 1.4s infinite ease-in-out both`,
29+
selectors: {
30+
'&:nth-child(1)': { animationDelay: '0s' },
31+
'&:nth-child(2)': { animationDelay: '0.2s' },
32+
'&:nth-child(3)': { animationDelay: '0.4s' },
33+
},
34+
});

‎src/pages/login/apis/queries.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const usePostLogin = () => {
1414
onSuccess: (data) => {
1515
if (data.token) {
1616
tokenService.saveAccessToken(data.token);
17+
tokenService.saveRefreshToken(data.refreshToken);
1718
}
1819
},
1920
onError: (error: AxiosError) => {

‎src/pages/login/login.css.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export const formWrapper = style({
66
flexDirection: 'column',
77
gap: '0.4rem',
88
width: '100%',
9+
maxWidth: '48rem',
10+
911
padding: '0 3.6rem',
1012
});
1113

@@ -30,6 +32,8 @@ export const buttonWrapper = style({
3032
position: 'fixed',
3133
flexDirection: 'column',
3234
width: '100%',
35+
maxWidth: '48rem',
36+
3337
padding: '0 3.6rem 5rem',
3438
gap: '1.2rem',
3539
alignItems: 'center',

0 commit comments

Comments
 (0)