From 7172ac7237fffc342632b93d4dbc0aa70449b7a3 Mon Sep 17 00:00:00 2001 From: Sun Xingfan Date: Wed, 31 Oct 2018 17:25:11 +0800 Subject: [PATCH] Aloha --- components/context/index.js | 2 +- site/App.js | 12 ++---------- site/redux/reducer/global.js | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/components/context/index.js b/components/context/index.js index d0274cc09..ccf16f993 100644 --- a/components/context/index.js +++ b/components/context/index.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import locales from '../../locales' -export const ThemeContext = React.createContext('default') +export const ThemeContext = React.createContext('hiui-blue') export const LocaleContext = React.createContext('zh-CN') export default (WrappedComponent) => diff --git a/site/App.js b/site/App.js index 1d6b66062..b9f74ea79 100644 --- a/site/App.js +++ b/site/App.js @@ -13,10 +13,6 @@ req.keys().forEach((mod) => { if (v && v.default) { v = v.default } - // console.log(mod, 'this is mod') - // console.log(v, 'this is v') - // const match = mod.match(/^\.\/([^_][\w-]+)\/index\.js?$/) - // console.log(match, 'this is match') }) class App extends Component { @@ -28,7 +24,7 @@ class App extends Component { footNavs: [], pre: '', next: '', - theme: 'default', + theme: 'hiui-blue', locale: 'zh-CN', themes: [ { @@ -82,7 +78,7 @@ class App extends Component { if (!this.state.locale) { this.setLocale(localStorage.getItem('HIUI_LANGUAGE') || 'zh-CN') } - this.setTheme(localStorage.getItem('HIUI_THEME') || 'default') + this.setTheme(localStorage.getItem('HIUI_THEME') || 'hiui-blue') } // 切换中英文文档 // componentDidUpdate(props, state) { @@ -173,12 +169,8 @@ class App extends Component { const footNavs = this.state.footNavs const index = footNavs.indexOf(this.state.page) const pre = footNavs[index - 1] ? footNavs[index - 1] : '' - - console.log('---index', index, this.state.page) const next = footNavs[index + 1] ? footNavs[index + 1] : '' - console.log('---pre,next', pre, next) - this.setState({pre, next}) } diff --git a/site/redux/reducer/global.js b/site/redux/reducer/global.js index 17f52b6cd..2bb50b70a 100644 --- a/site/redux/reducer/global.js +++ b/site/redux/reducer/global.js @@ -2,7 +2,7 @@ const initState = { sider: { items: [] }, - theme: window.localStorage.getItem('HIUI_THEME') || 'default', + theme: window.localStorage.getItem('HIUI_THEME') || 'hiui-blue', locale: window.localStorage.getItem('HIUI_LANGUAGE') || 'zh-CN' }