Skip to content

Commit

Permalink
Aloha
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Xingfan committed Oct 31, 2018
1 parent d40717d commit 7172ac7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/context/index.js
Original file line number Diff line number Diff line change
@@ -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) =>
Expand Down
12 changes: 2 additions & 10 deletions site/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -28,7 +24,7 @@ class App extends Component {
footNavs: [],
pre: '',
next: '',
theme: 'default',
theme: 'hiui-blue',
locale: 'zh-CN',
themes: [
{
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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})
}

Expand Down
2 changes: 1 addition & 1 deletion site/redux/reducer/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down

0 comments on commit 7172ac7

Please sign in to comment.