From 1408de55d2a8c6a4873ccdd63271464cb64eccb0 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 25 Oct 2021 23:15:25 +0800 Subject: [PATCH] feat(client): tooltip for designable button --- .../src/components/admin-layout/index.tsx | 60 +++++++++++++++---- .../src/components/admin-layout/style.less | 3 + 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/packages/client/src/components/admin-layout/index.tsx b/packages/client/src/components/admin-layout/index.tsx index 98dc3e1ea..e1cc1331e 100644 --- a/packages/client/src/components/admin-layout/index.tsx +++ b/packages/client/src/components/admin-layout/index.tsx @@ -50,19 +50,59 @@ import { MenuSelectedKeysContext } from '../../schemas/menu'; function DesignableToggle() { const { designable, setDesignable } = useDesignableSwitchContext(); + const [visible, setVisible] = useState(false); + useEffect(() => { + if (designable) { + return; + } + if (localStorage.getItem('hide-tip')) { + return; + } + setTimeout(() => { + setVisible(true); + }, 2000); + }, []); return ( - - - + + + + + + ); } diff --git a/packages/client/src/components/admin-layout/style.less b/packages/client/src/components/admin-layout/style.less index 379880a75..067a6dc4c 100644 --- a/packages/client/src/components/admin-layout/style.less +++ b/packages/client/src/components/admin-layout/style.less @@ -70,6 +70,9 @@ &.active { // background: #faad14 !important; } + &.has-tip { + background: #f18b62 !important; + } } .user-info {