Commit 1d787c07 authored by Chunchi Che's avatar Chunchi Che

optimize

parent 55e3775f
Pipeline #20423 passed with stages
in 4 minutes and 7 seconds
...@@ -38,6 +38,20 @@ ...@@ -38,6 +38,20 @@
"z": 1 "z": 1
}, },
"floating": 0.02 "floating": 0.02
},
"layout": {
"header": {
"height": 80
},
"content": {
"height": 800
},
"sider": {
"width": 400
},
"footer": {
"height": 80
}
} }
} }
} }
import React from "react"; import React from "react";
import { Layout } from "antd"; import { Layout } from "antd";
import NeosConfig from "../../../neos.config.json";
const layoutConfig = NeosConfig.ui.layout;
const { Header, Footer, Sider, Content } = Layout; const { Header, Footer, Sider, Content } = Layout;
const headerStyle: React.CSSProperties = { const headerStyle: React.CSSProperties = {
textAlign: "center", textAlign: "center",
color: "#fff", color: "#fff",
height: 64, height: layoutConfig.header.height,
paddingInline: 50, paddingInline: 50,
lineHeight: "64px", lineHeight: "64px",
}; };
...@@ -14,6 +16,7 @@ const headerStyle: React.CSSProperties = { ...@@ -14,6 +16,7 @@ const headerStyle: React.CSSProperties = {
const contentStyle: React.CSSProperties = { const contentStyle: React.CSSProperties = {
textAlign: "center", textAlign: "center",
minHeight: 120, minHeight: 120,
height: layoutConfig.content.height,
lineHeight: "120px", lineHeight: "120px",
}; };
...@@ -25,6 +28,7 @@ const siderStyle: React.CSSProperties = { ...@@ -25,6 +28,7 @@ const siderStyle: React.CSSProperties = {
const footerStyle: React.CSSProperties = { const footerStyle: React.CSSProperties = {
textAlign: "center", textAlign: "center",
height: layoutConfig.footer.height,
color: "#fff", color: "#fff",
}; };
...@@ -36,7 +40,9 @@ const NeosLayout = (props: { ...@@ -36,7 +40,9 @@ const NeosLayout = (props: {
}) => { }) => {
return ( return (
<Layout> <Layout>
<Sider style={siderStyle}>{props.sider}</Sider> <Sider style={siderStyle} width={layoutConfig.sider.width}>
{props.sider}
</Sider>
<Layout> <Layout>
<Header style={headerStyle}>{props.header}</Header> <Header style={headerStyle}>{props.header}</Header>
<Content style={contentStyle}>{props.content}</Content> <Content style={contentStyle}>{props.content}</Content>
......
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