refactor: 모든 page에 index.js 추가

This commit is contained in:
jhynsoo 2024-07-21 00:35:30 +09:00
parent e47803fa71
commit 59d5b6749a
29 changed files with 52 additions and 16 deletions

View File

@ -1,13 +1,16 @@
import { Outlet } from 'react-router-dom';
import { Footer } from '../Footer';
import { Header } from '../Header';
import styles from './PageLayout.module.css';
export default function PageLayout({ children }) {
export default function PageLayout() {
return (
<>
<Header />
<div className={styles.body}>
<div className={styles.contents}>{children}</div>
<div className={styles.contents}>
<Outlet />
</div>
<Footer />
</div>
</>

View File

@ -0,0 +1 @@
export { default as CreateQuestionPage } from './CreateQuestionPage';

View File

@ -1,10 +1,15 @@
import { Footer } from '../../components/Footer';
import useBoundStore from '../../store';
import StudentHomePage from '../StudentHomePage/StudentHomePage';
export default function Home() {
return (
<div>
<div>asdf</div>
<Footer />
</div>
);
export default function HomePage() {
const userType = useBoundStore((state) => state.userType);
switch (userType) {
case 'student':
return <StudentHomePage />;
case 'teacher':
return <div>teacher home</div>;
default:
return <StudentHomePage />;
}
}

View File

@ -1 +1 @@
export { default as Home } from './HomePage';
export { default as HomePage } from './HomePage';

View File

@ -0,0 +1 @@
export { default as LearningLectureDetailPage } from './LearningLectureDetailPage';

View File

@ -0,0 +1 @@
export { default as LectureInfoPage } from './LectureInfoPage';

View File

@ -0,0 +1 @@
export { default as LecturerCreateNoticePage } from './LecturerCreateNoticePage';

View File

@ -0,0 +1 @@
export { default as LoginPage } from './LoginPage';

View File

@ -0,0 +1 @@
export { default as MyInfoChangePage } from './MyInfoChangePage';

View File

@ -0,0 +1 @@
export { default as NotFoundPage } from './NotFoundPage';

View File

@ -0,0 +1 @@
export { default as NoticeDetailPage } from './NoticeDetailPage';

View File

@ -0,0 +1 @@
export { default as NoticeListPage } from './NoticeListPage';

View File

@ -0,0 +1 @@
export { default as PasswordChangePage } from './PasswordChangePage';

View File

@ -0,0 +1 @@
export { default as PasswordResetPage } from './PasswordResetPage';

View File

@ -0,0 +1 @@
export { default as QuestionDetailPage } from './QuestionDetailPage';

View File

@ -0,0 +1 @@
export { default as QuestionListPage } from './QuestionListPage';

View File

@ -2,7 +2,7 @@ import { ClassCard } from '../../components/ClassCard';
import { ClassGrid } from '../../components/ClassGrid';
import { MaxWidthLayout } from '../../components/Layout';
export default function StudentHomeMainPage() {
export default function StudentHomePage() {
const onGoingClasses = [
{ lecture_id: 1, title: '한국어' },
{ lecture_id: 2, title: '영어' },

View File

@ -0,0 +1 @@
export { default as StudentHomePage } from './StudentHomePage';

View File

@ -4,7 +4,7 @@ import { ArticleLink } from '../../components/ArticleLink';
import { MaxWidthLayout } from '../../components/Layout';
import ArticleBoard from '../../components/ArticleBoard/ArticleBoard';
export default function QuestionListPage() {
export default function StudentListPage() {
const students = [
{ name: '학생1', quizScore: 40 },
{ name: '학생2', quizScore: 40 },

View File

@ -0,0 +1 @@
export { default as StudentListPage } from './StudentListPage';

View File

@ -2,9 +2,9 @@ import LectureHeader from '../../components/LectureHeader/LectureHeader';
import { SideBar, SideLink, SideItem } from '../../components/SideBar';
import { MaxWidthLayout } from '../../components/Layout';
import ArticlePreview from '../../components/Article/ArticlePreview/ArticlePreview';
import styles from './LecturerLectureDetailPage.module.css';
import styles from './TeacherLectureDetailPage.module.css';
export default function LecturerLectureDetailPage() {
export default function TeacherLectureDetailPage() {
const lecture = {
title: '정보처리기사 실기 완전정복',
tutor: '박정민',

View File

@ -0,0 +1 @@
export { default as TeacherLectureDetailPage } from './TeacherLectureDetailPage';

View File

@ -4,7 +4,7 @@ import { ArticleLink } from '../../components/ArticleLink';
import { MaxWidthLayout } from '../../components/Layout';
import ArticleBoard from '../../components/ArticleBoard/ArticleBoard';
export default function LecturerNoticeListPage() {
export default function TeacherNoticeListPage() {
const notices = [
{},
{ title: '공지사항1', sub: '7-12 오전 11:40:57' },

View File

@ -0,0 +1 @@
export { default as TeacherNoticeListPage } from './TeacherNoticeListPage';

View File

@ -0,0 +1 @@
export { default as UserRegisterPage } from './UserRegisterPage';

View File

@ -0,0 +1,10 @@
import { create } from 'zustand';
import { userTypeSlice } from './userTypeSlice';
import { tokenSlice } from './tokenSlice';
const useBoundStore = create((...a) => ({
...userTypeSlice(...a),
...tokenSlice(...a),
}));
export default useBoundStore;