Revert "remove doGetThemes"

This reverts commit 18701e0382.
This commit is contained in:
Sean Yesmunt 2019-10-03 14:24:45 -04:00
parent 33337c6cc4
commit 7094b56642
5 changed files with 25 additions and 3 deletions

View file

@ -71,6 +71,12 @@ const Header = (props: Props) => {
icon={ICONS.LBRY} icon={ICONS.LBRY}
navigate="/" navigate="/"
/> />
<Button
className="header__navigation-item header__navigation-item--lbry"
label={__('auth')}
icon={ICONS.LBRY}
navigate="/$/signin"
/>
{/* @if TARGET='app' */} {/* @if TARGET='app' */}
{!minimal && ( {!minimal && (

View file

@ -1,7 +1,13 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as SETTINGS from 'constants/settings'; import * as SETTINGS from 'constants/settings';
import { doClearCache, doNotifyEncryptWallet, doNotifyDecryptWallet, doNotifyForgetPassword } from 'redux/actions/app'; import { doClearCache, doNotifyEncryptWallet, doNotifyDecryptWallet, doNotifyForgetPassword } from 'redux/actions/app';
import { doSetDaemonSetting, doSetClientSetting, doSetDarkTime } from 'redux/actions/settings'; import {
doSetDaemonSetting,
doSetClientSetting,
doGetThemes,
doChangeLanguage,
doSetDarkTime,
} from 'redux/actions/settings';
import { doSetPlayingUri } from 'redux/actions/content'; import { doSetPlayingUri } from 'redux/actions/content';
import { makeSelectClientSetting, selectDaemonSettings, selectosNotificationsEnabled } from 'redux/selectors/settings'; import { makeSelectClientSetting, selectDaemonSettings, selectosNotificationsEnabled } from 'redux/selectors/settings';
import { doWalletStatus, selectWalletIsEncrypted, selectBlockedChannelsCount } from 'lbry-redux'; import { doWalletStatus, selectWalletIsEncrypted, selectBlockedChannelsCount } from 'lbry-redux';
@ -30,6 +36,7 @@ const perform = dispatch => ({
setDaemonSetting: (key, value) => dispatch(doSetDaemonSetting(key, value)), setDaemonSetting: (key, value) => dispatch(doSetDaemonSetting(key, value)),
clearCache: () => dispatch(doClearCache()), clearCache: () => dispatch(doClearCache()),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)), setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
getThemes: () => dispatch(doGetThemes()),
encryptWallet: () => dispatch(doNotifyEncryptWallet()), encryptWallet: () => dispatch(doNotifyEncryptWallet()),
decryptWallet: () => dispatch(doNotifyDecryptWallet()), decryptWallet: () => dispatch(doNotifyDecryptWallet()),
updateWalletStatus: () => dispatch(doWalletStatus()), updateWalletStatus: () => dispatch(doWalletStatus()),

View file

@ -44,6 +44,7 @@ type Props = {
setDaemonSetting: (string, ?SetDaemonSettingArg) => void, setDaemonSetting: (string, ?SetDaemonSettingArg) => void,
setClientSetting: (string, SetDaemonSettingArg) => void, setClientSetting: (string, SetDaemonSettingArg) => void,
clearCache: () => Promise<any>, clearCache: () => Promise<any>,
getThemes: () => void,
daemonSettings: DaemonSettings, daemonSettings: DaemonSettings,
showNsfw: boolean, showNsfw: boolean,
instantPurchaseEnabled: boolean, instantPurchaseEnabled: boolean,
@ -94,6 +95,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
} }
componentDidMount() { componentDidMount() {
this.props.getThemes();
this.props.updateWalletStatus(); this.props.updateWalletStatus();
getSavedPassword().then(p => { getSavedPassword().then(p => {
if (p) { if (p) {

View file

@ -46,6 +46,13 @@ export function doSetClientSetting(key, value) {
}; };
} }
export function doGetThemes() {
return dispatch => {
const themes = [__('light'), __('dark')];
dispatch(doSetClientSetting(SETTINGS.THEMES, themes));
};
}
export function doUpdateIsNight() { export function doUpdateIsNight() {
return { return {
type: ACTIONS.UPDATE_IS_NIGHT, type: ACTIONS.UPDATE_IS_NIGHT,

View file

@ -16,8 +16,8 @@ const defaultState = {
// UI // UI
[SETTINGS.LANGUAGE]: window.localStorage.getItem(SETTINGS.LANGUAGE) || 'en', [SETTINGS.LANGUAGE]: window.localStorage.getItem(SETTINGS.LANGUAGE) || 'en',
[SETTINGS.THEME]: __('light'), [SETTINGS.THEME]: 'light',
[SETTINGS.THEMES]: [__('light'), __('dark')], [SETTINGS.THEMES]: [],
[SETTINGS.SUPPORT_OPTION]: false, [SETTINGS.SUPPORT_OPTION]: false,
[SETTINGS.HIDE_SPLASH_ANIMATION]: false, [SETTINGS.HIDE_SPLASH_ANIMATION]: false,
[SETTINGS.HIDE_BALANCE]: false, [SETTINGS.HIDE_BALANCE]: false,