State fixed
This commit is contained in:
@@ -47,8 +47,10 @@ function SettingsButton() {
|
|||||||
const {
|
const {
|
||||||
currentTheme,
|
currentTheme,
|
||||||
setCurrentTheme,
|
setCurrentTheme,
|
||||||
|
setThemeName,
|
||||||
handleThemeChange,
|
handleThemeChange,
|
||||||
theme,
|
theme,
|
||||||
|
setTheme,
|
||||||
appFilter,
|
appFilter,
|
||||||
setAppFilter,
|
setAppFilter,
|
||||||
bookmarkFilter,
|
bookmarkFilter,
|
||||||
@@ -174,8 +176,8 @@ function SettingsButton() {
|
|||||||
className={stackClasses.menuStack}
|
className={stackClasses.menuStack}
|
||||||
classNames={stackClasses}
|
classNames={stackClasses}
|
||||||
>
|
>
|
||||||
<Menu.Label pb={'1rem'}>Themes</Menu.Label>
|
<Menu.Label pb={'.25rem'}>Themes</Menu.Label>
|
||||||
<Group pb={'1rem'}>
|
<Group mt={'-1rem'} mb={'-.75rem'} w={'95%'} justify='space-between'>
|
||||||
<Tooltip label='Shuffle Themes' color={theme.primaryColor} withArrow>
|
<Tooltip label='Shuffle Themes' color={theme.primaryColor} withArrow>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
className={actionIconClasses.menuActions}
|
className={actionIconClasses.menuActions}
|
||||||
@@ -216,10 +218,13 @@ function SettingsButton() {
|
|||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Group>
|
</Group>
|
||||||
<Text fw={'bold'} fz={20}>
|
<Text fw={'bold'} fz={18}>
|
||||||
Currently:{' '}
|
Currently:{' '}
|
||||||
</Text>
|
</Text>
|
||||||
{theme.name}
|
{theme.name}
|
||||||
|
<Text fw={'bold'} fz={18}>
|
||||||
|
Playlist:{' '}
|
||||||
|
</Text>
|
||||||
<Select
|
<Select
|
||||||
labelProps={{ display: 'none' }}
|
labelProps={{ display: 'none' }}
|
||||||
placeholder='Pick a playlist...'
|
placeholder='Pick a playlist...'
|
||||||
@@ -242,9 +247,24 @@ function SettingsButton() {
|
|||||||
option: selectClasses.menuSelectOption,
|
option: selectClasses.menuSelectOption,
|
||||||
}}
|
}}
|
||||||
comboboxProps={{ withinPortal: false }}
|
comboboxProps={{ withinPortal: false }}
|
||||||
onChange={(_value, option: any) =>
|
onChange={(_value, option: any) => {
|
||||||
setCurrentThemePlaylist(option.value)
|
setCurrentThemePlaylist(option.value);
|
||||||
}
|
if (option.value !== 'Time of Day') {
|
||||||
|
setThemeName('random');
|
||||||
|
} else {
|
||||||
|
const themeList = JSON.parse(
|
||||||
|
themePlaylists.find((t: any) => t.name === 'Time of Day')
|
||||||
|
.themeList,
|
||||||
|
);
|
||||||
|
setThemeName(
|
||||||
|
allThemes.find(
|
||||||
|
(t: any) =>
|
||||||
|
t.id ===
|
||||||
|
Number(themeList[Math.floor(new Date().getHours() / 6)]),
|
||||||
|
).name,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
onLoad={(option: any) => setCurrentThemePlaylist(option)}
|
onLoad={(option: any) => setCurrentThemePlaylist(option)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
Reference in New Issue
Block a user