@@ -5,6 +5,9 @@ import {Button, Col, Container, Row} from "reactstrap";
5
5
import { NewsCarousel } from "../../elements/NewsCarousel" ;
6
6
import { above , SITE_TITLE , useDeviceSize , useUserConsent } from "../../../services" ;
7
7
import { HomepageYoutubeCookieHandler } from "../../handlers/InterstitialCookieHandler" ;
8
+ import { ListViewCardProps , ListViewCards } from "../../elements/list-groups/ListView" ;
9
+ import { ShortcutResponse , Subject } from "../../../../IsaacAppTypes" ;
10
+ import { ListViewTagProps } from "../../elements/list-groups/AbstractListViewItem" ;
8
11
import { StudentDashboard } from "../../elements/StudentDashboard" ;
9
12
10
13
export const HomepagePhy = ( ) => {
@@ -13,6 +16,31 @@ export const HomepagePhy = () => {
13
16
const user = useAppSelector ( selectors . user . orNull ) ;
14
17
const deviceSize = useDeviceSize ( ) ;
15
18
const userConsent = useUserConsent ( ) ;
19
+ const subjectList : Subject [ ] = [ "physics" , "maths" , "chemistry" , "biology" ] ;
20
+ const subjectTags : { [ key in Subject ] : ListViewTagProps [ ] } = {
21
+ physics : [ { tag : "11-14" , url : "physics/11_14" } , { tag : "GCSE" , url : "physics/gcse" } , { tag : "A-Level" , url : "physics/a_level" } , { tag : "University" , url : "physics/university" } ] ,
22
+ maths : [ { tag : "GCSE" , url : "maths/gcse" } , { tag : "A-Level" , url : "maths/a_level" } , { tag : "University" , url : "maths/university" } ] ,
23
+ chemistry : [ { tag : "GCSE" , url : "chemistry/gcse" } , { tag : "A-Level" , url : "chemistry/a_level" } ] ,
24
+ biology : [ { tag : "A-Level" , url : "biology/a_level" } ] ,
25
+ } ;
26
+
27
+ const getListViewSubjectCard = ( { subject} : { subject : Subject } ) => {
28
+ const item : ShortcutResponse = {
29
+ title : subject . charAt ( 0 ) . toUpperCase ( ) + subject . slice ( 1 ) ,
30
+ subtitle : "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris faucibus est vulputate augue tristique, sed vehicula turpis pellentesque." ,
31
+ } ;
32
+
33
+ const listViewSubjectCard : ListViewCardProps = {
34
+ item : item ,
35
+ icon : { type : "img" , icon : `/assets/phy/icons/redesign/subject-${ subject } .svg` } ,
36
+ subject : subject ,
37
+ tagList : subjectTags [ subject ] ,
38
+ } ;
39
+
40
+ return listViewSubjectCard ;
41
+ } ;
42
+
43
+ const cards = subjectList . map ( ( subject : Subject ) => getListViewSubjectCard ( { subject} ) ) ;
16
44
17
45
return < >
18
46
{ /*<WarningBanner/>*/ }
@@ -86,6 +114,13 @@ export const HomepagePhy = () => {
86
114
</ Container >
87
115
</ section >
88
116
117
+ < section id = "navigation-cards" >
118
+ < Container >
119
+ < h2 > Explore and learn!</ h2 >
120
+ < ListViewCards cards = { cards } />
121
+ </ Container >
122
+ </ section >
123
+
89
124
< section id = "news" >
90
125
< Container >
91
126
< div className = "h-underline mb-4 mt-4 pt-2 mt-sm-5 pt-sm-0 d-flex align-items-center" >
0 commit comments