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

Fix top style error

parent 0b33f922
...@@ -32,6 +32,9 @@ export default { ...@@ -32,6 +32,9 @@ export default {
}, },
], ],
], ],
define: {
APP_TYPE: process.env.APP_TYPE,
},
// 路由配置 // 路由配置
routes: pageRoutes, routes: pageRoutes,
// Theme for antd // Theme for antd
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
"scripts": { "scripts": {
"precommit": "npm run lint-staged", "precommit": "npm run lint-staged",
"presite": "npm run generate-mock && cd functions && npm install", "presite": "npm run generate-mock && cd functions && npm install",
"start": "umi dev", "start": "APP_TYPE=site umi dev",
"start:no-mock": "cross-env MOCK=none umi dev", "start:no-mock": "cross-env MOCK=none umi dev",
"build": "umi build", "build": "umi build",
"site": "npm run presite && npm run build && firebase deploy", "site": "npm run presite &&APP_TYPE=site npm run build && firebase deploy",
"analyze": "cross-env ANALYZE=1 umi build", "analyze": "cross-env ANALYZE=1 umi 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",
......
...@@ -9,13 +9,13 @@ export default class TopNavHeader extends PureComponent { ...@@ -9,13 +9,13 @@ export default class TopNavHeader extends PureComponent {
super(props); super(props);
this.state = { this.state = {
maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 330 - 165 - 4,
}; };
} }
static getDerivedStateFromProps(props) { static getDerivedStateFromProps(props) {
return { return {
maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 330 - 165 - 4,
}; };
} }
......
...@@ -3,10 +3,12 @@ import defaultSettings from '../defaultSettings'; ...@@ -3,10 +3,12 @@ import defaultSettings from '../defaultSettings';
let lessNodesAppended; let lessNodesAppended;
const updateTheme = primaryColor => { const updateTheme = primaryColor => {
// Don't compile less in production! // // Don't compile less in production!
if (process.env.NODE_ENV === 'production') { /* eslint-disable */
if (APP_TYPE !== 'site') {
return; return;
} }
/* eslint-disable */
// Determine if the component is remounted // Determine if the component is remounted
if (!primaryColor) { if (!primaryColor) {
return; return;
......
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