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 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 550px) {
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
.toggle-setting-container .form-group {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.toggle-setting-container .btn-group {
|
||||
|
Reference in New Issue
Block a user