Skip to content

Commit 6416c5e

Browse files
committed
fix: 어드민과 페이지의 스타일이 다르던 문제 수정
1 parent 27e29c6 commit 6416c5e

File tree

2 files changed

+113
-2
lines changed

2 files changed

+113
-2
lines changed

apps/pyconkr-admin/src/components/pages/page/editor.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Common from "@frontend/common";
22
import { Add, Delete, OpenInNew } from "@mui/icons-material";
3-
import { Box, Button, ButtonProps, CircularProgress, Divider, Stack, Tab, Tabs } from "@mui/material";
3+
import { Box, Button, ButtonProps, CircularProgress, Divider, Stack, Tab, Tabs, ThemeProvider } from "@mui/material";
44
import { ErrorBoundary, Suspense } from "@suspensive/react";
55
import { commands } from "@uiw/react-md-editor";
66
import * as React from "react";
@@ -10,6 +10,7 @@ import { useParams } from "react-router-dom";
1010
// but for whatever reason this stupid namespace won't import on Common.Schemas.BackendAdminAPI.PageSectionSchema.
1111
// TODO: FIXME: Remove this hack when the issue is resolved. This is dumb.
1212
import BackendAdminAPISchemas from "../../../../../../packages/common/src/schemas/backendAdminAPI";
13+
import { muiTheme } from "../../../styles/globalStyles";
1314
import { addErrorSnackbar } from "../../../utils/snackbar";
1415
import { AdminEditor } from "../../layouts/admin_editor";
1516

@@ -61,7 +62,9 @@ const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({
6162
</Button>
6263
</Stack>
6364
<Box sx={{ flexGrow: 1, width: "50%", backgroundColor: "#fff" }}>
64-
<Common.Components.MDXRenderer text={defaultValue || ""} />
65+
<ThemeProvider theme={muiTheme}>
66+
<Common.Components.MDXRenderer text={defaultValue || ""} />
67+
</ThemeProvider>
6568
</Box>
6669
</Stack>
6770
);
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import { css } from "@emotion/react";
2+
import { createTheme } from "@mui/material/styles";
3+
4+
export const muiTheme = createTheme({
5+
typography: {
6+
fontFamily:
7+
'Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif',
8+
},
9+
palette: {
10+
primary: {
11+
main: "#259299",
12+
light: "#B6D8D7",
13+
dark: "#126D7F",
14+
nonFocus: "#7AB2B3",
15+
},
16+
secondary: {
17+
main: "#259299",
18+
light: "#B6D8D7",
19+
dark: "#126D7F",
20+
},
21+
highlight: {
22+
main: "#E17101",
23+
light: "#EE8D74",
24+
dark: "#C66900",
25+
contrastText: "#FFFFFF",
26+
},
27+
text: {
28+
primary: "#000000",
29+
secondary: "#666666",
30+
disabled: "#999999",
31+
},
32+
background: {
33+
default: "#FFFFFF",
34+
paper: "#FFFFFF",
35+
},
36+
common: {
37+
black: "#000000",
38+
white: "#FFFFFF",
39+
},
40+
error: {
41+
main: "#d32f2f",
42+
light: "#ef5350",
43+
dark: "#c62828",
44+
},
45+
warning: {
46+
main: "#ed6c02",
47+
light: "#ff9800",
48+
dark: "#e65100",
49+
},
50+
info: {
51+
main: "#0288d1",
52+
light: "#03a9f4",
53+
dark: "#01579b",
54+
},
55+
success: {
56+
main: "#2e7d32",
57+
light: "#4caf50",
58+
dark: "#1b5e20",
59+
},
60+
},
61+
});
62+
63+
export const globalStyles = css`
64+
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");
65+
66+
html,
67+
body {
68+
font-family:
69+
"Pretendard",
70+
-apple-system,
71+
BlinkMacSystemFont,
72+
system-ui,
73+
Roboto,
74+
"Helvetica Neue",
75+
"Segoe UI",
76+
"Apple SD Gothic Neo",
77+
"Noto Sans KR",
78+
"Malgun Gothic",
79+
"Apple Color Emoji",
80+
"Segoe UI Emoji",
81+
"Segoe UI Symbol",
82+
sans-serif;
83+
-webkit-font-smoothing: antialiased;
84+
-moz-osx-font-smoothing: grayscale;
85+
-webkit-touch-callout: none;
86+
-webkit-user-select: none;
87+
-khtml-user-select: none;
88+
-moz-user-select: none;
89+
-ms-user-select: none;
90+
user-select: none;
91+
overscroll-behavior: none;
92+
word-break: keep-all;
93+
overflow-wrap: break-all;
94+
95+
-webkit-user-drag: none;
96+
-khtml-user-drag: none;
97+
-moz-user-drag: none;
98+
-o-user-drag: none;
99+
user-drag: none;
100+
101+
font-variant-numeric: tabular-nums;
102+
}
103+
104+
a {
105+
text-decoration: none;
106+
color: inherit;
107+
}
108+
`;

0 commit comments

Comments
 (0)