Added Theme Playlists
This commit is contained in:
@@ -22,6 +22,12 @@ export function useCommonHooks() {
|
||||
key: 'theme',
|
||||
defaultValue: 'blackboard',
|
||||
});
|
||||
|
||||
const [currentThemePlaylist, setCurrentThemePlaylist] = useLocalStorage<any>({
|
||||
key: 'themePlaylist',
|
||||
defaultValue: 'All',
|
||||
});
|
||||
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
const [providerLabel, setProviderLabel] = useState('Google Search');
|
||||
const [providerURL, setProviderURL] = useState('https://www.google.com/search?q=');
|
||||
@@ -52,6 +58,10 @@ export function useCommonHooks() {
|
||||
if (enabled.length === 0) {
|
||||
setTheme(themes[0]);
|
||||
save && setThemeName(themes[0].name);
|
||||
} else if (currentThemePlaylist !== 'All') {
|
||||
const index = Math.floor(Math.random() * themes.length);
|
||||
setTheme(themes[index]);
|
||||
save && setThemeName(themes[index].name);
|
||||
} else {
|
||||
const index = Math.floor(Math.random() * enabled.length);
|
||||
setTheme(enabled[index]);
|
||||
@@ -72,6 +82,8 @@ export function useCommonHooks() {
|
||||
setBookmarkFilter,
|
||||
currentTheme,
|
||||
setCurrentTheme,
|
||||
currentThemePlaylist,
|
||||
setCurrentThemePlaylist,
|
||||
searchValue,
|
||||
setSearchValue,
|
||||
providerLabel,
|
||||
|
||||
Reference in New Issue
Block a user