Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/Global/AdminHeader/AdminHeader.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import '../../../styles/abstracts/_mixins/text';
@import '../../../styles/abstracts/variables';

.pageName {
@include font-header-extra-bold;
width: 100vw;
height: 3.4rem;
padding: 0 1.5rem 3rem;
font-size: 1.5rem;
border-bottom: $grey-transparency 1px solid;
}
15 changes: 15 additions & 0 deletions src/components/Global/AdminHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import styles from './AdminHeader.module.scss';

const AdminHeader = () => {
const currentPage = 'Admin Dashboard';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait why is this a variable here and not a prop or just hardcoded?

return (
<div>
<div className={styles.pageName}>
<p>{currentPage}</p>
</div>
</div>
);
};

export default AdminHeader;
2 changes: 2 additions & 0 deletions src/components/Global/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import LogStatusButton from './LogStatusButton';
import SearchAndFilter from './SearchAndFilter';
import Difficulty from './Difficulty';
import Loading from './Loading';
import AdminHeader from './AdminHeader';
import Sidebar from './Sidebar';

export {
Expand All @@ -25,5 +26,6 @@ export {
SearchAndFilter,
Difficulty,
Loading,
AdminHeader
Sidebar
};
4 changes: 2 additions & 2 deletions src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import {
} from '../../components/App';
import { getAllPuzzles, isAdmin } from '../../services';
import { GetServerSideProps } from 'next';
import { Header } from '../../components/Global';
import { AdminHeader, Header } from '../../components/Global';
import type { PuzzleCustom } from '../../types/api/puzzles/puzzle';

const Admin = ({ puzzlesList }: { puzzlesList: PuzzleCustom[] }) => {
const [modalIsOpen, setModalIsOpen] = React.useState(false);
return (
<>
<Header />
{/** TODO: Create Header for admin page */}
<AdminHeader />
<h1 className={styles.adminTitle}>Admin Dashboard</h1>
<div className={styles.contentWrap}>
<div className={styles.contentLeftWrap}>
Expand Down