2021-05-06 19:03:31 +02:00
|
|
|
import { Theme } from '../../interfaces/Theme';
|
2021-05-07 18:30:06 +02:00
|
|
|
import classes from './ThemePreview.module.css';
|
2021-05-06 19:03:31 +02:00
|
|
|
|
2021-11-09 14:33:51 +01:00
|
|
|
interface Props {
|
2021-05-07 18:30:06 +02:00
|
|
|
theme: Theme;
|
|
|
|
applyTheme: Function;
|
|
|
|
}
|
|
|
|
|
2021-11-09 14:33:51 +01:00
|
|
|
export const ThemePreview = (props: Props): JSX.Element => {
|
2021-05-06 19:03:31 +02:00
|
|
|
return (
|
2021-11-09 14:33:51 +01:00
|
|
|
<div
|
|
|
|
className={classes.ThemePreview}
|
|
|
|
onClick={() => props.applyTheme(props.theme.name)}
|
|
|
|
>
|
2021-05-07 18:30:06 +02:00
|
|
|
<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>
|
2021-05-06 19:03:31 +02:00
|
|
|
</div>
|
2021-11-09 14:33:51 +01:00
|
|
|
);
|
|
|
|
};
|