fix: bring buttons closer and reduce repetition
This commit is contained in:
committed by
mrugesh
parent
e90eb66529
commit
12a2b47b17
@ -52,7 +52,6 @@
|
|||||||
label.toggle-label {
|
label.toggle-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 550px) {
|
@media (max-width: 550px) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
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';
|
import './theme-settings.css';
|
||||||
|
|
||||||
@ -13,18 +13,18 @@ const propTypes = {
|
|||||||
|
|
||||||
export default function ThemeSettings({ currentTheme, toggleNightMode }) {
|
export default function ThemeSettings({ currentTheme, toggleNightMode }) {
|
||||||
return (
|
return (
|
||||||
<div className='toggle-setting-container' id='theme-settings-container'>
|
<Form inline={true} onSubmit={e => e.preventDefault()}>
|
||||||
<ControlLabel className='theme-label' htmlFor='night-mode'>
|
<ToggleSetting
|
||||||
<strong>Night Mode</strong>
|
action='Night Mode'
|
||||||
</ControlLabel>
|
flag={currentTheme === 'night'}
|
||||||
<TB
|
flagName='currentTheme'
|
||||||
name='night-mode'
|
offLabel='Off'
|
||||||
onChange={() =>
|
onLabel='On'
|
||||||
|
toggleFlag={() =>
|
||||||
toggleNightMode(currentTheme === 'night' ? 'default' : 'night')
|
toggleNightMode(currentTheme === 'night' ? 'default' : 'night')
|
||||||
}
|
}
|
||||||
value={currentTheme === 'night'}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
.toggle-setting-container .form-group {
|
.toggle-setting-container .form-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-setting-container .btn-group {
|
.toggle-setting-container .btn-group {
|
||||||
|
Reference in New Issue
Block a user