Commit cbe7d9f4 authored by 秦文海's avatar 秦文海

chore: 修改初始样式

parent a4a48607
......@@ -14,7 +14,6 @@
width: 100%;
height: 15%;
min-height: 45px;
max-height: 55px;
background-color: #001529;
> div:nth-child(1) {
display: flex;
......
......@@ -14,14 +14,14 @@ const TipTool = (props) => {
const data = [
{
name: 'middle',
width: style.minWidth ?? '200px',
height: style.minHeight ?? '40px',
width: style.minWidth ?? '600px',
height: style.minHeight ?? '300px',
active: true,
},
{
name: 'large',
width: style.maxWidth ?? '200px',
height: style.maxHeight ?? '40px',
width: style.maxWidth ?? '800px',
height: style.maxHeight ?? '400px',
active: false,
},
];
......@@ -29,7 +29,7 @@ const TipTool = (props) => {
const scale = {
name: 'small',
width: '200px',
height: '40px',
height: '45px',
active: true,
};
const [styleState, setStyleState] = useState(data);
......@@ -44,32 +44,36 @@ const TipTool = (props) => {
}
});
setStyleState(data);
return data
.filter((item) => item.active)
.map(({ width, height }) => {
return { width, height };
})[0];
return getWidthAndHeight(data);
};
const changeScale = (flag) => {
let obj = { ...styleScale };
obj.active = flag;
setScaleState(obj);
return { height: obj.height, width: obj.width };
if (flag) {
return getWidthAndHeight(styleState);
} else {
return { height: obj.height, width: obj.width };
}
};
const computedStyle = () => {
if (!styleScale.active) {
return { width: styleScale.width, height: styleScale.height };
} else {
return styleState
.filter((item) => item.active)
.map(({ width, height }) => {
return { width, height };
})[0];
return getWidthAndHeight(styleState);
}
};
const getWidthAndHeight = (data) => {
return data
.filter((item) => item.active)
.map(({ width, height }) => {
return { width, height };
})[0];
};
const displayComput = () => {
if (styleScale.active) {
return { display: 'inline-block' };
......
......@@ -34,8 +34,9 @@
}
&-contaner {
width: 100%;
height: 90%;
height: 85%;
overflow: scroll;
overflow-x: hidden;
ul {
display: flex;
flex-wrap: wrap;
......
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