Commit 8c74bc6c authored by 陈帅's avatar 陈帅

Weak mode changed to switch

parent 6b8665e7
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"start": "npm run shell", "start": "npm run shell",
"deploy": "firebase deploy --only functions", "deploy": "firebase deploy --only functions",
"logs": "firebase functions:log", "logs": "firebase functions:log",
"mock":"cd .. && rollup -c" "mock": "cd .. && rollup -c"
}, },
"dependencies": { "dependencies": {
"express": "^4.16.3", "express": "^4.16.3",
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
"private": true, "private": true,
"scripts": { "scripts": {
"precommit": "npm run lint-staged", "precommit": "npm run lint-staged",
"preinstall": "cd functions && npm install", "presite": "cd functions && npm install",
"start": "cross-env ESLINT=none roadhog dev", "start": "cross-env ESLINT=none roadhog dev",
"start:no-proxy": "cross-env NO_PROXY=true ESLINT=none roadhog dev", "start:no-proxy": "cross-env NO_PROXY=true ESLINT=none roadhog dev",
"build": "cross-env ESLINT=none roadhog build", "build": "cross-env ESLINT=none roadhog build",
"site": "rollup -c && npm run build && firebase deploy", "site": "npm run presite && rollup -c && npm run build && firebase deploy",
"analyze": "cross-env ANALYZE=1 roadhog build", "analyze": "cross-env ANALYZE=1 roadhog build",
"lint:style": "stylelint \"src/**/*.less\" --syntax less", "lint:style": "stylelint \"src/**/*.less\" --syntax less",
"lint": "eslint --ext .js src mock tests && npm run lint:style", "lint": "eslint --ext .js src mock tests && npm run lint:style",
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
"path-to-regexp": "^2.1.0", "path-to-regexp": "^2.1.0",
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"qs": "^6.5.0", "qs": "^6.5.0",
"rc-drawer": "^1.4.4", "rc-drawer": "^1.5.1",
"react": "^16.4.0", "react": "^16.4.0",
"react-container-query": "^0.11.0", "react-container-query": "^0.11.0",
"react-document-title": "^2.0.3", "react-document-title": "^2.0.3",
......
...@@ -106,7 +106,7 @@ class SettingDarwer extends PureComponent { ...@@ -106,7 +106,7 @@ class SettingDarwer extends PureComponent {
} }
} }
if (key === 'colorWeak') { if (key === 'colorWeak') {
if (value === 'open') { if (value) {
document.body.className = 'colorWeak'; document.body.className = 'colorWeak';
} else { } else {
document.body.className = ''; document.body.className = '';
...@@ -155,8 +155,9 @@ class SettingDarwer extends PureComponent { ...@@ -155,8 +155,9 @@ class SettingDarwer extends PureComponent {
open={collapse} open={collapse}
mask={false} mask={false}
onHandleClick={this.togglerContent} onHandleClick={this.togglerContent}
handleChild={ handler={
!collapse ? ( <div className="drawer-handle">
{!collapse ? (
<Icon <Icon
type="setting" type="setting"
style={{ style={{
...@@ -172,7 +173,8 @@ class SettingDarwer extends PureComponent { ...@@ -172,7 +173,8 @@ class SettingDarwer extends PureComponent {
fontSize: 20, fontSize: 20,
}} }}
/> />
) )}
</div>
} }
placement="right" placement="right"
width="336px" width="336px"
...@@ -231,15 +233,11 @@ class SettingDarwer extends PureComponent { ...@@ -231,15 +233,11 @@ class SettingDarwer extends PureComponent {
<Body title="其他设置 "> <Body title="其他设置 ">
<List.Item <List.Item
actions={[ actions={[
<Select <Switch
value={colorWeak}
size="small" size="small"
onSelect={value => this.changeSetting('colorWeak', value)} checked={!!colorWeak}
style={{ width: 80 }} onChange={checked => this.changeSetting('colorWeak', checked)}
> />,
<Select.Option value="close">close</Select.Option>
<Select.Option value="open">open</Select.Option>
</Select>,
]} ]}
> >
色弱模式 色弱模式
......
...@@ -7,7 +7,7 @@ const defaultSetting = { ...@@ -7,7 +7,7 @@ const defaultSetting = {
fixedHeader: false, fixedHeader: false,
autoHideHeader: false, autoHideHeader: false,
fixSiderbar: false, fixSiderbar: false,
colorWeak: 'close', colorWeak: false,
}; };
export default { export default {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment