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

Closes #220 - organization of the themes. #221

Merged
merged 1 commit into from
Jan 25, 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
21 changes: 4 additions & 17 deletions frontend/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import CssBaseline from '@mui/material/CssBaseline'
import { ThemeProvider, createTheme } from '@mui/material/styles'
import { ThemeProvider } from '@mui/material/styles'
import Head from 'next/head'
import { useRouter } from 'next/router'
import PropTypes from 'prop-types'
import { useEffect, useState } from 'react'
import { QueryClient, QueryClientProvider } from 'react-query'
import Footer from '../components/Footer'
import { AuthProvider } from '../contexts/AuthContext'
import lightTheme from '../themes/light'
import darkTheme from '../themes/dark'
import '../styles/global.css'
import Header from '../components/Header'

Expand All @@ -29,21 +31,6 @@ export default function MyApp(props) {
}
}, [])

const light = createTheme({
palette: {
mode: 'light',
background: {
default: '#f1f1f1'
}
}
})

const dark = createTheme({
palette: {
mode: 'dark'
}
})

return (
<>
<Head>
Expand All @@ -54,7 +41,7 @@ export default function MyApp(props) {
/>
</Head>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={darkMode ? dark : light}>
<ThemeProvider theme={darkMode ? darkTheme : lightTheme}>
<CssBaseline />
<div
style={{
Expand Down
9 changes: 9 additions & 0 deletions frontend/themes/dark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createTheme } from '@mui/material/styles'

const darkTheme = createTheme({
palette: {
mode: 'dark',
},
})

export default darkTheme
28 changes: 5 additions & 23 deletions frontend/themes/light.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
import { createTheme } from '@mui/material/styles'

const light = createTheme({
const lightTheme = createTheme({
palette: {
primary: {
light: '#4f5964',
main: '#283663',
dark: '#24292e'
},
secondary: {
main: '#ffdd00'
},
success: {
main: '#4caf50'
},
error: {
main: '#ca2c0c'
},
mode: 'light',
background: {
default: '#f5f5f5'
default: '#f1f1f1',
},
text: {
primary: 'rgba(18,48,78,0.87)',
secondary: 'rgba(18,48,78,0.6)',
disabled: 'rgba(18,48,78,0.38)'
}
}
},
})

export default light
export default lightTheme
Loading