This commit is contained in:
Daniel Shleifman
2021-06-21 00:38:58 +03:00
parent 033aa3153f
commit 57cbac38c9
5 changed files with 17 additions and 10 deletions

View File

@@ -12,11 +12,11 @@ import ListItemText from '@material-ui/core/ListItemText'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { echoHost } from 'utils/Hosts' import { echoHost } from 'utils/Hosts'
import { ThemeProvider } from '@material-ui/core/styles' import { ThemeProvider } from '@material-ui/core/styles'
import { themeColors } from 'style/colors' import { mainColors } from 'style/colors'
import { lightTheme } from '../style/materialUISetup' import { lightTheme } from '../style/materialUISetup'
const { primary } = themeColors const { primary } = mainColors
export default function AboutDialog() { export default function AboutDialog() {
const { t } = useTranslation() const { t } = useTranslation()

View File

@@ -1,4 +1,4 @@
import { themeColors } from 'style/colors' import { mainColors } from 'style/colors'
export const snakeSettings = { export const snakeSettings = {
default: { default: {
@@ -6,7 +6,7 @@ export const snakeSettings = {
pieceSize: 14, pieceSize: 14,
gapBetweenPieces: 3, gapBetweenPieces: 3,
borderColor: '#dbf2e8', borderColor: '#dbf2e8',
completeColor: themeColors.primary, completeColor: mainColors.primary,
backgroundColor: '#fff', backgroundColor: '#fff',
progressColor: '#b3dfc9', progressColor: '#b3dfc9',
readerColor: '#000', readerColor: '#000',

View File

@@ -1,6 +1,6 @@
import { useState } from 'react' import { useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { themeColors } from 'style/colors' import { mainColors } from 'style/colors'
import AddDialog from '../Add/AddDialog' import AddDialog from '../Add/AddDialog'
import IconWrapper from './style' import IconWrapper from './style'
@@ -17,7 +17,7 @@ export default function AddFirstTorrent() {
<lord-icon <lord-icon
src='https://cdn.lordicon.com/bbnkwdur.json' src='https://cdn.lordicon.com/bbnkwdur.json'
trigger='loop' trigger='loop'
colors={`primary:#121331,secondary:${themeColors.primary}`} colors={`primary:#121331,secondary:${mainColors.primary}`}
stroke='26' stroke='26'
scale='60' scale='60'
/> />

View File

@@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { themeColors } from 'style/colors' import { mainColors } from 'style/colors'
import IconWrapper from './style' import IconWrapper from './style'
@@ -11,7 +11,7 @@ export default function NoServerConnection() {
<lord-icon <lord-icon
src='https://cdn.lordicon.com/wrprwmwt.json' src='https://cdn.lordicon.com/wrprwmwt.json'
trigger='loop' trigger='loop'
colors={`primary:#121331,secondary:${themeColors.primary}`} colors={`primary:#121331,secondary:${mainColors.primary}`}
stroke='26' stroke='26'
scale='60' scale='60'
/> />

View File

@@ -4,17 +4,24 @@ import { useMemo } from 'react'
import { mainColors } from './colors' import { mainColors } from './colors'
const primary = { main: mainColors.primary }
const typography = { fontFamily: 'Open Sans, sans-serif' }
// https://material-ui.com/ru/customization/default-theme/ // https://material-ui.com/ru/customization/default-theme/
export const darkTheme = createMuiTheme({ export const darkTheme = createMuiTheme({
typography,
palette: { palette: {
type: 'dark', type: 'dark',
background: { paper: '#575757' }, background: { paper: '#575757' },
primary,
}, },
}) })
export const lightTheme = createMuiTheme({ export const lightTheme = createMuiTheme({
typography,
palette: { palette: {
type: 'light', type: 'light',
background: { paper: '#f1f1f1' }, background: { paper: '#f1f1f1' },
primary,
}, },
}) })
@@ -24,11 +31,11 @@ export const useMaterialUITheme = () => {
const muiTheme = useMemo( const muiTheme = useMemo(
() => () =>
createMuiTheme({ createMuiTheme({
typography,
palette: { palette: {
type: isDarkMode ? 'dark' : 'light', type: isDarkMode ? 'dark' : 'light',
primary: { main: mainColors.primary }, primary,
}, },
typography: { fontFamily: 'Open Sans, sans-serif' },
}), }),
[isDarkMode], [isDarkMode],
) )