|
| 1 | +import React from 'react'; |
| 2 | +import { useHistory } from 'react-router-dom'; |
| 3 | +import { useSelector } from 'react-redux'; |
| 4 | +import Sidebar from './StudentSidebar'; |
| 5 | +import styles from './StudentDashboard.module.css'; |
| 6 | + |
| 7 | +const LIFE_CARD_IDS = ['lc-a', 'lc-b', 'lc-c', 'lc-d', 'lc-e', 'lc-f']; |
| 8 | + |
| 9 | +export default function StudentDashboard() { |
| 10 | + const history = useHistory(); |
| 11 | + const darkMode = useSelector(state => state.theme?.darkMode); |
| 12 | + |
| 13 | + const tasks = [ |
| 14 | + { |
| 15 | + id: 1, |
| 16 | + title: 'Activity 1: Technology, Art, Trades, Health', |
| 17 | + subtitle: 'Technology, Art, Trades, Health', |
| 18 | + progress: 25, |
| 19 | + }, |
| 20 | + { |
| 21 | + id: 2, |
| 22 | + title: 'Activity 2: Math, Science, Innovation', |
| 23 | + subtitle: 'Math, Science, Innovation', |
| 24 | + progress: 50, |
| 25 | + }, |
| 26 | + { |
| 27 | + id: 3, |
| 28 | + title: 'Activity 3: Social Sciences, English, Values', |
| 29 | + subtitle: 'Social Sciences, English, Values', |
| 30 | + progress: 33, |
| 31 | + }, |
| 32 | + ]; |
| 33 | + |
| 34 | + const subjects = [ |
| 35 | + 'Arts/ Trades', |
| 36 | + 'English', |
| 37 | + 'Health', |
| 38 | + 'Math', |
| 39 | + 'Science', |
| 40 | + 'Social Sciences', |
| 41 | + 'Tech & Innovation', |
| 42 | + 'Values', |
| 43 | + ]; |
| 44 | + |
| 45 | + return ( |
| 46 | + <div className={`${styles.pageLayout} ${darkMode ? styles.pageLayoutDark : ''}`}> |
| 47 | + <Sidebar active="home" /> |
| 48 | + <div className={`${styles.content} ${darkMode ? styles.contentDark : ''}`}> |
| 49 | + <div className={styles.headerRow}> |
| 50 | + <h1 className={styles.title}>Dashboard</h1> |
| 51 | + <div className={styles.welcomeArea}> |
| 52 | + <span className={styles.welcomeLabel}>Welcome, Student Name</span> |
| 53 | + <div className={styles.icons}> |
| 54 | + <span className={styles.icon} aria-hidden="true"> |
| 55 | + 👤 |
| 56 | + </span> |
| 57 | + <span className={styles.icon} aria-hidden="true"> |
| 58 | + 🔔 |
| 59 | + </span> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + <hr className={styles.divider} /> |
| 64 | + |
| 65 | + <div className={styles.mainGrid}> |
| 66 | + <section className={styles.visualArea} aria-label="Knowledge map"> |
| 67 | + <div className={styles.visualPlaceholder} /> |
| 68 | + </section> |
| 69 | + |
| 70 | + <aside className={styles.todoPanel} aria-label="To Do"> |
| 71 | + <div className={styles.todoHeaderRow}> |
| 72 | + <h2 className={styles.todoTitle}>To Do</h2> |
| 73 | + <button |
| 74 | + className={styles.viewAllBtn} |
| 75 | + type="button" |
| 76 | + onClick={() => history.push('/educationportal/student/tasks')} |
| 77 | + > |
| 78 | + View all tasks |
| 79 | + </button> |
| 80 | + </div> |
| 81 | + <hr className={styles.todoDivider} /> |
| 82 | + |
| 83 | + <ul className={styles.todoList}> |
| 84 | + {tasks.map(t => ( |
| 85 | + <li key={t.id} className={styles.todoItem}> |
| 86 | + <button |
| 87 | + className={styles.todoBtn} |
| 88 | + type="button" |
| 89 | + onClick={() => history.push(`/educationportal/student/tasks/${t.id}`)} |
| 90 | + aria-label={`Open ${t.title}`} |
| 91 | + > |
| 92 | + <div className={styles.todoText}> |
| 93 | + <div className={styles.todoName}>{t.title}</div> |
| 94 | + <div className={styles.todoSub}>{t.subtitle}</div> |
| 95 | + </div> |
| 96 | + <div className={styles.todoRight}> |
| 97 | + <div className={styles.progressTrack} aria-hidden="true"> |
| 98 | + <div className={styles.progressFill} style={{ width: `${t.progress}%` }} /> |
| 99 | + </div> |
| 100 | + <span className={styles.chev} aria-hidden="true"> |
| 101 | + → |
| 102 | + </span> |
| 103 | + </div> |
| 104 | + </button> |
| 105 | + </li> |
| 106 | + ))} |
| 107 | + </ul> |
| 108 | + |
| 109 | + <div className={styles.block}> |
| 110 | + <h3 className={styles.blockTitle}>Teaching Strategies</h3> |
| 111 | + <hr className={styles.blockDivider} /> |
| 112 | + <ul className={styles.strategyList}> |
| 113 | + {[ |
| 114 | + 'Body Smart Exploration', |
| 115 | + 'Crazy Creative Combo Cooperative', |
| 116 | + 'Curious Copycat', |
| 117 | + 'Existential Smart Exploration', |
| 118 | + 'Freedom Learning', |
| 119 | + ].map(s => ( |
| 120 | + <li key={s} className={styles.strategyItem}> |
| 121 | + {s} |
| 122 | + </li> |
| 123 | + ))} |
| 124 | + </ul> |
| 125 | + </div> |
| 126 | + |
| 127 | + <div className={styles.block}> |
| 128 | + <h3 className={styles.blockTitle}>Life Strategies</h3> |
| 129 | + <hr className={styles.blockDivider} /> |
| 130 | + <div className={styles.lifeGrid}> |
| 131 | + {LIFE_CARD_IDS.map(id => ( |
| 132 | + <div key={id} className={styles.lifeCard} /> |
| 133 | + ))} |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + </aside> |
| 137 | + </div> |
| 138 | + |
| 139 | + <div className={styles.subjectChips}> |
| 140 | + {subjects.map(s => ( |
| 141 | + <span key={s} className={styles.chip}> |
| 142 | + {s} |
| 143 | + </span> |
| 144 | + ))} |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + </div> |
| 148 | + ); |
| 149 | +} |
0 commit comments