colouring-montreal/app/src/frontend/map/theme-switcher.tsx

20 lines
567 B
TypeScript
Raw Normal View History

2018-09-13 11:03:49 -04:00
import React from 'react';
import './theme-switcher.css';
interface ThemeSwitcherProps {
currentTheme: string;
onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
}
const ThemeSwitcher: React.FC<ThemeSwitcherProps> = (props) => (
2018-09-13 15:41:42 -04:00
<form className={`theme-switcher ${props.currentTheme}`} onSubmit={props.onSubmit}>
<button className="btn btn-outline btn-outline-dark"
2019-05-27 11:39:16 -04:00
type="submit">
2018-09-13 11:03:49 -04:00
Switch theme ({(props.currentTheme === 'light')? 'Light' : 'Night'})
</button>
</form>
);
export default ThemeSwitcher;