mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-27 14:59:37 +02:00
Theme changing. Simple routing
This commit is contained in:
parent
573814ddac
commit
765418d3d2
19 changed files with 378 additions and 59 deletions
7
client/src/components/UI/Headline/Headline.module.css
Normal file
7
client/src/components/UI/Headline/Headline.module.css
Normal file
|
@ -0,0 +1,7 @@
|
|||
.HeadlineTitle {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.HeadlineSubtitle {
|
||||
color: var(--color-primary);
|
||||
}
|
18
client/src/components/UI/Headline/Headline.tsx
Normal file
18
client/src/components/UI/Headline/Headline.tsx
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Fragment } from 'react';
|
||||
import classes from './Headline.module.css';
|
||||
|
||||
interface ComponentProps {
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
}
|
||||
|
||||
const Headline = (props: ComponentProps): JSX.Element => {
|
||||
return (
|
||||
<Fragment>
|
||||
<h2 className={classes.HeadlineTitle}>{props.title}</h2>
|
||||
{props.subtitle && <p className={classes.HeadlineSubtitle}>{props.subtitle}</p>}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default Headline;
|
4
client/src/components/UI/Icon/Icon.module.css
Normal file
4
client/src/components/UI/Icon/Icon.module.css
Normal file
|
@ -0,0 +1,4 @@
|
|||
.Icon {
|
||||
color: var(--color-primary);
|
||||
width: 90%;
|
||||
}
|
25
client/src/components/UI/Icon/Icon.tsx
Normal file
25
client/src/components/UI/Icon/Icon.tsx
Normal file
|
@ -0,0 +1,25 @@
|
|||
import classes from './Icon.module.css';
|
||||
|
||||
import { Icon as MDIcon } from '@mdi/react';
|
||||
|
||||
interface ComponentProps {
|
||||
icon: string;
|
||||
}
|
||||
|
||||
const Icon = (props: ComponentProps): JSX.Element => {
|
||||
const MDIcons = require('@mdi/js');
|
||||
let iconPath = MDIcons[props.icon];
|
||||
|
||||
if (!iconPath) {
|
||||
console.log('icon not found');
|
||||
iconPath = MDIcons.mdiCancel;
|
||||
}
|
||||
|
||||
return (
|
||||
<MDIcon className={classes.Icon}
|
||||
path={iconPath}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default Icon;
|
4
client/src/components/UI/Layout/Layout.module.css
Normal file
4
client/src/components/UI/Layout/Layout.module.css
Normal file
|
@ -0,0 +1,4 @@
|
|||
.Container {
|
||||
width: 100%;
|
||||
padding: var(--space-p-x);
|
||||
}
|
9
client/src/components/UI/Layout/Layout.tsx
Normal file
9
client/src/components/UI/Layout/Layout.tsx
Normal file
|
@ -0,0 +1,9 @@
|
|||
import classes from './Layout.module.css';
|
||||
|
||||
export const Container = (props: any): JSX.Element => {
|
||||
return (
|
||||
<div className={classes.Container}>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue