@@ -8,6 +8,7 @@ import { PageContextState, ShortcutResponse } from "../../../IsaacAppTypes";
8
8
import { ListView , ListViewCardProps , ListViewCards } from "../elements/list-groups/ListView" ;
9
9
import { LandingPageFooter } from "./SubjectLandingPage" ;
10
10
import { DifficultyIcon } from "../elements/svg/DifficultyIcons" ;
11
+ import { AbstractListViewItemState } from "../elements/list-groups/AbstractListViewItem" ;
11
12
12
13
const SubjectCards = ( { context} : { context : PageContextState } ) => {
13
14
const deviceSize = useDeviceSize ( ) ;
@@ -28,6 +29,7 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
28
29
} ,
29
30
url : `/${ context . subject } /11_14` ,
30
31
stage : LEARNING_STAGE [ "11_TO_14" ] ,
32
+ subject : context . subject ,
31
33
} ,
32
34
{
33
35
item : {
@@ -40,6 +42,8 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
40
42
} ,
41
43
url : `/${ context . subject } /gcse` ,
42
44
stage : LEARNING_STAGE . GCSE ,
45
+ subject : context . subject ,
46
+ state : context . subject === "biology" ? AbstractListViewItemState . COMING_SOON : undefined ,
43
47
} ,
44
48
{
45
49
item : {
@@ -52,6 +56,7 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
52
56
} ,
53
57
url : `/${ context . subject } /a_level` ,
54
58
stage : LEARNING_STAGE . A_LEVEL ,
59
+ subject : context . subject ,
55
60
} ,
56
61
{
57
62
item : {
@@ -64,22 +69,9 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
64
69
} ,
65
70
url : `/${ context . subject } /university` ,
66
71
stage : LEARNING_STAGE . UNIVERSITY ,
72
+ subject : context . subject ,
67
73
} ,
68
- ] . map ( ( { stage, ...card } ) => ( PHY_NAV_SUBJECTS [ context . subject as Subject ] as readonly LearningStage [ ] ) ?. includes ( stage ) ? card : null ) ;
69
-
70
- if ( context . subject === "biology" ) {
71
- cards . push ( {
72
- item : {
73
- title : "GCSE (COMING SOON)" ,
74
- subtitle : `Our GCSE ${ humanSubject } resources develop the ${ humanSubject } knowledge needed at GCSE through the use of questions, concepts and books.`
75
- } ,
76
- className : "disabled" ,
77
- icon : {
78
- type : "img" as const ,
79
- icon : `/assets/phy/icons/redesign/subject-${ context . subject } .svg` ,
80
- }
81
- } ) ;
82
- }
74
+ ] . map ( ( { stage, ...card } ) => ( PHY_NAV_SUBJECTS [ context . subject as Subject ] as readonly LearningStage [ ] ) ?. includes ( stage ) || card . state === AbstractListViewItemState . COMING_SOON ? card : null ) ;
83
75
84
76
return < ListViewCards showBlanks = { above [ "lg" ] ( deviceSize ) } cards = { cards
85
77
. sort ( ( a , b ) => a ? ( b ? 0 : - 1 ) : 1 ) // put nulls at the end
0 commit comments