refactor: 모든 page에 index.js 추가
This commit is contained in:
parent
e47803fa71
commit
59d5b6749a
@ -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>
|
||||
</>
|
||||
|
1
frontend/src/pages/CreateQuestionPage/index.js
Normal file
1
frontend/src/pages/CreateQuestionPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as CreateQuestionPage } from './CreateQuestionPage';
|
@ -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 />;
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export { default as Home } from './HomePage';
|
||||
export { default as HomePage } from './HomePage';
|
||||
|
1
frontend/src/pages/LearningLectureDetailPage/index.js
Normal file
1
frontend/src/pages/LearningLectureDetailPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as LearningLectureDetailPage } from './LearningLectureDetailPage';
|
1
frontend/src/pages/LectureInfoPage/index.js
Normal file
1
frontend/src/pages/LectureInfoPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as LectureInfoPage } from './LectureInfoPage';
|
1
frontend/src/pages/LecturerCreateNoticePage/index.js
Normal file
1
frontend/src/pages/LecturerCreateNoticePage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as LecturerCreateNoticePage } from './LecturerCreateNoticePage';
|
1
frontend/src/pages/LoginPage/index.js
Normal file
1
frontend/src/pages/LoginPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as LoginPage } from './LoginPage';
|
1
frontend/src/pages/MyInfoChangePage/index.js
Normal file
1
frontend/src/pages/MyInfoChangePage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as MyInfoChangePage } from './MyInfoChangePage';
|
1
frontend/src/pages/NotFoundPage/index.js
Normal file
1
frontend/src/pages/NotFoundPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as NotFoundPage } from './NotFoundPage';
|
1
frontend/src/pages/NoticeDetailPage/index.js
Normal file
1
frontend/src/pages/NoticeDetailPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as NoticeDetailPage } from './NoticeDetailPage';
|
1
frontend/src/pages/NoticeListPage/index.js
Normal file
1
frontend/src/pages/NoticeListPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as NoticeListPage } from './NoticeListPage';
|
1
frontend/src/pages/PasswordChangePage/index.js
Normal file
1
frontend/src/pages/PasswordChangePage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as PasswordChangePage } from './PasswordChangePage';
|
1
frontend/src/pages/PasswordResetPage/index.js
Normal file
1
frontend/src/pages/PasswordResetPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as PasswordResetPage } from './PasswordResetPage';
|
1
frontend/src/pages/QuestionDetailPage/index.js
Normal file
1
frontend/src/pages/QuestionDetailPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as QuestionDetailPage } from './QuestionDetailPage';
|
1
frontend/src/pages/QuestionListPage/index.js
Normal file
1
frontend/src/pages/QuestionListPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as QuestionListPage } from './QuestionListPage';
|
@ -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: '영어' },
|
1
frontend/src/pages/StudentHomePage/index.js
Normal file
1
frontend/src/pages/StudentHomePage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as StudentHomePage } from './StudentHomePage';
|
@ -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 },
|
||||
|
1
frontend/src/pages/StudentListPage/index.js
Normal file
1
frontend/src/pages/StudentListPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as StudentListPage } from './StudentListPage';
|
@ -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: '박정민',
|
1
frontend/src/pages/TeacherLectureDetailPage/index.js
Normal file
1
frontend/src/pages/TeacherLectureDetailPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as TeacherLectureDetailPage } from './TeacherLectureDetailPage';
|
@ -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' },
|
1
frontend/src/pages/TeacherNoticeListPage/index.js
Normal file
1
frontend/src/pages/TeacherNoticeListPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as TeacherNoticeListPage } from './TeacherNoticeListPage';
|
1
frontend/src/pages/UserRegisterPage/index.js
Normal file
1
frontend/src/pages/UserRegisterPage/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as UserRegisterPage } from './UserRegisterPage';
|
10
frontend/src/store/index.js
Normal file
10
frontend/src/store/index.js
Normal 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;
|
Loading…
Reference in New Issue
Block a user