feat: dashboard

This commit is contained in:
jialin
2024-05-22 09:29:30 +08:00
parent a416bc7eab
commit 46a9e6a931
21 changed files with 1522 additions and 53 deletions
+20
View File
@@ -0,0 +1,20 @@
.divider-line {
height: 8px;
// border-radius: 4px;
width: 100%;
// background-color: var(--color-fill-1);
z-index: 100;
margin: 0;
position: relative;
&::after {
content: '';
position: absolute;
top: 0;
left: -9px;
bottom: 0;
right: 0;
height: 100%;
background: var(--color-fill-1);
// border-radius: 4px;
}
}
+6
View File
@@ -0,0 +1,6 @@
import styles from './index.less';
const DividerLine: React.FC = () => {
return <div className={styles['divider-line']}></div>;
};
export default DividerLine;
+10
View File
@@ -3,4 +3,14 @@
justify-content: space-between;
align-items: center;
margin-top: 70px;
.left {
display: flex;
align-items: center;
font-size: 14px;
}
.right {
display: flex;
align-items: center;
font-size: 14px;
}
}
+5 -9
View File
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import styles from './index.less';
import './index.less';
type PageToolsProps = {
left?: React.ReactNode;
@@ -9,21 +9,17 @@ type PageToolsProps = {
};
const PageTools: React.FC<PageToolsProps> = (props) => {
const { left, right, marginBottom, marginTop } = props;
const { left, right, marginBottom = 0, marginTop = 70 } = props;
const newStyle: Record<string, string> = useMemo(() => {
const style: Record<string, string> = {};
if (marginBottom) {
style.marginBottom = `${marginBottom}px`;
}
if (marginTop) {
style.marginTop = `${marginTop}px`;
}
style.marginBottom = `${marginBottom}px`;
style.marginTop = `${marginTop}px`;
return style;
}, [marginBottom, marginTop]);
return (
<div className={styles['page-tools']} style={newStyle}>
<div className="page-tools" style={newStyle}>
<div className="left">{left}</div>
<div className="right">{right}</div>
</div>