colouring-montreal/app/src/frontend/theme-switcher.js

21 lines
559 B
JavaScript
Raw Normal View History

2018-09-13 11:03:49 -04:00
import React from 'react';
2019-05-27 13:26:29 -04:00
import PropTypes from 'prop-types';
2018-09-13 11:03:49 -04:00
import './theme-switcher.css';
const ThemeSwitcher = (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>
);
2019-05-27 13:26:29 -04:00
ThemeSwitcher.propTypes = {
currentTheme: PropTypes.string,
onSubmit: PropTypes.func.isRequired
}
2018-09-13 11:03:49 -04:00
export default ThemeSwitcher;