use dark bar with light dialogs

This commit is contained in:
nikk gitanes
2021-06-17 20:29:21 +03:00
parent f62d8cc709
commit 5f543b4738
6 changed files with 287 additions and 273 deletions

View File

@@ -11,6 +11,8 @@ import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText' 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 { lightTheme } from 'components/App'
export default function AboutDialog() { export default function AboutDialog() {
const { t } = useTranslation() const { t } = useTranslation()
@@ -29,13 +31,8 @@ export default function AboutDialog() {
<ListItemText primary={t('About')} /> <ListItemText primary={t('About')} />
</ListItem> </ListItem>
<Dialog <ThemeProvider theme={lightTheme}>
open={open} <Dialog open={open} onClose={() => setOpen(false)} aria-labelledby='form-dialog-title' fullWidth maxWidth='sm'>
onClose={() => setOpen(false)}
aria-labelledby='form-dialog-title'
fullWidth
maxWidth='sm'
>
<DialogTitle id='form-dialog-title'>{t('About')}</DialogTitle> <DialogTitle id='form-dialog-title'>{t('About')}</DialogTitle>
<DialogContent> <DialogContent>
@@ -82,6 +79,7 @@ export default function AboutDialog() {
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</ThemeProvider>
</div> </div>
) )
} }

View File

@@ -270,7 +270,11 @@ export default function AddDialog({
onClick={handleSave} onClick={handleSave}
color='primary' color='primary'
> >
{isLoadingButton ? <CircularProgress style={{ color: 'white' }} size={20} /> : t(isEditMode ? 'Save' : 'Add')} {isLoadingButton ? (
<CircularProgress style={{ color: 'white' }} size={20} />
) : (
t(isEditMode ? 'Save' : 'Add' )
)}
</Button> </Button>
</ButtonWrapper> </ButtonWrapper>
</Dialog> </Dialog>

View File

@@ -30,7 +30,7 @@ export const lightTheme = createMuiTheme({
palette: { palette: {
type: 'light', type: 'light',
primary: { main: '#00a572' }, primary: { main: '#00a572' },
background: { paper: '#cbe8d9' }, background: { paper: '#f1f1f1' },
}, },
typography: { fontFamily: 'Open Sans, sans-serif' }, typography: { fontFamily: 'Open Sans, sans-serif' },
}) })
@@ -92,7 +92,7 @@ export default function App() {
<Sidebar isDrawerOpen={isDrawerOpen} setIsDonationDialogOpen={setIsDonationDialogOpen} /> <Sidebar isDrawerOpen={isDrawerOpen} setIsDonationDialogOpen={setIsDonationDialogOpen} />
</ThemeProvider> </ThemeProvider>
<TorrentList /> <TorrentList />
<ThemeProvider theme={darkTheme}> <ThemeProvider theme={lightTheme}>
{isDonationDialogOpen && <DonateDialog onClose={() => setIsDonationDialogOpen(false)} />} {isDonationDialogOpen && <DonateDialog onClose={() => setIsDonationDialogOpen(false)} />}
</ThemeProvider> </ThemeProvider>
{!JSON.parse(localStorage.getItem('snackbarIsClosed')) && <DonateSnackbar />} {!JSON.parse(localStorage.getItem('snackbarIsClosed')) && <DonateSnackbar />}

View File

@@ -3,6 +3,8 @@ import { Button, Dialog, DialogActions, DialogTitle, ListItem, ListItemIcon, Lis
import { PowerSettingsNew as PowerSettingsNewIcon } from '@material-ui/icons' import { PowerSettingsNew as PowerSettingsNewIcon } from '@material-ui/icons'
import { shutdownHost } from 'utils/Hosts' import { shutdownHost } from 'utils/Hosts'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ThemeProvider } from '@material-ui/core/styles'
import { lightTheme } from 'components/App'
export default function CloseServer() { export default function CloseServer() {
const { t } = useTranslation() const { t } = useTranslation()
@@ -20,6 +22,7 @@ export default function CloseServer() {
<ListItemText primary={t('CloseServer')} /> <ListItemText primary={t('CloseServer')} />
</ListItem> </ListItem>
<ThemeProvider theme={lightTheme}>
<Dialog open={open} onClose={closeDialog}> <Dialog open={open} onClose={closeDialog}>
<DialogTitle>{t('CloseServer?')}</DialogTitle> <DialogTitle>{t('CloseServer?')}</DialogTitle>
<DialogActions> <DialogActions>
@@ -40,6 +43,7 @@ export default function CloseServer() {
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</ThemeProvider>
</> </>
) )
} }

View File

@@ -6,6 +6,8 @@ import DeleteIcon from '@material-ui/icons/Delete'
import { useState } from 'react' import { useState } from 'react'
import { torrentsHost } from 'utils/Hosts' import { torrentsHost } from 'utils/Hosts'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ThemeProvider } from '@material-ui/core/styles'
import { lightTheme } from 'components/App'
const fnRemoveAll = () => { const fnRemoveAll = () => {
fetch(torrentsHost(), { fetch(torrentsHost(), {
@@ -46,6 +48,7 @@ export default function RemoveAll() {
<ListItemText primary={t('RemoveAll')} /> <ListItemText primary={t('RemoveAll')} />
</ListItem> </ListItem>
<ThemeProvider theme={lightTheme}>
<Dialog open={open} onClose={closeDialog}> <Dialog open={open} onClose={closeDialog}>
<DialogTitle>{t('DeleteTorrents?')}</DialogTitle> <DialogTitle>{t('DeleteTorrents?')}</DialogTitle>
<DialogActions> <DialogActions>
@@ -66,6 +69,7 @@ export default function RemoveAll() {
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</ThemeProvider>
</> </>
) )
} }

View File

@@ -13,6 +13,8 @@ import Button from '@material-ui/core/Button'
import { FormControlLabel, InputLabel, Select, Switch } from '@material-ui/core' import { FormControlLabel, InputLabel, Select, Switch } from '@material-ui/core'
import { settingsHost, setTorrServerHost, getTorrServerHost } from 'utils/Hosts' import { settingsHost, setTorrServerHost, getTorrServerHost } from 'utils/Hosts'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ThemeProvider } from '@material-ui/core/styles'
import { lightTheme } from 'components/App'
export default function SettingsDialog() { export default function SettingsDialog() {
const { t } = useTranslation() const { t } = useTranslation()
@@ -100,6 +102,7 @@ export default function SettingsDialog() {
<ListItemText primary={t('Settings')} /> <ListItemText primary={t('Settings')} />
</ListItem> </ListItem>
<ThemeProvider theme={lightTheme}>
<Dialog open={open} onClose={handleClose} aria-labelledby='form-dialog-title' fullWidth> <Dialog open={open} onClose={handleClose} aria-labelledby='form-dialog-title' fullWidth>
<DialogTitle id='form-dialog-title'>{t('Settings')}</DialogTitle> <DialogTitle id='form-dialog-title'>{t('Settings')}</DialogTitle>
<DialogContent> <DialogContent>
@@ -287,6 +290,7 @@ export default function SettingsDialog() {
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</ThemeProvider>
</div> </div>
) )
} }