修复脚本管理编辑交互,修复ico无法加载

This commit is contained in:
hanhh
2021-08-19 23:46:26 +08:00
parent f86892cef0
commit d9a9d2ee4f
20 changed files with 50 additions and 35 deletions
+2 -3
View File
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react';
import { useState, useEffect, useMemo } from 'react';
import browserType from './browser';
export const useCtx = () => {
@@ -6,10 +6,9 @@ export const useCtx = () => {
const [marginLeft, setMarginLeft] = useState(0);
const [marginTop, setMarginTop] = useState(-72);
const [isPhone, setIsPhone] = useState(false);
const { platform } = useMemo(() => browserType(), []);
useEffect(() => {
const { platform } = browserType();
if (platform === 'mobile' || document.body.offsetWidth < 768) {
setWidth('auto');
setMarginLeft(0);