diff --git a/.env b/.env index 90bddb6..0a4ed7d 100644 --- a/.env +++ b/.env @@ -22,18 +22,10 @@ VITE_LINK_PRIMARY_PACK_DOWNLOAD=https://storage.googleapis.com/codeforlife-asset VITE_LINK_PYTHON_PACK_GITBOOK=https://code-for-life.gitbook.io/teaching-resources/v/rapid-introduction-to-python-code-club VITE_LINK_PYTHON_PACK_DOWNLOAD=https://storage.googleapis.com/codeforlife-assets/club_packs/PythonCodingClub.zip VITE_LINK_IMPACT_REPORT_2023=https://storage.googleapis.com/codeforlife-assets/impact_reports/impact_report_2023.pdf +VITE_LINK_IDEAS_BOX=https://docs.google.com/forms/d/e/1FAIpQLSclasSZCb7s26Yax3KZuXIFhLjMhGK591WPvht0BkfjSiQR1w/viewform +VITE_LINK_HOME_LEARNING_BEGINNER=https://code-for-life.gitbook.io/independent-student-resources/rapid-router-resources/beginner +VITE_LINK_HOME_LEARNING_INTERMEDIATE=https://code-for-life.gitbook.io/independent-student-resources/rapid-router-resources/intermediate +VITE_LINK_HOME_LEARNING_ADVANCED=https://code-for-life.gitbook.io/independent-student-resources/rapid-router-resources/advanced -# TODO: determine which of these we need. +# TODO: determine if this is needed. # REACT_APP_CONTAINER_MAX_WIDTH=lg -# REACT_APP_IDEAS_BOX_HREF=https://docs.google.com/forms/d/e/1FAIpQLSclasSZCb7s26Yax3KZuXIFhLjMhGK591WPvht0BkfjSiQR1w/viewform -# REACT_APP_INDEPENDENT_BEGINNER_HREF=https://code-for-life.gitbook.io/independent-student-resources/beginner/ -# REACT_APP_INDEPENDENT_INTERMEDIATE_HREF=https://code-for-life.gitbook.io/independent-student-resources/intermediate/ -# REACT_APP_INDEPENDENT_ADVANCED_HREF=https://code-for-life.gitbook.io/independent-student-resources/advanced/ -# REACT_APP_API_BASE_URL=http://localhost:8000/api/ -# REACT_APP_RAPID_ROUTER_YOUTUBE_VIDEO_SRC=https://www.youtube-nocookie.com/embed/w0Pw_XikQSs -# REACT_APP_BLOCKLY_GUIDE_SRC=https://docs.codeforlife.education/rapid-router/blockly-guide -# REACT_APP_TEACHER_RESOURCES_YOUTUBE_VIDEO_SRC=https://www.youtube-nocookie.com/embed/tM5nKPYlz74 -# REACT_APP_RR_FOR_TEACHER_YOUTUBE_VIDEO_SRC=https://www.youtube-nocookie.com/embed/hv0fM0twrOE -# REACT_APP_INTRO_TO_CODING_ENGLAND=https://code-for-life.gitbook.io/teaching-resources/rapid-router-resources/introduction-to-coding-england -# REACT_APP_INTRO_TO_CODING_SCOTLAND=https://code-for-life.gitbook.io/teaching-resources/rapid-router-resources/introduction-to-coding-scotland -# REACT_APP_RR_TEACHING_RESOURCE=https://code-for-life.gitbook.io/teaching-resources/rapid-router-resources/welcome-to-rapid-router diff --git a/package.json b/package.json index 8e2bf89..557c4e8 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "✅ Do add `devDependencies` below that are `peerDependencies` in the CFL package." ], "dependencies": { - "codeforlife": "github:ocadotechnology/codeforlife-package-javascript#v2.3.8", + "codeforlife": "github:ocadotechnology/codeforlife-package-javascript#v2.3.10", "crypto-js": "^4.2.0" }, "devDependencies": { diff --git a/src/app/env.ts b/src/app/env.ts index 65c0313..cfa8eaa 100644 --- a/src/app/env.ts +++ b/src/app/env.ts @@ -24,3 +24,8 @@ export const LINK_PRIMARY_PACK_DOWNLOAD = env.VITE_LINK_PRIMARY_PACK_DOWNLOAD export const LINK_PYTHON_PACK_GITBOOK = env.VITE_LINK_PYTHON_PACK_GITBOOK export const LINK_PYTHON_PACK_DOWNLOAD = env.VITE_LINK_PYTHON_PACK_DOWNLOAD export const LINK_IMPACT_REPORT_2023 = env.VITE_LINK_IMPACT_REPORT_2023 +export const LINK_IDEAS_BOX = env.VITE_LINK_IDEAS_BOX +export const LINK_HOME_LEARNING_BEGINNER = env.VITE_LINK_HOME_LEARNING_BEGINNER +export const LINK_HOME_LEARNING_INTERMEDIATE = + env.VITE_LINK_HOME_LEARNING_INTERMEDIATE +export const LINK_HOME_LEARNING_ADVANCED = env.VITE_LINK_HOME_LEARNING_ADVANCED diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 25d7821..daeaa1d 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -1,7 +1,4 @@ -import { type AnchorHTMLAttributes, type FC } from "react" import { - Button, - type ButtonProps, CardActions, CardContent, CardMedia, @@ -10,25 +7,34 @@ import { type CardProps as MuiCardProps, Typography, } from "@mui/material" +import { LinkButton, type LinkButtonProps } from "codeforlife/components/router" -export interface CardProps extends MuiCardProps { +export type CardProps< + Override extends "delta" | "to", + State extends Record = Record, +> = MuiCardProps & { title: string description: string mediaProps: { image: NonNullable title: NonNullable } - buttonProps: ButtonProps & AnchorHTMLAttributes + linkButtonProps: LinkButtonProps } -const Card: FC = ({ +const Card: { + (props: CardProps<"delta">): JSX.Element + = Record>( + props: CardProps<"to", State>, + ): JSX.Element +} = ({ title, description, mediaProps, - buttonProps, + linkButtonProps, style, ...otherCardProps -}) => { +}: CardProps<"delta"> | CardProps<"to">) => { return ( = ({ {description} -