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')}
/>
<h3>{__('From: ')}</h3>
<div className="time-section">
<FormField
className="select-hours"
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'hour' })}
value={darkModeTimes.from.hour}
label={__('Hours:')}
>
{startHours.map(time => (
<option key={time} value={time}>
{this.to12Hour(time)}
</option>
))}
</FormField>
<FormField
className="select-hours"
label={__('minutes')}
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'min' })}
value={darkModeTimes.from.min}
>
{enabledMinutes.map(time => (
<option key={time} value={time}>
{time}
</option>
))}
</FormField>
</div>
<Form>
<h3>{__('From: ')}</h3>
<fieldset-group class="fieldset-group--smushed">
<FormField
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'hour' })}
value={darkModeTimes.from.hour}
label={__('Hours:')}
>
{startHours.map(time => (
<option key={time} value={time}>
{this.to12Hour(time)}
</option>
))}
</FormField>
<FormField
label={__('minutes')}
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'from', time: 'min' })}
value={darkModeTimes.from.min}
>
{enabledMinutes.map(time => (
<option key={time} value={time}>
{time}
</option>
))}
</FormField>
</fieldset-group>
</Form>
<h3>{__('To: ')}</h3>
<div className="time-section">
<FormField
className="select-hours"
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
label={__('Hours:')}
onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'hour' })}
value={darkModeTimes.to.hour}
>
{endHours.map(time => (
<option key={time} value={time}>
{this.to12Hour(time)}
</option>
))}
</FormField>
<FormField
className="select-hours"
label={__('minutes')}
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'min' })}
value={darkModeTimes.to.min}
>
{enabledMinutes.map(time => (
<option key={time} value={time}>
{time}
</option>
))}
</FormField>
</div>
<Form>
<h3>{__('To: ')}</h3>
<fieldset-group class="fieldset-group--smushed">
<FormField
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
label={__('Hours:')}
onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'hour' })}
value={darkModeTimes.to.hour}
>
{endHours.map(time => (
<option key={time} value={time}>
{this.to12Hour(time)}
</option>
))}
</FormField>
<FormField
label={__('minutes')}
type="select"
name="automatic_dark_mode_range"
disabled={!automaticDarkModeEnabled}
onChange={value => this.onChangeTime(value, { fromTo: 'to', time: 'min' })}
value={darkModeTimes.to.min}
>
{enabledMinutes.map(time => (
<option key={time} value={time}>
{time}
</option>
))}
</FormField>
</fieldset-group>
</Form>
</fieldset-section>
</Form>
</section>

View file

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

View file

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

View file

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