fix: bring buttons closer and reduce repetition

This commit is contained in:
Oliver Eyton-Williams
2019-08-22 12:52:38 +02:00
committed by mrugesh
parent e90eb66529
commit 12a2b47b17
3 changed files with 12 additions and 12 deletions

View File

@ -52,7 +52,6 @@
label.toggle-label {
display: flex;
flex-direction: column;
justify-content: center;
}
@media (max-width: 550px) {

View File

@ -1,8 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import { ControlLabel } from '@freecodecamp/react-bootstrap';
import { Form } from '@freecodecamp/react-bootstrap';
import TB from '../helpers/ToggleButton';
import ToggleSetting from './ToggleSetting';
import './theme-settings.css';
@ -13,18 +13,18 @@ const propTypes = {
export default function ThemeSettings({ currentTheme, toggleNightMode }) {
return (
<div className='toggle-setting-container' id='theme-settings-container'>
<ControlLabel className='theme-label' htmlFor='night-mode'>
<strong>Night Mode</strong>
</ControlLabel>
<TB
name='night-mode'
onChange={() =>
<Form inline={true} onSubmit={e => e.preventDefault()}>
<ToggleSetting
action='Night Mode'
flag={currentTheme === 'night'}
flagName='currentTheme'
offLabel='Off'
onLabel='On'
toggleFlag={() =>
toggleNightMode(currentTheme === 'night' ? 'default' : 'night')
}
value={currentTheme === 'night'}
/>
</div>
</Form>
);
}

View File

@ -1,6 +1,7 @@
.toggle-setting-container .form-group {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
}
.toggle-setting-container .btn-group {