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

Fix top style error

parent 0b33f922
......@@ -32,6 +32,9 @@ export default {
},
],
],
define: {
APP_TYPE: process.env.APP_TYPE,
},
// 路由配置
routes: pageRoutes,
// Theme for antd
......
......@@ -6,10 +6,10 @@
"scripts": {
"precommit": "npm run lint-staged",
"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",
"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",
"lint:style": "stylelint \"src/**/*.less\" --syntax less",
"lint": "eslint --ext .js src mock tests && npm run lint:style",
......
......@@ -9,13 +9,13 @@ export default class TopNavHeader extends PureComponent {
super(props);
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) {
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';
let lessNodesAppended;
const updateTheme = primaryColor => {
// Don't compile less in production!
if (process.env.NODE_ENV === 'production') {
// // Don't compile less in production!
/* eslint-disable */
if (APP_TYPE !== 'site') {
return;
}
/* eslint-disable */
// Determine if the component is remounted
if (!primaryColor) {
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