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 18:17:10 +01:00
|
|
|
<div className={`dropdown ${className}`}>
|
2021-12-30 18:53:56 +01:00
|
|
|
<div tabIndex="0" className={`
|
|
|
|
m-0 btn btn-neutral flex flex-row gap-2
|
|
|
|
sm:btn-ghost
|
|
|
|
hover:bg-neutral hover:border-neutral-content
|
|
|
|
`}>
|
2021-12-30 14:23:02 +01:00
|
|
|
<ThemeIcon />
|
|
|
|
<span>{app.theme}</span>
|
2021-12-30 17:55:46 +01:00
|
|
|
<span>Theme</span>
|
2021-12-30 14:23:02 +01:00
|
|
|
</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}>
|
2021-12-30 17:55:46 +01:00
|
|
|
<button onClick={() => app.setTheme(theme)} className="btn btn-ghost text-base-content hover:bg-base-200">
|
2021-12-30 14:23:02 +01:00
|
|
|
{theme}
|
2021-12-30 17:55:46 +01:00
|
|
|
<span> Theme</span>
|
2021-12-30 14:23:02 +01:00
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-11 14:04:05 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ThemePicker
|