From 82abe44eacd27d7325379bc42fc6be55e725119f Mon Sep 17 00:00:00 2001 From: Aliwoto Date: Mon, 26 Aug 2024 00:14:09 +0330 Subject: [PATCH] Remove legacy dashboard for now. Signed-off-by: Aliwoto --- src/pages/dashboardPage.tsx | 72 ++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/src/pages/dashboardPage.tsx b/src/pages/dashboardPage.tsx index ce944c4..a38b19f 100644 --- a/src/pages/dashboardPage.tsx +++ b/src/pages/dashboardPage.tsx @@ -4,16 +4,16 @@ import apiClient from '../apiClient'; import { DashboardContainer } from '../components/containers/dashboardContainer'; import { autoSetWindowTitle } from '../utils/commonUtils'; -export var forceUpdateDashboardPage = () => {}; +export var forceUpdateDashboardPage = () => { }; -const MainContent = styled.div` +export const MainContent = styled.div` display: flex; gap: 20px; padding: 20px; `; -const Section = styled.div` +export const Section = styled.div` flex: 1; background-color: #f9f9f9; padding: 20px; @@ -35,12 +35,50 @@ const ListItem = styled.li` margin-bottom: 5px; `; +const AddMainContent = (legacyContent: boolean = false) => { + if (!legacyContent) { + return ( + + {/* TODO */} + + ); + } + + return ( + +
+ Courses + + Mathematics + Physics + Chemistry + +
+
+ Exams + + Midterm Exam + Final Exam + Pop Quiz + +
+
+ Topics + + Ongoing Exams + Participated Exams + +
+
+ ); +} + const DashboardPage: React.FC = () => { const [, forceUpdate] = React.useReducer(x => x + 1, 0); forceUpdateDashboardPage = () => { forceUpdate(); } - + const fetchUserInfo = async () => { try { await apiClient.getCurrentUserInfo(); @@ -58,31 +96,7 @@ const DashboardPage: React.FC = () => { return ( - -
- Courses - - Mathematics - Physics - Chemistry - -
-
- Exams - - Midterm Exam - Final Exam - Pop Quiz - -
-
- Topics - - Ongoing Exams - Participated Exams - -
-
+ {AddMainContent()}
) };