fix css and darck mode const

This commit is contained in:
Oscar Dominguez 2019-08-18 15:24:04 -03:00 committed by Sean Yesmunt
parent 76c178cb42
commit 0a812dc2c3
4 changed files with 68 additions and 77 deletions

View file

@ -454,73 +454,73 @@ class SettingsPage extends React.PureComponent<Props, State> {
label={__('Automatic dark mode')} label={__('Automatic dark mode')}
/> />
<h3>{__('From: ')}</h3> <Form>
<div className="time-section"> <h3>{__('From: ')}</h3>
<FormField <fieldset-group class="fieldset-group--smushed">
className="select-hours" <FormField
type="select" type="select"
name="automatic_dark_mode_range" name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled} disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'hour' })} onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'hour' })}
value={darkModeTimes.from.hour} value={darkModeTimes.from.hour}
label={__('Hours:')} label={__('Hours:')}
> >
{startHours.map(time => ( {startHours.map(time => (
<option key={time} value={time}> <option key={time} value={time}>
{this.to12Hour(time)} {this.to12Hour(time)}
</option> </option>
))} ))}
</FormField> </FormField>
<FormField <FormField
className="select-hours" label={__('minutes')}
label={__('minutes')} type="select"
type="select" name="automatic_dark_mode_range"
name="automatic_dark_mode_range" disabled={!automaticDarkModeEnabled}
disabled={!automaticDarkModeEnabled} onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'min' })}
onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'min' })} value={darkModeTimes.from.min}
value={darkModeTimes.from.min} >
> {enabledMinutes.map(time => (
{enabledMinutes.map(time => ( <option key={time} value={time}>
<option key={time} value={time}> {time}
{time} </option>
</option> ))}
))} </FormField>
</FormField> </fieldset-group>
</div> </Form>
<h3>{__('To: ')}</h3> <Form>
<div className="time-section"> <h3>{__('To: ')}</h3>
<FormField <fieldset-group class="fieldset-group--smushed">
className="select-hours" <FormField
type="select" type="select"
name="automatic_dark_mode_range" name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled} disabled={!automaticDarkModeEnabled}
label={__('Hours:')} label={__('Hours:')}
onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'hour' })} onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'hour' })}
value={darkModeTimes.to.hour} value={darkModeTimes.to.hour}
> >
{endHours.map(time => ( {endHours.map(time => (
<option key={time} value={time}> <option key={time} value={time}>
{this.to12Hour(time)} {this.to12Hour(time)}
</option> </option>
))} ))}
</FormField> </FormField>
<FormField <FormField
className="select-hours" label={__('minutes')}
label={__('minutes')} type="select"
type="select" name="automatic_dark_mode_range"
name="automatic_dark_mode_range" disabled={!automaticDarkModeEnabled}
disabled={!automaticDarkModeEnabled} onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'min' })}
onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'min' })} value={darkModeTimes.to.min}
value={darkModeTimes.to.min} >
> {enabledMinutes.map(time => (
{enabledMinutes.map(time => ( <option key={time} value={time}>
<option key={time} value={time}> {time}
{time} </option>
</option> ))}
))} </FormField>
</FormField> </fieldset-group>
</div> </Form>
</fieldset-section> </fieldset-section>
</Form> </Form>
</section> </section>

View file

@ -3,6 +3,7 @@ import fs from 'fs';
import http from 'http'; import http from 'http';
// @endif // @endif
import { Lbry, ACTIONS, SETTINGS } from 'lbry-redux'; import { Lbry, ACTIONS, SETTINGS } from 'lbry-redux';
import * as DESKTOP_SETTINGS from 'constants/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings'; import { makeSelectClientSetting } from 'redux/selectors/settings';
import analytics from 'analytics'; import analytics from 'analytics';
@ -156,7 +157,7 @@ export function doSetDarkTime(value, options) {
}; };
const mergedTimes = { ...darkModeTimes, ...modifiedTimes }; const mergedTimes = { ...darkModeTimes, ...modifiedTimes };
dispatch(doSetClientSetting(SETTINGS.DARK_MODE_TIMES, mergedTimes)); dispatch(doSetClientSetting(DESKTOP_SETTINGS.DARK_MODE_TIMES, mergedTimes));
dispatch(doUpdateIsNight()); dispatch(doUpdateIsNight());
}; };
} }

View file

@ -34,7 +34,6 @@
@import 'component/pagination'; @import 'component/pagination';
@import 'component/placeholder'; @import 'component/placeholder';
@import 'component/search'; @import 'component/search';
@import 'component/settings';
@import 'component/snack-bar'; @import 'component/snack-bar';
@import 'component/spinner'; @import 'component/spinner';
@import 'component/splash'; @import 'component/splash';

View file

@ -1,9 +0,0 @@
.select-hours {
display: block;
float: left;
width: auto;
}
.time-section {
display: flex;
}