style: dashboard style

This commit is contained in:
jialin
2024-06-19 18:58:49 +08:00
parent 9f34452c68
commit 8c402e88fb
24 changed files with 266 additions and 189 deletions
+14 -4
View File
@@ -6,17 +6,27 @@ type PageToolsProps = {
right?: React.ReactNode;
marginBottom?: number;
marginTop?: number;
style?: React.CSSProperties;
};
const PageTools: React.FC<PageToolsProps> = (props) => {
const { left, right, marginBottom = 0, marginTop = 70 } = props;
const {
left,
right,
marginBottom = 0,
marginTop = 70,
style: pageStyle
} = props;
const newStyle: Record<string, string> = useMemo(() => {
const style: Record<string, string> = {};
const newStyle: React.CSSProperties = useMemo(() => {
const style: React.CSSProperties = {};
style.marginBottom = `${marginBottom}px`;
style.marginTop = `${marginTop}px`;
if (pageStyle) {
Object.assign(style, pageStyle);
}
return style;
}, [marginBottom, marginTop]);
}, [marginBottom, marginTop, pageStyle]);
return (
<div className="page-tools" style={newStyle}>