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

chore: 返回窗口样式

parent db729342
......@@ -20,13 +20,13 @@ const Header = (props) => {
let name;
setShowIcon(!icon);
showIcon ? (name = 'large') : (name = 'middle');
changeStyle({ name });
windowChange({ name });
let windowStyle = changeStyle({ name });
windowChange({ name, ...windowStyle });
};
const getWindowStatus = (flag) => {
setWindowStatus(flag);
changeScale(flag);
smallChange({ flag });
let scaleStyle = changeScale(flag);
smallChange({ flag, ...scaleStyle });
};
const iconStyle = () => {
if (windowStatus) {
......
......@@ -34,7 +34,7 @@ const TipTool = (props) => {
};
const [styleState, setStyleState] = useState(data);
const [styleScale, setScaleState] = useState(scale);
const changeStyle = ({ name, flag }) => {
const changeStyle = ({ name }) => {
let data = styleState.slice();
data.map((item) => {
if (name == item.name) {
......@@ -44,12 +44,18 @@ const TipTool = (props) => {
}
});
setStyleState(data);
return data
.filter((item) => item.active)
.map(({ width, height }) => {
return { width, height };
})[0];
};
const changeScale = (flag) => {
let obj = { ...styleScale };
obj.active = flag;
setScaleState(obj);
return { height: obj.height, width: obj.width };
};
const computedStyle = () => {
......
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