Skip to content

Commit

Permalink
Closes #220 - organization of the themes, was placed in their appropr…
Browse files Browse the repository at this point in the history
…iate folders.
  • Loading branch information
jandsonrj committed Jan 22, 2024
1 parent ed6fb58 commit 2170598
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 40 deletions.
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

0 comments on commit 2170598

Please sign in to comment.