diff --git a/components/Layout/Layout.tsx b/components/Layout/Layout.tsx index 6ddda8d72..6c5c48e2c 100644 --- a/components/Layout/Layout.tsx +++ b/components/Layout/Layout.tsx @@ -12,6 +12,7 @@ import Statistics from 'pages/statistics'; import Header from './Header'; import Footer from './Footer'; import CurrentMatch from './CurrentMatch'; +import AdminLayout from '../admin/Layout'; import styles from 'styles/Layout/Layout.module.scss'; type AppLayoutProps = { @@ -100,7 +101,9 @@ export default function AppLayout({ children }: AppLayoutProps) { } }; - return ( + return presentPath.includes('/admin') && user.isAdmin ? ( + {children} + ) : (
diff --git a/components/admin/Layout.tsx b/components/admin/Layout.tsx new file mode 100644 index 000000000..9e739bcf9 --- /dev/null +++ b/components/admin/Layout.tsx @@ -0,0 +1,26 @@ +import Link from 'next/link'; +import SideNav from './SideNav'; +import styles from 'styles/admin/Layout.module.scss'; + +type AdminLayoutProps = { + children: React.ReactNode; +}; + +export default function AdminLayout({ children }: AdminLayoutProps) { + return ( +
+
+ +
관리자 페이지
+ + + + +
+
+ + {children} +
+
+ ); +} diff --git a/components/admin/SideNav.tsx b/components/admin/SideNav.tsx new file mode 100644 index 000000000..b6ac9ad4b --- /dev/null +++ b/components/admin/SideNav.tsx @@ -0,0 +1,67 @@ +import { useRouter } from 'next/router'; +import SideNavContent from './SideNavContent'; +import { GoSettings } from 'react-icons/go'; +import { MdOutlineMessage } from 'react-icons/md'; +import { + GrUserSettings, + GrNotification, + GrStatusWarning, + GrAnnounce, +} from 'react-icons/gr'; +import styles from 'styles/admin/SideNav.module.scss'; + +export default function SideNav() { + const currentPath = useRouter().asPath.replace('/admin', ''); + + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ ); +} diff --git a/components/admin/SideNavContent.tsx b/components/admin/SideNavContent.tsx new file mode 100644 index 000000000..ea6c80358 --- /dev/null +++ b/components/admin/SideNavContent.tsx @@ -0,0 +1,29 @@ +import Link from 'next/link'; +import styles from 'styles/admin/SideNavContent.module.scss'; + +type SideNavContentProps = { + url: string; + menuName: string; + currentPath: string; + children: React.ReactNode; +}; + +export default function SideNavContent({ + url, + menuName, + currentPath, + children, +}: SideNavContentProps) { + return ( + +
+ {children} +
{menuName}
+
+ + ); +} diff --git a/pages/admin/announcement.tsx b/pages/admin/announcement.tsx new file mode 100644 index 000000000..f163909c3 --- /dev/null +++ b/pages/admin/announcement.tsx @@ -0,0 +1,3 @@ +export default function Announcement() { + return
announcement page
; +} diff --git a/pages/admin/feedback.tsx b/pages/admin/feedback.tsx new file mode 100644 index 000000000..c20f2062c --- /dev/null +++ b/pages/admin/feedback.tsx @@ -0,0 +1,3 @@ +export default function Feedback() { + return
feedback page
; +} diff --git a/pages/admin/index.tsx b/pages/admin/index.tsx new file mode 100644 index 000000000..9d47b80dc --- /dev/null +++ b/pages/admin/index.tsx @@ -0,0 +1,3 @@ +export default function Admin() { + return
admin page
; +} diff --git a/pages/admin/notification.tsx b/pages/admin/notification.tsx new file mode 100644 index 000000000..6796583cf --- /dev/null +++ b/pages/admin/notification.tsx @@ -0,0 +1,3 @@ +export default function Notification() { + return
notification page
; +} diff --git a/pages/admin/penalty.tsx b/pages/admin/penalty.tsx new file mode 100644 index 000000000..4fb32fa2a --- /dev/null +++ b/pages/admin/penalty.tsx @@ -0,0 +1,3 @@ +export default function Penalty() { + return
penalty page
; +} diff --git a/pages/admin/slot.tsx b/pages/admin/slot.tsx new file mode 100644 index 000000000..3b4605985 --- /dev/null +++ b/pages/admin/slot.tsx @@ -0,0 +1,3 @@ +export default function Slot() { + return
slot page
; +} diff --git a/pages/admin/users.tsx b/pages/admin/users.tsx new file mode 100644 index 000000000..13c8edcc2 --- /dev/null +++ b/pages/admin/users.tsx @@ -0,0 +1,3 @@ +export default function Users() { + return
users page
; +} diff --git a/public/font/Inter-VariableFont_slnt,wght.ttf b/public/font/Inter-VariableFont_slnt,wght.ttf new file mode 100644 index 000000000..ec3164efa Binary files /dev/null and b/public/font/Inter-VariableFont_slnt,wght.ttf differ diff --git a/styles/admin/Layout.module.scss b/styles/admin/Layout.module.scss new file mode 100644 index 000000000..49ea56057 --- /dev/null +++ b/styles/admin/Layout.module.scss @@ -0,0 +1,48 @@ +@import 'styles/common.scss'; + +.adminContainer { + display: flex; + flex-direction: column; + align-items: center; + width: 100vw; + min-width: 720px; + height: 100vh; + background: white; +} + +.header { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 100%; + height: 4.5rem; + padding: 0 1.5rem; + background: white; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); +} + +.title { + color: black; + font-family: $admin-font; + font-size: $giant-font; + cursor: pointer; +} + +.homeButton { + @include button(white, black, 4rem, 2.5rem); + background: white; + border: 1px solid $medium-gray; +} + +.homeButton:hover { + background: linear-gradient(to bottom, white, $light-gray); +} + +.container { + display: flex; + flex-direction: row; + align-items: center; + width: 100%; + height: 100%; +} diff --git a/styles/admin/SideNav.module.scss b/styles/admin/SideNav.module.scss new file mode 100644 index 000000000..f7eecb71e --- /dev/null +++ b/styles/admin/SideNav.module.scss @@ -0,0 +1,17 @@ +@import 'styles/common.scss'; + +.container { + display: flex; + flex-direction: column; + width: 250px; + height: 100%; + padding: 0.5rem; + margin-top: 0.2rem; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); +} + +.logo { + width: 18px; + height: 18px; + margin-left: 3px; +} diff --git a/styles/admin/SideNavContent.module.scss b/styles/admin/SideNavContent.module.scss new file mode 100644 index 000000000..aa7704c3e --- /dev/null +++ b/styles/admin/SideNavContent.module.scss @@ -0,0 +1,26 @@ +@import 'styles/common.scss'; + +.content { + display: flex; + flex-direction: row; + align-items: center; + height: 2rem; + padding: 0 0.5rem; + margin-bottom: 0.5rem; + border-radius: 0.75rem; + border: 1px solid rgba(0, 0, 0, 0); + cursor: pointer; +} + +.content:hover { + border: 1px solid $medium-gray; +} + +.contentText { + font-family: $admin-font; + margin-left: 0.75rem; +} + +.selected { + background: #f3f4f6; +} diff --git a/styles/common.scss b/styles/common.scss index b5dcfb62c..aeb4b97d2 100644 --- a/styles/common.scss +++ b/styles/common.scss @@ -46,6 +46,7 @@ $winner-blue: #040eff; /* font */ $logo-font: 'Agonostic Italic', cursive; $title-font: 'Reality Hyper Regular', cursive; +$admin-font: 'Inter', cursive; $text-border-black: 0.1rem 0 black, 0 0.1rem black, -0.1rem 0 black, 0 -0.1rem black; $text-shadow-red: 2px 2px 0px $pp-red; diff --git a/styles/globals.css b/styles/globals.css index a05b7392c..16ee2d686 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -21,6 +21,13 @@ body { font-style: normal; } +@font-face { + font-family: 'Inter'; + src: url('../public/font/Inter-VariableFont_slnt,wght.ttf') format('opentype'); + font-weight: normal; + font-style: normal; +} + ::-webkit-scrollbar { display: none; }