Skip to content

Commit a900e72

Browse files
committed
Reconfigure GCSE Biology to use coming_soon state
1 parent e4a3e52 commit a900e72

File tree

2 files changed

+12
-39
lines changed

2 files changed

+12
-39
lines changed

src/app/components/pages/SubjectOverviewPage.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { PageContextState, ShortcutResponse } from "../../../IsaacAppTypes";
88
import { ListView, ListViewCardProps, ListViewCards } from "../elements/list-groups/ListView";
99
import { LandingPageFooter } from "./SubjectLandingPage";
1010
import { DifficultyIcon } from "../elements/svg/DifficultyIcons";
11+
import { AbstractListViewItemState } from "../elements/list-groups/AbstractListViewItem";
1112

1213
const SubjectCards = ({context}: { context: PageContextState }) => {
1314
const deviceSize = useDeviceSize();
@@ -28,6 +29,7 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
2829
},
2930
url: `/${context.subject}/11_14`,
3031
stage: LEARNING_STAGE["11_TO_14"],
32+
subject: context.subject,
3133
},
3234
{
3335
item: {
@@ -40,6 +42,8 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
4042
},
4143
url: `/${context.subject}/gcse`,
4244
stage: LEARNING_STAGE.GCSE,
45+
subject: context.subject,
46+
state: context.subject === "biology" ? AbstractListViewItemState.COMING_SOON : undefined,
4347
},
4448
{
4549
item: {
@@ -52,6 +56,7 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
5256
},
5357
url: `/${context.subject}/a_level`,
5458
stage: LEARNING_STAGE.A_LEVEL,
59+
subject: context.subject,
5560
},
5661
{
5762
item: {
@@ -64,22 +69,9 @@ const SubjectCards = ({context}: { context: PageContextState }) => {
6469
},
6570
url: `/${context.subject}/university`,
6671
stage: LEARNING_STAGE.UNIVERSITY,
72+
subject: context.subject,
6773
},
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);
8375

8476
return <ListViewCards showBlanks={above["lg"](deviceSize)} cards={cards
8577
.sort((a, b) => a ? (b ? 0 : -1) : 1) // put nulls at the end

src/scss/phy/list-groups.scss

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,13 @@
2424
border-radius: 0;
2525
background-color: transparent;
2626

27-
&.disabled {
28-
background-color: $color-neutral-200;
29-
}
30-
3127
@include media-breakpoint-down(lg) {
3228
&:not(:last-child) {
3329
border-bottom: 1px solid var(--border-light);
3430
}
3531
&:not(:first-child) {
3632
border-top: 1px solid var(--border-light);
3733
}
38-
&:nth-child(1) {
39-
border-top-left-radius: inherit;
40-
border-top-right-radius: inherit;
41-
}
42-
&:nth-last-child(1) {
43-
border-bottom-left-radius: inherit;
44-
border-bottom-right-radius: inherit;
45-
}
4634
}
4735

4836
@include media-breakpoint-up(lg) {
@@ -58,18 +46,6 @@
5846
&:nth-last-child(n+3) {
5947
border-bottom: 1px solid var(--border-light);
6048
}
61-
&:nth-child(1) {
62-
border-top-left-radius: inherit;
63-
}
64-
&:nth-child(2) {
65-
border-top-right-radius: inherit;
66-
}
67-
&:nth-last-child(2) {
68-
border-bottom-left-radius: inherit;
69-
}
70-
&:nth-last-child(1) {
71-
border-bottom-right-radius: inherit;
72-
}
7349
}
7450
}
7551
}
@@ -171,4 +147,9 @@
171147
margin-left: 0.5rem;
172148
}
173149
}
150+
151+
img {
152+
// For items that use images rather than icons (e.g. subject logos), to remove the need to include a seperate greyscale image
153+
filter: grayscale(100%);
154+
}
174155
}

0 commit comments

Comments
 (0)