Skip to content

Commit 1975c4b

Browse files
authored
Merge pull request #49 from MaxedOut-Muneo/48-refactor/admin-refactor
[Refactor] - admin 배포 설정 및 리팩토링
2 parents 2661605 + 04aceb5 commit 1975c4b

21 files changed

Lines changed: 104 additions & 26 deletions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Button, TriangleWarningIcon } from '@muneo/design-system';
2+
import { useEffect } from 'react';
3+
import { Link, useRouteError } from 'react-router';
4+
import { ROUTES } from '@/constants/routes';
5+
6+
export const GlobalError = () => {
7+
const error = useRouteError();
8+
9+
useEffect(() => {
10+
console.error(error);
11+
}, [error]);
12+
13+
return (
14+
<div
15+
style={{
16+
minHeight: '100vh',
17+
display: 'flex',
18+
flexDirection: 'column',
19+
alignItems: 'center',
20+
justifyContent: 'center',
21+
gap: '16px',
22+
textAlign: 'center',
23+
padding: '24px',
24+
}}
25+
>
26+
<TriangleWarningIcon width={48} height={48} style={{ color: '#EF4444' }} />
27+
<h2 style={{ fontSize: '20px', fontWeight: 600, margin: 0 }}>오류가 발생했습니다</h2>
28+
<p style={{ fontSize: '14px', color: '#64748B', margin: 0 }}>일시적인 문제가 발생했습니다. 다시 시도해주세요.</p>
29+
<div style={{ display: 'flex', gap: '8px' }}>
30+
<Button variant="primary" onClick={() => window.location.reload()}>
31+
다시 시도
32+
</Button>
33+
<Button as={Link} variant="outlineSecondaryStrong" to={ROUTES.users}>
34+
홈으로
35+
</Button>
36+
</div>
37+
</div>
38+
);
39+
};
File renamed without changes.

apps/admin/src/pages/LoginPage/LoginPage.tsx renamed to apps/admin/src/pages/Login/Login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LoginForm } from './components/LoginForm';
2-
import * as styles from './LoginPage.css';
2+
import * as styles from './Login.css';
33

4-
export const LoginPage = () => (
4+
export const Login = () => (
55
<div className={styles.wrapper}>
66
<div className={styles.card}>
77
<div>

apps/admin/src/pages/LoginPage/components/LoginForm.tsx renamed to apps/admin/src/pages/Login/components/LoginForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button, TextField } from '@muneo/design-system';
22
import { useLoginForm } from '../hooks/useLoginForm';
3-
import * as styles from '../LoginPage.css';
3+
import * as styles from '../Login.css';
44

55
export const LoginForm = () => {
66
const { email, password, setEmail, setPassword, fieldErrors, submitError, isPending, submit } = useLoginForm();
File renamed without changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Button } from '@muneo/design-system';
2+
import { Link } from 'react-router';
3+
import { ROUTES } from '@/constants/routes';
4+
5+
export const NotFound = () => (
6+
<div
7+
style={{
8+
minHeight: '100vh',
9+
display: 'flex',
10+
flexDirection: 'column',
11+
alignItems: 'center',
12+
justifyContent: 'center',
13+
textAlign: 'center',
14+
padding: '24px',
15+
}}
16+
>
17+
<p style={{ fontSize: '120px', fontWeight: 900, lineHeight: 1, color: '#0F62FE', margin: 0 }}>404</p>
18+
<h1 style={{ fontSize: '22px', fontWeight: 700, margin: '20px 0 10px', color: '#0F172A' }}>
19+
페이지를 찾을 수 없습니다
20+
</h1>
21+
<p style={{ fontSize: '14px', color: '#64748B', margin: '0 0 36px', lineHeight: 1.6 }}>
22+
요청하신 페이지가 존재하지 않거나 이동되었습니다.
23+
</p>
24+
<Button as={Link} to={ROUTES.users} variant="primary" size="md">
25+
홈으로 돌아가기
26+
</Button>
27+
</div>
28+
);
File renamed without changes.

apps/admin/src/pages/UserDetailPage/UserDetailPage.tsx renamed to apps/admin/src/pages/UserDetail/UserDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { UserDangerZone } from './components/UserDangerZone';
66
import { UserEditForm } from './components/UserEditForm';
77
import { UserRoleSection } from './components/UserRoleSection';
88
import { useUserDetail } from './hooks/useUserDetail';
9-
import * as styles from './UserDetailPage.css';
9+
import * as styles from './UserDetail.css';
1010

11-
export const UserDetailPage = () => {
11+
export const UserDetail = () => {
1212
const {
1313
userId,
1414
detail,

apps/admin/src/pages/UserDetailPage/components/UserDangerZone.tsx renamed to apps/admin/src/pages/UserDetail/components/UserDangerZone.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button } from '@muneo/design-system';
22
import { Card } from '@/components/Card';
3-
import * as styles from '../UserDetailPage.css';
3+
import * as styles from '../UserDetail.css';
44

55
interface UserDangerZoneProps {
66
isDeleted: boolean;

apps/admin/src/pages/UserDetailPage/components/UserEditForm.tsx renamed to apps/admin/src/pages/UserDetail/components/UserEditForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type FormEvent } from 'react';
33
import { type UpdateUserRequest } from '@/api';
44
import { Card } from '@/components/Card';
55
import { type FormErrors } from '../hooks/useUserDetail';
6-
import * as styles from '../UserDetailPage.css';
6+
import * as styles from '../UserDetail.css';
77

88
interface UserEditFormProps {
99
form: UpdateUserRequest;

0 commit comments

Comments
 (0)