mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor(ui): rename topbar to boardsbar and add desktop footer for board, thread, and catalog
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.select {
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import useTheme from '../../hooks/use-theme';
|
||||
import useSpecialThemeStore from '../../stores/use-special-theme-store';
|
||||
import { isChristmas } from '../../lib/utils/time-utils';
|
||||
import styles from './style-selector.module.css';
|
||||
|
||||
const StyleSelector = () => {
|
||||
const [theme, setTheme] = useTheme();
|
||||
const { isEnabled, setIsEnabled } = useSpecialThemeStore();
|
||||
const isChristmasTime = isChristmas();
|
||||
|
||||
const handleThemeChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
const newTheme = e.target.value;
|
||||
|
||||
if (newTheme === 'special') {
|
||||
setIsEnabled(true);
|
||||
setTheme('tomorrow');
|
||||
} else {
|
||||
setIsEnabled(false);
|
||||
setTheme(newTheme);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<select className={styles.select} value={isEnabled ? 'special' : theme} onChange={handleThemeChange}>
|
||||
<option value='yotsuba'>Yotsuba</option>
|
||||
<option value='yotsuba-b'>Yotsuba B</option>
|
||||
<option value='futaba'>Futaba</option>
|
||||
<option value='burichan'>Burichan</option>
|
||||
<option value='tomorrow'>Tomorrow</option>
|
||||
<option value='photon'>Photon</option>
|
||||
{isChristmasTime && <option value='special'>Special</option>}
|
||||
</select>
|
||||
);
|
||||
};
|
||||
|
||||
export default StyleSelector;
|
||||
Reference in New Issue
Block a user