Skip to content

🎧 Your Personal Streaming Service

refactor: extract themes to their own folder

Deluan500207f7b8ca
diff --git a/ui/src/App.js b/ui/src/App.js
index 7643d98c1..6a8a466a0 100644
--- a/ui/src/App.js
+++ b/ui/src/App.js
@@ -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'
diff --git a/ui/src/layout/Login.js b/ui/src/layout/Login.js
index 873e5a688..d76fef825 100644
--- a/ui/src/layout/Login.js
+++ b/ui/src/layout/Login.js
@@ -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: {
diff --git a/ui/src/layout/Themes.js b/ui/src/layout/Themes.js
index 18a861f58..e69de29bb 100644
--- a/ui/src/layout/Themes.js
+++ b/ui/src/layout/Themes.js
@@ -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)'
- }
- }
- }
- }
-}
diff --git a/ui/src/layout/index.js b/ui/src/layout/index.js
index fcb2b8517..ebfb0760a 100644
--- a/ui/src/layout/index.js
+++ b/ui/src/layout/index.js
@@ -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 }
diff --git a/ui/src/themes/dark.js b/ui/src/themes/dark.js
new file mode 100644
index 000000000..ed7f4a404
--- /dev/null
+++ b/ui/src/themes/dark.js
@@ -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'
+ }
+ }
+ }
+}
diff --git a/ui/src/themes/index.js b/ui/src/themes/index.js
new file mode 100644
index 000000000..bb9812739
--- /dev/null
+++ b/ui/src/themes/index.js
@@ -0,0 +1,4 @@
+import LightTheme from './light'
+import DarkTheme from './dark'
+
+export { LightTheme, DarkTheme }
diff --git a/ui/src/themes/light.js b/ui/src/themes/light.js
new file mode 100644
index 000000000..a4a99b0f2
--- /dev/null
+++ b/ui/src/themes/light.js
@@ -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)'
+ }
+ }
+ }
+ }
+}