Skip to content
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

fix: Portal frontend 6 #64

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/components/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@font-face {
font-family: "SpaceGrotesk";
src:
local("SpaceGrotesk"),
url("../fonts/SpaceGrotesk-VariableFont_wght.ttf") format("truetype");
}

@font-face {
font-family: "Inter";
src:
local("Inter"),
url("../fonts/Inter-VariableFont_slnt,wght.ttf") format("truetype");
}

html,
body {
box-sizing: border-box;
height: 100%;
padding: 0;
margin: 0;
}

#root {
box-sizing: border-box;
min-height: 100%;
display: flex;
flex-direction: column;
}

#header,
#footer {
flex-grow: 0;
flex-shrink: 0;
}

#body {
flex-grow: 1;
}
25 changes: 1 addition & 24 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Provider, type ProviderProps } from "react-redux"
import { BrowserRouter, Routes as RouterRoutes } from "react-router-dom"
import { type Action } from "redux"

import "./App.css"
import { InactiveDialog, ScreenTimeDialog } from "../features"
import { useCountdown, useEventListener, useLocation } from "../hooks"
// import "../scripts"
Expand Down Expand Up @@ -84,30 +85,6 @@ const App = <A extends Action = Action, S = unknown>({
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<style>{`
html, body {
box-sizing: border-box;
height: 100%;
padding: 0;
margin: 0;
}

#root {
box-sizing: border-box;
min-height: 100%;
display: flex;
flex-direction: column;
}

#header, #footer {
flex-grow: 0;
flex-shrink: 0;
}

#body {
flex-grow: 1;
}
`}</style>
<Provider store={store}>
<InactiveDialog open={isIdle} onClose={resetIdleSeconds} />
<ScreenTimeDialog
Expand Down
Binary file added src/fonts/Inter-VariableFont_slnt,wght.ttf
Binary file not shown.
Binary file added src/fonts/SpaceGrotesk-VariableFont_wght.ttf
Binary file not shown.
6 changes: 6 additions & 0 deletions src/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default interface Color {
50: string
}

// primary / teacher
export const primary: Color = {
900: "#A60039",
800: "#BE0947",
Expand All @@ -23,7 +24,9 @@ export const primary: Color = {
100: "#FF6699",
50: "#FF9ABC",
}
export { primary as teacher }

// secondary / indy
export const secondary: Color = {
900: "#BF9400",
800: "#CFA30B",
Expand All @@ -36,7 +39,9 @@ export const secondary: Color = {
100: "#FFE382",
50: "#FFEDAD",
}
export { secondary as indy }

// tertiary / student
export const tertiary: Color = {
900: "#01668C",
800: "#007FAF",
Expand All @@ -49,3 +54,4 @@ export const tertiary: Color = {
100: "#4DCEFF",
50: "#85DDFF",
}
export { tertiary as student }
66 changes: 36 additions & 30 deletions src/theme/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
createTheme,
type PaletteColor,
type PaletteOptions,
type PaletteColorOptions,
} from "@mui/material"
import { common, red } from "@mui/material/colors"

Expand All @@ -13,6 +14,9 @@ declare module "@mui/material/styles" {
tertiary: PaletteColor
white: PaletteColor
black: PaletteColor
teacher: PaletteColor
student: PaletteColor
indy: PaletteColor
}
interface Palette extends CustomPaletteColors {}
interface PaletteOptions extends CustomPaletteColors {}
Expand All @@ -22,6 +26,9 @@ export interface PropsColorOverrides {
tertiary: true
white: true
black: true
teacher: true
student: true
indy: true
}

declare module "@mui/material" {
Expand Down Expand Up @@ -57,37 +64,36 @@ const {
palette: { augmentColor },
} = createTheme()

const teacher: PaletteColorOptions = {
main: primary[500],
contrastText: common.white,
}

const student: PaletteColorOptions = {
main: tertiary[500],
contrastText: common.white,
}

const indy: PaletteColorOptions = {
main: secondary[500],
contrastText: common.black,
}

const palette: PaletteOptions = {
primary: {
main: primary[500],
contrastText: common.white,
},
secondary: {
main: secondary[500],
contrastText: common.black,
},
tertiary: augmentColor({
color: {
main: tertiary[500],
contrastText: common.white,
},
}),
white: augmentColor({
color: {
main: common.white,
},
}),
black: augmentColor({
color: {
main: common.black,
},
}),
info: {
main: "#f1ecec",
},
error: {
main: red.A700,
},
// primary / teacher
primary: teacher,
teacher: augmentColor({ color: teacher }),
// secondary / indy
secondary: indy,
indy: augmentColor({ color: indy }),
// tertiary / student
tertiary: augmentColor({ color: student }),
student: augmentColor({ color: student }),
// other
white: augmentColor({ color: { main: common.white } }),
black: augmentColor({ color: { main: common.black } }),
info: { main: "#f1ecec" },
error: { main: red.A700 },
}

export default palette