-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(curriculum): update curriculum #11426
Changes from 28 commits
a2beace
fff59b3
425d548
ab9dfc5
a2db54a
805e69c
6471198
fd591c2
764d1e9
4c48beb
1fe6271
9296b30
2bf7f41
200fc3c
0b54995
85069c3
20d0f3b
d0d80e4
e5bf70a
0103c0e
ac0f099
969b315
d7b87ca
82960de
fa199ff
d21adbe
21e391e
7ef1a41
2e6e0cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has this image already been optimized with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: It would be better to name these |
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> | ||
); | ||
} |
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} />; | ||
fiji-flo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the SVGs, including this one, have not been optimized with svgo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is human authored SVG and svgo makes it un(less)readable. We might want to add svgo into the build pipeline at some point.