colouring-montreal/app/src/frontend/map/theme-switcher.tsx
2019-11-05 20:13:10 +00:00

20 lines
567 B
TypeScript

import React from 'react';
import './theme-switcher.css';
interface ThemeSwitcherProps {
currentTheme: string;
onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
}
const ThemeSwitcher: React.FC<ThemeSwitcherProps> = (props) => (
<form className={`theme-switcher ${props.currentTheme}`} onSubmit={props.onSubmit}>
<button className="btn btn-outline btn-outline-dark"
type="submit">
Switch theme ({(props.currentTheme === 'light')? 'Light' : 'Night'})
</button>
</form>
);
export default ThemeSwitcher;