-
Notifications
You must be signed in to change notification settings - Fork 20
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
Refactor coding clubs page #17
Changes from 6 commits
a2d049a
071169a
3f919e5
a48fc75
6b72434
c4c0960
1dc2b8b
0e4ae90
519a6c5
51feedb
c70bf03
8bcc3f0
821e366
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { FC, ReactNode } from "react" | ||
import { | ||
type GridDirection, | ||
Stack, | ||
Typography, | ||
Unstable_Grid2 as Grid, | ||
} from "@mui/material" | ||
import type { ResponsiveStyleValue } from "@mui/system" | ||
|
||
import { Image } from "codeforlife/components" | ||
|
||
const Introduction: FC<{ | ||
header: string | ||
img: { alt: string; src: string } | ||
children: ReactNode | ||
direction?: ResponsiveStyleValue<GridDirection> | ||
}> = ({ header, img, children, direction = "row" }) => { | ||
return ( | ||
<> | ||
<Grid | ||
container | ||
spacing={{ xs: 2, lg: 3 }} | ||
display="flex" | ||
direction={direction} | ||
> | ||
<Grid xs={12} md={6}> | ||
<Stack sx={{ height: "100%" }}> | ||
<Typography variant="h5">{header}</Typography> | ||
{children} | ||
</Stack> | ||
</Grid> | ||
<Grid xs={12} md={6} className="flex-center"> | ||
<Image alt={img.alt} src={img.src} /> | ||
</Grid> | ||
</Grid> | ||
</> | ||
) | ||
} | ||
|
||
export default Introduction |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { type FC } from "react" | ||
import { Stack, Typography } from "@mui/material" | ||
|
||
const ClubAim: FC = () => { | ||
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. see other comment about exporting props |
||
return ( | ||
<> | ||
<Stack> | ||
<Typography variant="h4" textAlign="center"> | ||
Who are the club packs aimed at? | ||
</Typography> | ||
<Typography> | ||
The FREE resource packs are aimed at two different groups, the first | ||
is aimed at students ages between 7-11yrs with an interest in learning | ||
Python. The second pack is aimed at students 12yrs and up, including | ||
adults. This moves at a much faster pace and also introduces students | ||
to setting up an environment on their own computer. | ||
</Typography> | ||
<Typography mb={0}> | ||
Both packs are a condensed learning pathway using our game Rapid | ||
Router alongside suggested session plan and slides. | ||
</Typography> | ||
</Stack> | ||
</> | ||
) | ||
} | ||
|
||
export default ClubAim |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { type FC } from "react" | ||
import { Typography, useTheme } from "@mui/material" | ||
import { Download as DownloadIcon } from "@mui/icons-material" | ||
|
||
import * as page from "codeforlife/components/page" | ||
|
||
import CodeClubHeroImage from "../../images/coding_club_hero_hexagon.png" | ||
import AboutUsImage from "../../images/about_us.jpg" | ||
import PythonClubImage from "../../images/coding_club_python_pack.png" | ||
import Introduction from "../../components/Introduction" | ||
|
||
import ClubAim from "./ClubAim" | ||
import { Link, LinkButton } from "codeforlife/components/router" | ||
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. Sort imports. Unfortunately, prettiers import sorting works differently to isort in python (prettier's behaviour is worse IMO). Prettier sorts imports by group (not as a whole). The sort order I have been following so far is: // {default and 3rd party imports on top}
// space here
// {codeforlife imports in the middle}
// space here
// {relative imports on the bottom} If we want to change this order, we need to so everywhere. |
||
|
||
export interface CodingClubProps {} | ||
|
||
const CodingClubs: FC<CodingClubProps> = () => { | ||
const theme = useTheme() | ||
|
||
return ( | ||
<page.Page> | ||
<page.Banner | ||
imageProps={{ alt: "codeClubHero", src: CodeClubHeroImage }} | ||
header="Coding clubs" | ||
subheader="A FREE set of slides and guides to run your own coding clubs" | ||
/> | ||
<page.Section> | ||
<ClubAim /> | ||
</page.Section> | ||
<page.Section boxProps={{ bgcolor: theme.palette.info.main }}> | ||
<Introduction | ||
header="Primary coding club" | ||
img={{ alt: "aboutUs", src: AboutUsImage }} | ||
> | ||
<Typography> | ||
Download your FREE coding club pack for students aged 7-11. This | ||
pack introduces students to the first principles of Python at a | ||
faster pace than the regular lesson plans. It is aimed at students | ||
already interested in learning coding and can be used in clubs, at | ||
home or in school, on or offline. | ||
</Typography> | ||
<Typography> | ||
View the resources{" "} | ||
<Link | ||
to="https://code-for-life.gitbook.io/teaching-resources/v/code-club-resources-primary" | ||
target="_blank" | ||
> | ||
online here | ||
</Link> | ||
. | ||
</Typography> | ||
{/*TODO: Link to GTM for analytics*/} | ||
<LinkButton | ||
sx={{ marginTop: "auto" }} | ||
to="https://storage.googleapis.com/codeforlife-assets/club_packs/PrimaryCodingClub.zip" | ||
target="_blank" | ||
endIcon={<DownloadIcon />} | ||
> | ||
Download the Primary coding club pack | ||
</LinkButton> | ||
</Introduction> | ||
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. Make this a page component (like ) called . This will help readability - no single large components but components made of smaller components. Generally a good idea to make page sections a component. See home page as an example. |
||
</page.Section> | ||
<page.Section> | ||
<Introduction | ||
header="Python coding club" | ||
img={{ alt: "pythonCodingClub", src: PythonClubImage }} | ||
direction="row-reverse" | ||
> | ||
<Typography> | ||
Download your FREE coding club pack for students aged 12 and above. | ||
This pack is a fast paced introduction to Python. It is aimed at | ||
students already interested in learning coding, individuals looking | ||
to learn and run their own club, or adults wanting to try coding | ||
out. It is designed to be used in face-to-face or online clubs. | ||
</Typography> | ||
<Typography> | ||
View the resources{" "} | ||
<Link | ||
to="https://code-for-life.gitbook.io/teaching-resources/v/rapid-introduction-to-python-code-club" | ||
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. add an env variable starting with "VITE_LINK_". External links should be env vars so we don't need to redeploy if a link is updated. Then: import.meta.env.VITE_LINK_EXAMPLE |
||
target="_blank" | ||
> | ||
online here | ||
</Link> | ||
. | ||
</Typography> | ||
{/*TODO: Link to GTM for analytics*/} | ||
<LinkButton | ||
sx={{ marginTop: "auto" }} | ||
to="https://storage.googleapis.com/codeforlife-assets/club_packs/PythonCodingClub.zip" | ||
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. see above comment about making this an env var |
||
target="_blank" | ||
endIcon={<DownloadIcon />} | ||
> | ||
Download the Python coding club pack | ||
</LinkButton> | ||
</Introduction> | ||
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. Make this a page component (like ) called . This will help readability - no single large components but components made of smaller components. Generally a good idea to make page sections a component. See home page as an example. |
||
</page.Section> | ||
</page.Page> | ||
) | ||
} | ||
|
||
export default CodingClubs |
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.
see other comment about export props