mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
create temporary settings view
This commit is contained in:
@@ -7,4 +7,7 @@
|
||||
|
||||
.debug select {
|
||||
margin: 2px;
|
||||
border: var(--select-border);
|
||||
background-color: var(--select-background-color);
|
||||
color: var(--select-color);
|
||||
}
|
||||
|
||||
@@ -1,56 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import useTheme from '../../hooks/use-theme';
|
||||
import styles from './subplebbit.module.css';
|
||||
|
||||
// TODO: remove theme and languages selectors for debugging
|
||||
const ThemeSettings = () => {
|
||||
const [theme, setTheme] = useTheme();
|
||||
|
||||
return (
|
||||
<select value={theme} onChange={(e) => setTheme(e.target.value)}>
|
||||
<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>
|
||||
</select>
|
||||
);
|
||||
};
|
||||
|
||||
// prettier-ignore
|
||||
const availableLanguages = ['ar', 'bn', 'cs', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fil', 'fr', 'he', 'hi', 'hu', 'id', 'it', 'ja', 'ko', 'mr', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sq', 'sv', 'te', 'th', 'tr', 'uk', 'ur', 'vi', 'zh'];
|
||||
|
||||
const LanguageSettings = () => {
|
||||
const { i18n } = useTranslation();
|
||||
const { changeLanguage, language } = i18n;
|
||||
|
||||
const onSelectLanguage = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
changeLanguage(e.target.value);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.languageSettings}>
|
||||
<select value={language} onChange={onSelectLanguage}>
|
||||
{availableLanguages.map((lang) => (
|
||||
<option key={lang} value={lang}>
|
||||
{lang}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const Subplebbit = () => {
|
||||
return (
|
||||
<div className={styles.content}>
|
||||
<div className={styles.debug}>
|
||||
<LanguageSettings />
|
||||
<ThemeSettings />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return <div className={styles.content}></div>;
|
||||
};
|
||||
|
||||
export default Subplebbit;
|
||||
|
||||
Reference in New Issue
Block a user