mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-27 23:09:35 +02:00
Theme changing. Simple routing
This commit is contained in:
parent
573814ddac
commit
765418d3d2
19 changed files with 378 additions and 59 deletions
|
@ -1,10 +1,29 @@
|
|||
import { Theme } from '../../interfaces/Theme';
|
||||
import classes from './ThemePreview.module.css';
|
||||
|
||||
const ThemePreview = (theme: Theme): JSX.Element => {
|
||||
interface ComponentProps {
|
||||
theme: Theme;
|
||||
applyTheme: Function;
|
||||
}
|
||||
|
||||
const ThemePreview = (props: ComponentProps): JSX.Element => {
|
||||
return (
|
||||
<div>
|
||||
<p>Theme: {theme.name}</p>
|
||||
<p>{theme.colors.background}</p>
|
||||
<div className={classes.ThemePreview} onClick={() => props.applyTheme(props.theme.name)}>
|
||||
<div className={classes.ColorsPreview}>
|
||||
<div
|
||||
className={classes.ColorPreview}
|
||||
style={{ backgroundColor: props.theme.colors.background }}
|
||||
></div>
|
||||
<div
|
||||
className={classes.ColorPreview}
|
||||
style={{ backgroundColor: props.theme.colors.primary }}
|
||||
></div>
|
||||
<div
|
||||
className={classes.ColorPreview}
|
||||
style={{ backgroundColor: props.theme.colors.accent }}
|
||||
></div>
|
||||
</div>
|
||||
<p>{props.theme.name}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue