diff --git a/.env b/.env index adb5a8f..0b55aa2 100644 --- a/.env +++ b/.env @@ -7,6 +7,11 @@ VITE_GMAIL_FILTERS_EMAIL_VERIFICATION="from:no-reply@info.codeforlife.education # Links to external sites. VITE_LINK_FEMALE_GRADUATES_IN_CS=https://www.wisecampaign.org.uk/core-stem-graduates-2019/ +VITE_LINK_OUTLOOK_HOME=https://outlook.live.com/mail/ +VITE_LINK_PRIMARY_PACK_GITBOOK=https://code-for-life.gitbook.io/teaching-resources/v/code-club-resources-primary +VITE_LINK_PRIMARY_PACK_DOWNLOAD=https://storage.googleapis.com/codeforlife-assets/club_packs/PrimaryCodingClub.zip +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 # TODO: determine which of these we need. # REACT_APP_CONTAINER_MAX_WIDTH=lg diff --git a/.eslintrc.json b/.eslintrc.json index 0045739..9e385b5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,6 +18,12 @@ "dist" ], "rules": { + "sort-imports": [ + "error", + { + "allowSeparatedGroups": true + } + ], "@typescript-eslint/consistent-type-imports": [ 2, { @@ -65,4 +71,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/App.tsx b/src/App.tsx index 27ec12f..8077447 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,8 @@ import { CssBaseline, ThemeProvider } from "@mui/material" import type { FC } from "react" -import theme from "./app/theme" import Router from "./router" +import theme from "./app/theme" const App: FC = () => { return ( diff --git a/src/api/authFactor.ts b/src/api/authFactor.ts index 6b61264..1aa6d05 100644 --- a/src/api/authFactor.ts +++ b/src/api/authFactor.ts @@ -1,15 +1,15 @@ import { + type AuthFactor, getReadAuthFactorEndpoints, urls, - type AuthFactor, } from "codeforlife/api" import { - buildUrl, - tagData, type CreateArg, type CreateResult, type DestroyArg, type DestroyResult, + buildUrl, + tagData, } from "codeforlife/utils/api" import api from "." diff --git a/src/api/klass.ts b/src/api/klass.ts index 2b2428a..34b95aa 100644 --- a/src/api/klass.ts +++ b/src/api/klass.ts @@ -1,13 +1,13 @@ -import { getReadClassEndpoints, urls, type Class } from "codeforlife/api" +import { type Class, getReadClassEndpoints, urls } from "codeforlife/api" import { - buildUrl, - tagData, type CreateArg, type CreateResult, type DestroyArg, type DestroyResult, type UpdateArg, type UpdateResult, + buildUrl, + tagData, } from "codeforlife/utils/api" import api from "." diff --git a/src/api/school.ts b/src/api/school.ts index 87e8ac2..809df17 100644 --- a/src/api/school.ts +++ b/src/api/school.ts @@ -1,12 +1,12 @@ -import { getReadSchoolEndpoints, urls, type School } from "codeforlife/api" import { - buildUrl, - tagData, type CreateArg, type CreateResult, type UpdateArg, type UpdateResult, + buildUrl, + tagData, } from "codeforlife/utils/api" +import { type School, getReadSchoolEndpoints, urls } from "codeforlife/api" import api from "." diff --git a/src/api/schoolTeacherInvitation.ts b/src/api/schoolTeacherInvitation.ts index 36a34e4..0dc87ce 100644 --- a/src/api/schoolTeacherInvitation.ts +++ b/src/api/schoolTeacherInvitation.ts @@ -1,7 +1,4 @@ -import { type User } from "codeforlife/api" import { - buildUrl, - tagData, type Arg, type CreateArg, type CreateResult, @@ -14,7 +11,10 @@ import { type RetrieveResult, type UpdateArg, type UpdateResult, + buildUrl, + tagData, } from "codeforlife/utils/api" +import { type User } from "codeforlife/api" import api from "." diff --git a/src/api/sso.ts b/src/api/sso.ts index 8ecd99d..6dd5b28 100644 --- a/src/api/sso.ts +++ b/src/api/sso.ts @@ -6,8 +6,8 @@ import { type Student, type User, } from "codeforlife/api" -import { type SessionMetadata } from "codeforlife/hooks" import { type Arg } from "codeforlife/utils/api" +import { type SessionMetadata } from "codeforlife/hooks" import api from "." diff --git a/src/api/student.ts b/src/api/student.ts index d74cb29..84f1fc8 100644 --- a/src/api/student.ts +++ b/src/api/student.ts @@ -1,6 +1,4 @@ -import { urls, type Student, type User } from "codeforlife/api" import { - tagData, type Arg, type BulkCreateArg, type BulkCreateResult, @@ -8,7 +6,9 @@ import { type BulkDestroyResult, type BulkUpdateArg, type BulkUpdateResult, + tagData, } from "codeforlife/utils/api" +import { type Student, type User, urls } from "codeforlife/api" import api from "." diff --git a/src/api/teacher.ts b/src/api/teacher.ts index ab228ce..313ea2f 100644 --- a/src/api/teacher.ts +++ b/src/api/teacher.ts @@ -1,14 +1,14 @@ -import { urls, type Teacher, type User } from "codeforlife/api" import { - buildUrl, - tagData, type Arg, type CreateResult, type DestroyArg, type DestroyResult, type UpdateArg, type UpdateResult, + buildUrl, + tagData, } from "codeforlife/utils/api" +import { type Teacher, type User, urls } from "codeforlife/api" import api from "." diff --git a/src/api/user.ts b/src/api/user.ts index a392a51..5f35757 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -1,7 +1,4 @@ -import { getReadUserEndpoints, urls, type User } from "codeforlife/api" import { - buildUrl, - tagData, type Arg, type CreateArg, type CreateResult, @@ -9,7 +6,10 @@ import { type DestroyResult, type UpdateArg, type UpdateResult, + buildUrl, + tagData, } from "codeforlife/utils/api" +import { type User, getReadUserEndpoints, urls } from "codeforlife/api" import api from "." diff --git a/src/app/hooks.ts b/src/app/hooks.ts index bc8990d..172beff 100644 --- a/src/app/hooks.ts +++ b/src/app/hooks.ts @@ -5,6 +5,7 @@ // for importing and re-exporting the typed versions of hooks. /* eslint-disable @typescript-eslint/no-restricted-imports */ import { useDispatch, useSelector } from "react-redux" + import type { AppDispatch, RootState } from "./store" // Use throughout your app instead of plain `useDispatch` and `useSelector` diff --git a/src/app/schemas.ts b/src/app/schemas.ts index 0f27d91..6a28ee7 100644 --- a/src/app/schemas.ts +++ b/src/app/schemas.ts @@ -1,5 +1,5 @@ +import { type Schema, type StringSchema, string as YupString } from "yup" import CryptoJS from "crypto-js" -import { string as YupString, type Schema, type StringSchema } from "yup" type Options = Partial<{ schema: S } & Extras> diff --git a/src/app/store.ts b/src/app/store.ts index 6435007..d4f570c 100644 --- a/src/app/store.ts +++ b/src/app/store.ts @@ -1,6 +1,5 @@ import type { Action, ThunkAction } from "@reduxjs/toolkit" import { combineSlices } from "@reduxjs/toolkit" - import { makeStore } from "codeforlife/utils/store" import api from "../api" diff --git a/src/app/theme.ts b/src/app/theme.ts index e0abe14..7f2f144 100644 --- a/src/app/theme.ts +++ b/src/app/theme.ts @@ -1,9 +1,8 @@ import { + type ThemeOptions, createTheme, responsiveFontSizes, - type ThemeOptions, } from "@mui/material" - import { themeOptions as cflThemeOptions } from "codeforlife/theme" // Unpack the base options to extend the theme diff --git a/src/components/Introduction.tsx b/src/components/Introduction.tsx new file mode 100644 index 0000000..a387a89 --- /dev/null +++ b/src/components/Introduction.tsx @@ -0,0 +1,46 @@ +import type { FC, ReactNode } from "react" +import { + Unstable_Grid2 as Grid, + type GridDirection, + Stack, + Typography, +} from "@mui/material" +import { Image } from "codeforlife/components" +import type { ResponsiveStyleValue } from "@mui/system" + +export interface IntroductionProps { + header: string + img: { alt: string; src: string } + children: ReactNode + direction?: ResponsiveStyleValue +} + +const Introduction: FC = ({ + header, + img, + children, + direction = "row", +}) => { + return ( + <> + + + + {header} + {children} + + + + {img.alt} + + + + ) +} + +export default Introduction diff --git a/src/components/OpenInEmailButtons.tsx b/src/components/OpenInEmailButtons.tsx index 2480862..9ead328 100644 --- a/src/components/OpenInEmailButtons.tsx +++ b/src/components/OpenInEmailButtons.tsx @@ -1,8 +1,7 @@ -import { MailOutline as MailOutlineIcon } from "@mui/icons-material" -import { Stack } from "@mui/material" import { type FC } from "react" - import { LinkButton } from "codeforlife/components/router" +import { MailOutline as MailOutlineIcon } from "@mui/icons-material" +import { Stack } from "@mui/material" export interface OpenInEmailButtonsProps { gmailFilters: string @@ -19,7 +18,7 @@ const OpenInEmailButtons: FC = ({ gmailFilters }) => { Open in Gmail } > diff --git a/src/components/form/LastNameField.tsx b/src/components/form/LastNameField.tsx index d93d313..610f6e7 100644 --- a/src/components/form/LastNameField.tsx +++ b/src/components/form/LastNameField.tsx @@ -1,8 +1,7 @@ +import { TextField, type TextFieldProps } from "codeforlife/components/form" import { type FC } from "react" import { string as YupString } from "yup" -import { TextField, type TextFieldProps } from "codeforlife/components/form" - export type LastNameFieldProps = Omit< TextFieldProps, "type" | "name" | "schema" diff --git a/src/images/about_us.jpg b/src/images/about_us.jpg new file mode 100644 index 0000000..f3b5bf4 Binary files /dev/null and b/src/images/about_us.jpg differ diff --git a/src/images/coding_club_hero_hexagon.png b/src/images/coding_club_hero_hexagon.png new file mode 100644 index 0000000..c919e88 Binary files /dev/null and b/src/images/coding_club_hero_hexagon.png differ diff --git a/src/images/coding_club_python_pack.png b/src/images/coding_club_python_pack.png new file mode 100644 index 0000000..c222ebb Binary files /dev/null and b/src/images/coding_club_python_pack.png differ diff --git a/src/main.tsx b/src/main.tsx index ef92ba8..20b13be 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,6 +1,6 @@ +import { Provider } from "react-redux" import React from "react" import { createRoot } from "react-dom/client" -import { Provider } from "react-redux" import App from "./App" import store from "./app/store" diff --git a/src/pages/codingClubs/ClubAim.tsx b/src/pages/codingClubs/ClubAim.tsx new file mode 100644 index 0000000..b4b89f9 --- /dev/null +++ b/src/pages/codingClubs/ClubAim.tsx @@ -0,0 +1,29 @@ +import { Stack, Typography } from "@mui/material" +import { type FC } from "react" + +export interface ClubAimProps {} + +const ClubAim: FC = () => { + return ( + <> + + + Who are the club packs aimed at? + + + 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. + + + Both packs are a condensed learning pathway using our game Rapid + Router alongside suggested session plan and slides. + + + + ) +} + +export default ClubAim diff --git a/src/pages/codingClubs/CodingClubs.tsx b/src/pages/codingClubs/CodingClubs.tsx new file mode 100644 index 0000000..ebcb7e0 --- /dev/null +++ b/src/pages/codingClubs/CodingClubs.tsx @@ -0,0 +1,35 @@ +import * as page from "codeforlife/components/page" +import { type FC } from "react" +import { useTheme } from "@mui/material" + +import ClubAim from "./ClubAim" +import CodeClubHeroImage from "../../images/coding_club_hero_hexagon.png" +import Primary from "./Primary" +import Python from "./Python" + +export interface CodingClubProps {} + +const CodingClubs: FC = () => { + const theme = useTheme() + + return ( + + + + + + + + + + + + + ) +} + +export default CodingClubs diff --git a/src/pages/codingClubs/Primary.tsx b/src/pages/codingClubs/Primary.tsx new file mode 100644 index 0000000..d1c382c --- /dev/null +++ b/src/pages/codingClubs/Primary.tsx @@ -0,0 +1,47 @@ +import { Link, LinkButton } from "codeforlife/components/router" +import { Download as DownloadIcon } from "@mui/icons-material" +import { type FC } from "react" +import { Typography } from "@mui/material" + +import AboutUsImage from "../../images/about_us.jpg" +import Introduction from "../../components/Introduction" + +export interface PrimaryProps {} + +const Primary: FC = () => { + return ( + + + 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. + + + View the resources{" "} + + online here + + . + + {/*TODO: Link to GTM for analytics*/} + } + > + Download the Primary coding club pack + + + ) +} + +export default Primary diff --git a/src/pages/codingClubs/Python.tsx b/src/pages/codingClubs/Python.tsx new file mode 100644 index 0000000..57faf7d --- /dev/null +++ b/src/pages/codingClubs/Python.tsx @@ -0,0 +1,51 @@ +import { Link, LinkButton } from "codeforlife/components/router" +import { Download as DownloadIcon } from "@mui/icons-material" +import { type FC } from "react" +import { Typography } from "@mui/material" + +import Introduction from "../../components/Introduction" +import PythonClubImage from "../../images/coding_club_python_pack.png" + +export interface PythonProps {} + +const Python: FC = () => { + return ( + + + 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. + + + View the resources{" "} + + online here + + . + + {/*TODO: Link to GTM for analytics*/} + } + > + Download the Python coding club pack + + + ) +} + +export default Python diff --git a/src/pages/emailVerification/EmailVerification.tsx b/src/pages/emailVerification/EmailVerification.tsx index 3506c74..208cbbd 100644 --- a/src/pages/emailVerification/EmailVerification.tsx +++ b/src/pages/emailVerification/EmailVerification.tsx @@ -1,16 +1,15 @@ +import * as page from "codeforlife/components/page" +import * as yup from "yup" +import { type FC, useEffect } from "react" import { Send as SendIcon, SentimentVeryDissatisfied as SentimentVeryDissatisfiedIcon, } from "@mui/icons-material" -import { type SvgIconProps } from "@mui/material" -import { type FC, useEffect } from "react" -import * as yup from "yup" - -import * as page from "codeforlife/components/page" import { useNavigate, useParams, useSearchParams } from "codeforlife/hooks" +import { type SvgIconProps } from "@mui/material" -import { paths } from "../../router" import Status from "./Status" +import { paths } from "../../router" export interface EmailVerificationProps {} diff --git a/src/pages/emailVerification/Status.tsx b/src/pages/emailVerification/Status.tsx index c795f69..90c6c47 100644 --- a/src/pages/emailVerification/Status.tsx +++ b/src/pages/emailVerification/Status.tsx @@ -1,15 +1,14 @@ -import { Stack, Typography } from "@mui/material" import { type FC, type ReactElement } from "react" - -import { Link } from "codeforlife/components/router" +import { Stack, Typography } from "@mui/material" import { ThemedBox, type ThemedBoxProps } from "codeforlife/theme" +import { Link } from "codeforlife/components/router" -import { themeOptions } from "../../app/theme" import { OpenInEmailButtons, type OpenInEmailButtonsProps, } from "../../components" import { paths } from "../../router" +import { themeOptions } from "../../app/theme" export interface StatusProps { userType: ThemedBoxProps["userType"] diff --git a/src/pages/home/AboutUs.tsx b/src/pages/home/AboutUs.tsx index c072598..c13223b 100644 --- a/src/pages/home/AboutUs.tsx +++ b/src/pages/home/AboutUs.tsx @@ -1,14 +1,13 @@ -import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" import { Unstable_Grid2 as Grid, Stack, Typography } from "@mui/material" +import { Link, LinkButton } from "codeforlife/components/router" +import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" import { type FC } from "react" - import { Image } from "codeforlife/components" -import { Link, LinkButton } from "codeforlife/components/router" import ControllerIcon from "../../images/icon_controller.png" -import TicketIcon from "../../images/icon_free.png" import GlobeIcon from "../../images/icon_globe.png" import PieChartIcon from "../../images/icon_piechart.png" +import TicketIcon from "../../images/icon_free.png" import { paths } from "../../router" const Column: FC<{ diff --git a/src/pages/home/CodingClubs.tsx b/src/pages/home/CodingClubs.tsx index 5d9dd0b..c8648ad 100644 --- a/src/pages/home/CodingClubs.tsx +++ b/src/pages/home/CodingClubs.tsx @@ -1,7 +1,6 @@ -import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" import { Stack, Typography } from "@mui/material" +import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" import { type FC } from "react" - import { LinkButton } from "codeforlife/components/router" import { paths } from "../../router" diff --git a/src/pages/home/Home.tsx b/src/pages/home/Home.tsx index 4218a45..58205e0 100644 --- a/src/pages/home/Home.tsx +++ b/src/pages/home/Home.tsx @@ -1,8 +1,7 @@ -import { useTheme } from "@mui/material" -import { type FC } from "react" - import * as page from "codeforlife/components/page" +import { type FC } from "react" import { useLocation } from "codeforlife/hooks" +import { useTheme } from "@mui/material" import AboutUs from "./AboutUs" import CodingClubs from "./CodingClubs" diff --git a/src/pages/home/Quotes.tsx b/src/pages/home/Quotes.tsx index 16728a2..4918d29 100644 --- a/src/pages/home/Quotes.tsx +++ b/src/pages/home/Quotes.tsx @@ -1,7 +1,6 @@ import { Unstable_Grid2 as Grid, Stack, Typography } from "@mui/material" -import { type FC } from "react" - import { Image, type ImageProps } from "codeforlife/components" +import { type FC } from "react" import { Link } from "codeforlife/components/router" import ReubenPhoto from "../../images/reuben.png" diff --git a/src/pages/home/TargetAudience.tsx b/src/pages/home/TargetAudience.tsx index c4ecaba..efbb44b 100644 --- a/src/pages/home/TargetAudience.tsx +++ b/src/pages/home/TargetAudience.tsx @@ -1,9 +1,8 @@ -import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" -import { Stack, type SxProps, Typography, useTheme } from "@mui/material" -import { type FC } from "react" - import { Image, type ImageProps, OrderedGrid } from "codeforlife/components" import { LinkButton, type LinkButtonProps } from "codeforlife/components/router" +import { Stack, type SxProps, Typography, useTheme } from "@mui/material" +import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" +import { type FC } from "react" import EducateImage from "../../images/dashboard_educate.png" import PlayImage from "../../images/dashboard_play.png" diff --git a/src/pages/login/BaseForm.tsx b/src/pages/login/BaseForm.tsx index eb516bf..9641356 100644 --- a/src/pages/login/BaseForm.tsx +++ b/src/pages/login/BaseForm.tsx @@ -1,8 +1,7 @@ -import { Stack, Typography, useTheme } from "@mui/material" -import { type FormikValues } from "formik" - import { Form, type FormProps } from "codeforlife/components/form" +import { Stack, Typography, useTheme } from "@mui/material" import { ThemedBox, type ThemedBoxProps } from "codeforlife/theme" +import { type FormikValues } from "formik" import { themeOptions } from "../../app/theme" diff --git a/src/pages/login/IndyForm.tsx b/src/pages/login/IndyForm.tsx index ef56d3b..64a004b 100644 --- a/src/pages/login/IndyForm.tsx +++ b/src/pages/login/IndyForm.tsx @@ -1,14 +1,13 @@ +import * as form from "codeforlife/components/form" import { Stack, Typography } from "@mui/material" import type { FC } from "react" - -import * as form from "codeforlife/components/form" import { Link } from "codeforlife/components/router" -import { useNavigate } from "codeforlife/hooks" import { submitForm } from "codeforlife/utils/form" +import { useNavigate } from "codeforlife/hooks" -import { useLoginWithEmailMutation } from "../../api/sso" -import { paths } from "../../router" import BaseForm from "./BaseForm" +import { paths } from "../../router" +import { useLoginWithEmailMutation } from "../../api/sso" export interface IndyFormProps {} diff --git a/src/pages/login/Login.tsx b/src/pages/login/Login.tsx index e34b79c..5336fae 100644 --- a/src/pages/login/Login.tsx +++ b/src/pages/login/Login.tsx @@ -1,17 +1,16 @@ -import { useEffect, type FC } from "react" -import * as yup from "yup" - import * as page from "codeforlife/components/page" +import * as yup from "yup" +import { type FC, useEffect } from "react" import { useNavigate, useSearchParams, useSessionMetadata, } from "codeforlife/hooks" -import { paths } from "../../router" -import IndyForm from "./IndyForm" import * as studentForms from "./studentForms" import * as teacherForms from "./teacherForms" +import IndyForm from "./IndyForm" +import { paths } from "../../router" export interface LoginProps { form: diff --git a/src/pages/login/studentForms/Class.tsx b/src/pages/login/studentForms/Class.tsx index a190ed7..2da2eba 100644 --- a/src/pages/login/studentForms/Class.tsx +++ b/src/pages/login/studentForms/Class.tsx @@ -1,16 +1,15 @@ -import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" -import { Stack, Typography } from "@mui/material" -import { useEffect, type FC } from "react" -import { generatePath } from "react-router-dom" -import * as yup from "yup" - import * as form from "codeforlife/components/form" +import * as yup from "yup" +import { type FC, useEffect } from "react" +import { Stack, Typography } from "@mui/material" import { useNavigate, useSearchParams } from "codeforlife/hooks" +import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" +import { generatePath } from "react-router-dom" -import { useAutoLoginAsStudentMutation } from "../../../api/sso" +import BaseForm from "../BaseForm" import { classIdSchema } from "../../../app/schemas" import { paths } from "../../../router" -import BaseForm from "../BaseForm" +import { useAutoLoginAsStudentMutation } from "../../../api/sso" export interface ClassProps {} diff --git a/src/pages/login/studentForms/FirstName.tsx b/src/pages/login/studentForms/FirstName.tsx index 0773cf7..1ced32f 100644 --- a/src/pages/login/studentForms/FirstName.tsx +++ b/src/pages/login/studentForms/FirstName.tsx @@ -1,15 +1,14 @@ -import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" -import { Stack } from "@mui/material" -import { useEffect, type FC } from "react" - import * as form from "codeforlife/components/form" +import { type FC, useEffect } from "react" import { useNavigate, useParams } from "codeforlife/hooks" +import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" +import { Stack } from "@mui/material" import { submitForm } from "codeforlife/utils/form" -import { useLoginAsStudentMutation } from "../../../api/sso" +import BaseForm from "../BaseForm" import { classIdSchema } from "../../../app/schemas" import { paths } from "../../../router" -import BaseForm from "../BaseForm" +import { useLoginAsStudentMutation } from "../../../api/sso" export interface FirstNameProps {} diff --git a/src/pages/login/teacherForms/Email.tsx b/src/pages/login/teacherForms/Email.tsx index 0e3d369..cc07121 100644 --- a/src/pages/login/teacherForms/Email.tsx +++ b/src/pages/login/teacherForms/Email.tsx @@ -1,14 +1,13 @@ +import * as form from "codeforlife/components/form" import { Stack, Typography } from "@mui/material" import type { FC } from "react" - -import * as form from "codeforlife/components/form" import { Link } from "codeforlife/components/router" -import { useNavigate } from "codeforlife/hooks" import { submitForm } from "codeforlife/utils/form" +import { useNavigate } from "codeforlife/hooks" -import { useLoginWithEmailMutation } from "../../../api/sso" -import { paths } from "../../../router" import BaseForm from "../BaseForm" +import { paths } from "../../../router" +import { useLoginWithEmailMutation } from "../../../api/sso" export interface EmailProps {} diff --git a/src/pages/login/teacherForms/Otp.tsx b/src/pages/login/teacherForms/Otp.tsx index 3f564dc..65dbd0a 100644 --- a/src/pages/login/teacherForms/Otp.tsx +++ b/src/pages/login/teacherForms/Otp.tsx @@ -1,14 +1,13 @@ -import { Stack } from "@mui/material" -import { type FC } from "react" - import * as form from "codeforlife/components/form" -import { LinkButton } from "codeforlife/components/router" import { useNavigate, useSession } from "codeforlife/hooks" +import { type FC } from "react" +import { LinkButton } from "codeforlife/components/router" +import { Stack } from "@mui/material" import { submitForm } from "codeforlife/utils/form" -import { useLoginWithOtpMutation } from "../../../api/sso" -import { paths } from "../../../router" import BaseForm from "../BaseForm" +import { paths } from "../../../router" +import { useLoginWithOtpMutation } from "../../../api/sso" export interface OtpProps {} diff --git a/src/pages/login/teacherForms/OtpBypassToken.tsx b/src/pages/login/teacherForms/OtpBypassToken.tsx index fcc5f91..61a3081 100644 --- a/src/pages/login/teacherForms/OtpBypassToken.tsx +++ b/src/pages/login/teacherForms/OtpBypassToken.tsx @@ -1,15 +1,14 @@ +import * as form from "codeforlife/components/form" +import * as yup from "yup" import { Stack, Typography, useTheme } from "@mui/material" +import { useNavigate, useSession } from "codeforlife/hooks" import type { FC } from "react" -import * as yup from "yup" - -import * as form from "codeforlife/components/form" import { LinkButton } from "codeforlife/components/router" -import { useNavigate, useSession } from "codeforlife/hooks" import { submitForm } from "codeforlife/utils/form" -import { useLoginWithOtpBypassTokenMutation } from "../../../api/sso" -import { paths } from "../../../router" import BaseForm from "../BaseForm" +import { paths } from "../../../router" +import { useLoginWithOtpBypassTokenMutation } from "../../../api/sso" export interface OtpBypassTokenProps {} diff --git a/src/pages/register/BaseForm.tsx b/src/pages/register/BaseForm.tsx index 205ee75..3c20dab 100644 --- a/src/pages/register/BaseForm.tsx +++ b/src/pages/register/BaseForm.tsx @@ -1,7 +1,6 @@ import { FormHelperText, Typography } from "@mui/material" -import { type FC } from "react" - import { ThemedBox, type ThemedBoxProps } from "codeforlife/theme" +import { type FC } from "react" import { themeOptions } from "../../app/theme" diff --git a/src/pages/register/IndyForm.tsx b/src/pages/register/IndyForm.tsx index 0aec760..e1a3efd 100644 --- a/src/pages/register/IndyForm.tsx +++ b/src/pages/register/IndyForm.tsx @@ -1,17 +1,16 @@ -import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" +import * as forms from "codeforlife/components/form" import { FormHelperText, Stack } from "@mui/material" -import dayjs from "dayjs" +import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" import { type FC } from "react" -import { useNavigate } from "react-router-dom" - -import * as forms from "codeforlife/components/form" import { Link } from "codeforlife/components/router" +import dayjs from "dayjs" import { submitForm } from "codeforlife/utils/form" +import { useNavigate } from "react-router-dom" -import { useCreateIndependentUserMutation } from "../../api/user" import { LastNameField, NewPasswordField } from "../../components/form" -import { paths } from "../../router" import BaseForm from "./BaseForm" +import { paths } from "../../router" +import { useCreateIndependentUserMutation } from "../../api/user" export interface IndyFormProps {} diff --git a/src/pages/register/Register.tsx b/src/pages/register/Register.tsx index 60a6cec..b3fd912 100644 --- a/src/pages/register/Register.tsx +++ b/src/pages/register/Register.tsx @@ -1,12 +1,11 @@ -import { Unstable_Grid2 as Grid } from "@mui/material" -import { type FC, useEffect } from "react" - import * as page from "codeforlife/components/page" +import { type FC, useEffect } from "react" import { useNavigate, useSessionMetadata } from "codeforlife/hooks" +import { Unstable_Grid2 as Grid } from "@mui/material" -import { paths } from "../../router" import IndyForm from "./IndyForm" import TeacherForm from "./TeacherForm" +import { paths } from "../../router" export interface RegisterProps {} diff --git a/src/pages/register/TeacherForm.tsx b/src/pages/register/TeacherForm.tsx index 60bfa80..147e8e3 100644 --- a/src/pages/register/TeacherForm.tsx +++ b/src/pages/register/TeacherForm.tsx @@ -1,16 +1,15 @@ +import * as form from "codeforlife/components/form" import { ChevronRight as ChevronRightIcon } from "@mui/icons-material" -import { Stack } from "@mui/material" import { type FC } from "react" - -import * as form from "codeforlife/components/form" import { Link } from "codeforlife/components/router" -import { useNavigate } from "codeforlife/hooks" +import { Stack } from "@mui/material" import { submitForm } from "codeforlife/utils/form" +import { useNavigate } from "codeforlife/hooks" -import { useCreateTeacherMutation } from "../../api/teacher" import { LastNameField, NewPasswordField } from "../../components/form" -import { paths } from "../../router" import BaseForm from "./BaseForm" +import { paths } from "../../router" +import { useCreateTeacherMutation } from "../../api/teacher" export interface TeacherFormProps {} diff --git a/src/pages/resetPassword/EmailForm.tsx b/src/pages/resetPassword/EmailForm.tsx index e1f3b68..fbb2d06 100644 --- a/src/pages/resetPassword/EmailForm.tsx +++ b/src/pages/resetPassword/EmailForm.tsx @@ -1,13 +1,12 @@ -import { Send as SendIcon } from "@mui/icons-material" -import { Stack, Typography } from "@mui/material" -import { type FC } from "react" - import * as form from "codeforlife/components/form" import { Link, LinkButton } from "codeforlife/components/router" +import { Stack, Typography } from "@mui/material" +import { type FC } from "react" +import { Send as SendIcon } from "@mui/icons-material" -import { useLazyRequestPasswordResetQuery } from "../../api/user" import { OpenInEmailButtons } from "../../components" import { paths } from "../../router" +import { useLazyRequestPasswordResetQuery } from "../../api/user" export interface EmailFormProps {} diff --git a/src/pages/resetPassword/PasswordForm.tsx b/src/pages/resetPassword/PasswordForm.tsx index 6cc9127..6c402c2 100644 --- a/src/pages/resetPassword/PasswordForm.tsx +++ b/src/pages/resetPassword/PasswordForm.tsx @@ -1,13 +1,12 @@ -import { CheckCircleOutline as CheckCircleOutlineIcon } from "@mui/icons-material" +import * as form from "codeforlife/components/form" import { Stack, Typography } from "@mui/material" +import { CheckCircleOutline as CheckCircleOutlineIcon } from "@mui/icons-material" import { type FC } from "react" - -import * as form from "codeforlife/components/form" import { LinkButton } from "codeforlife/components/router" -import { useResetPasswordMutation } from "../../api/user" import { NewPasswordField } from "../../components/form" import { paths } from "../../router" +import { useResetPasswordMutation } from "../../api/user" export interface PasswordFormProps { userType: "teacher" | "independent" diff --git a/src/pages/resetPassword/ResetPassword.tsx b/src/pages/resetPassword/ResetPassword.tsx index bf5a3c6..eef9615 100644 --- a/src/pages/resetPassword/ResetPassword.tsx +++ b/src/pages/resetPassword/ResetPassword.tsx @@ -1,14 +1,13 @@ -import { type FC, useEffect } from "react" -import * as yup from "yup" - import * as page from "codeforlife/components/page" +import * as yup from "yup" +import { type FC, useEffect } from "react" import { useNavigate, useParams } from "codeforlife/hooks" import { ThemedBox } from "codeforlife/theme" -import { themeOptions } from "../../app/theme" -import { paths } from "../../router" import EmailForm from "./EmailForm" import PasswordForm from "./PasswordForm" +import { paths } from "../../router" +import { themeOptions } from "../../app/theme" export interface ResetPasswordProps {} diff --git a/src/router/Router.tsx b/src/router/Router.tsx index d57ad93..a3552a1 100644 --- a/src/router/Router.tsx +++ b/src/router/Router.tsx @@ -1,5 +1,5 @@ -import type { FC } from "react" import { BrowserRouter, Routes } from "react-router-dom" +import type { FC } from "react" // import Header from '../../features/header/Header'; // import Footer from '../../features/footer/Footer'; diff --git a/src/router/routes/general.tsx b/src/router/routes/general.tsx index 3294bfc..40957c9 100644 --- a/src/router/routes/general.tsx +++ b/src/router/routes/general.tsx @@ -2,7 +2,7 @@ import { Route } from "react-router-dom" import Home from "../../pages/home/Home" // import AboutUs from '../../pages/aboutUs/AboutUs'; -// import CodingClubs from '../../pages/codingClubs/CodingClubs'; +import CodingClubs from "../../pages/codingClubs/CodingClubs" // import GetInvolved from '../../pages/getInvolved/GetInvolved'; // import Contribute from '../../pages/contribute/Contribute'; // import HomeLearning from '../../pages/homeLearning/HomeLearning'; @@ -18,7 +18,7 @@ const general = ( {/* } /> */} {/* } /> */} {/* } /> */} - {/* } /> */} + } /> {/* } /> */} ) diff --git a/vite.config.ts b/vite.config.ts index 01e6878..9d13bc6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ -import react from "@vitejs/plugin-react" import path from "path" + import { defineConfig } from "vitest/config" +import react from "@vitejs/plugin-react" // https://vitejs.dev/config/ export default defineConfig({