style: dashboard style
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user