2021-12-11 14:04:05 +01:00
|
|
|
import themes from 'shared/themes/index.js'
|
2021-12-30 14:23:02 +01:00
|
|
|
import ThemeIcon from 'shared/components/icons/theme.js'
|
2021-12-11 14:04:05 +01:00
|
|
|
|
2021-12-21 20:47:13 +01:00
|
|
|
const ThemePicker = ({ app, className='' }) => {
|
2021-12-11 14:04:05 +01:00
|
|
|
return (
|
2021-12-30 14:23:02 +01:00
|
|
|
<div className="dropdown">
|
|
|
|
<div tabIndex="0" className="m-0 btn flex flex-row gap-2">
|
|
|
|
<ThemeIcon />
|
|
|
|
<span>Theme:</span>
|
|
|
|
<span>{app.theme}</span>
|
|
|
|
</div>
|
|
|
|
<ul tabIndex="0" className="p-2 shadow menu dropdown-content bg-base-100 rounded-box w-52">
|
|
|
|
{Object.keys(themes).map(theme => (
|
|
|
|
<li key={theme}>
|
|
|
|
<button onClick={() => app.setTheme(theme)} className="btn btn-link">
|
|
|
|
{theme}
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-11 14:04:05 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ThemePicker
|