refactor: extract themes to their own folder

This commit is contained in:
Deluan 2020-03-31 09:05:46 -04:00
parent 1e0a79ebb7
commit 500207f7b8
7 changed files with 46 additions and 43 deletions

View File

@ -4,7 +4,8 @@ import dataProvider from './dataProvider'
import authProvider from './authProvider'
import polyglotI18nProvider from 'ra-i18n-polyglot'
import messages from './i18n'
import { DarkTheme, Layout, Login } from './layout'
import { Layout, Login } from './layout'
import { DarkTheme } from './themes'
import transcoding from './transcoding'
import player from './player'
import user from './user'

View File

@ -14,7 +14,7 @@ import LockIcon from '@material-ui/icons/Lock'
import { Notification, useLogin, useNotify, useTranslate } from 'react-admin'
import { LightTheme } from './Themes'
import { LightTheme } from '../themes'
const useStyles = makeStyles((theme) => ({
main: {

View File

@ -1,39 +0,0 @@
import blue from '@material-ui/core/colors/blue'
export const DarkTheme = {
palette: {
primary: {
main: '#90caf9'
},
secondary: blue,
type: 'dark'
},
overrides: {
MuiFormGroup: {
root: {
color: 'white'
}
}
}
}
export const LightTheme = {
palette: {
secondary: {
light: '#5f5fc4',
main: '#283593',
dark: '#001064',
contrastText: '#fff'
}
},
overrides: {
MuiFilledInput: {
root: {
backgroundColor: 'rgba(0, 0, 0, 0.04)',
'&$disabled': {
backgroundColor: 'rgba(0, 0, 0, 0.04)'
}
}
}
}
}

View File

@ -1,5 +1,4 @@
import Login from './Login'
import Layout from './Layout'
import { DarkTheme, LightTheme } from './Themes'
export { Layout, Login, DarkTheme, LightTheme }
export { Layout, Login }

18
ui/src/themes/dark.js Normal file
View File

@ -0,0 +1,18 @@
import blue from '@material-ui/core/colors/blue'
export default {
palette: {
primary: {
main: '#90caf9'
},
secondary: blue,
type: 'dark'
},
overrides: {
MuiFormGroup: {
root: {
color: 'white'
}
}
}
}

4
ui/src/themes/index.js Normal file
View File

@ -0,0 +1,4 @@
import LightTheme from './light'
import DarkTheme from './dark'
export { LightTheme, DarkTheme }

20
ui/src/themes/light.js Normal file
View File

@ -0,0 +1,20 @@
export default {
palette: {
secondary: {
light: '#5f5fc4',
main: '#283593',
dark: '#001064',
contrastText: '#fff'
}
},
overrides: {
MuiFilledInput: {
root: {
backgroundColor: 'rgba(0, 0, 0, 0.04)',
'&$disabled': {
backgroundColor: 'rgba(0, 0, 0, 0.04)'
}
}
}
}
}