-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(curriculum): update curriculum (#11426)
* feat(curriculum): update curriculum
- Loading branch information
Showing
27 changed files
with
705 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
.../public/assets/curriculum/curriculum-partner-banner-illustration-large-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...public/assets/curriculum/curriculum-partner-banner-illustration-large-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions
8
client/src/assets/icons/curriculum-partner-underline-large.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
client/src/assets/icons/curriculum-partner-underline-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { HydrationData } from "../../../libs/types/hydration"; | ||
import { CurriculumDoc } from "../../../libs/types/curriculum"; | ||
import { topic2css, useCurriculumDoc } from "./utils"; | ||
import { RenderCurriculumBody } from "./body"; | ||
import { CurriculumLayout } from "./layout"; | ||
|
||
import "./index.scss"; | ||
|
||
export function CurriculumDefault(props: HydrationData<any, CurriculumDoc>) { | ||
const doc = useCurriculumDoc(props); | ||
const [coloredTitle, ...restTitle] = doc?.title?.split(" ") || []; | ||
return ( | ||
<CurriculumLayout | ||
doc={doc} | ||
extraClasses={["curriculum-module", `topic-${topic2css(doc?.topic)}`]} | ||
> | ||
<header> | ||
<h1> | ||
<span>{coloredTitle}</span> {restTitle.join(" ")} | ||
</h1> | ||
</header> | ||
<RenderCurriculumBody doc={doc} /> | ||
</CurriculumLayout> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
import { Route, Routes } from "react-router-dom"; | ||
|
||
import { HydrationData } from "../../../libs/types/hydration"; | ||
import { CurriculumModuleOverview } from "./overview"; | ||
import { CurriculumOverview } from "./overview"; | ||
import { CurriculumModule } from "./module"; | ||
import { CurriculumAbout } from "./about"; | ||
import { CurriculumLanding } from "./landing"; | ||
|
||
import "./index.scss"; | ||
import { CurriculumData, CurriculumDoc } from "../../../libs/types/curriculum"; | ||
import { Template, useCurriculumDoc } from "./utils"; | ||
import { CurriculumDefault } from "./default"; | ||
|
||
export function Curriculum(appProps: HydrationData) { | ||
return ( | ||
<Routes> | ||
<Route path="/" element={<CurriculumLanding {...appProps} />} /> | ||
<Route | ||
path="/about-curriculum/" | ||
element={<CurriculumAbout {...appProps} />} | ||
/> | ||
<Route | ||
path="/:module/" | ||
element={<CurriculumModuleOverview {...appProps} />} | ||
/> | ||
<Route path="/:module/*" element={<CurriculumModule {...appProps} />} /> | ||
</Routes> | ||
); | ||
export function Curriculum(appProps: HydrationData<any, CurriculumDoc>) { | ||
const doc = useCurriculumDoc(appProps as CurriculumData); | ||
switch (doc?.template) { | ||
case Template.Landing: | ||
return <CurriculumLanding {...appProps} />; | ||
case Template.Overview: | ||
return <CurriculumOverview {...appProps} />; | ||
case Template.Module: | ||
return <CurriculumModule {...appProps} />; | ||
case Template.About: | ||
return <CurriculumAbout {...appProps} />; | ||
case Template.Default: | ||
default: | ||
return <CurriculumDefault {...appProps} />; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.