diff --git a/packages/buitar/src/components/portal/portal-modal.module.scss b/packages/buitar/src/components/portal/portal-modal.module.scss
index 04afb15..0d36936 100644
--- a/packages/buitar/src/components/portal/portal-modal.module.scss
+++ b/packages/buitar/src/components/portal/portal-modal.module.scss
@@ -4,7 +4,8 @@
max-height: 92vh;
overflow-y: scroll;
background: $gray-01;
- padding: $btn-margin;
+ padding: calc($btn-margin * 2);
+ border-radius: calc($btn-margin * 4);
.modal-options {
display: flex;
@@ -13,6 +14,7 @@
:global(.primary-button) {
height: calc($btn-size);
flex: 1;
+ border-radius: calc($btn-margin * 3);
}
}
diff --git a/packages/buitar/src/components/slide-menu/slide-item.component.tsx b/packages/buitar/src/components/slide-menu/slide-item.component.tsx
index da9967c..8a35e42 100644
--- a/packages/buitar/src/components/slide-menu/slide-item.component.tsx
+++ b/packages/buitar/src/components/slide-menu/slide-item.component.tsx
@@ -1,31 +1,32 @@
-import { useCallback, useMemo, useState } from 'react'
-import { Link, useLocation, useNavigate } from 'react-router-dom'
-import { Icon } from '@/components/icon'
-import { useConfigContext } from './index'
+import { useCallback, useState, memo } from 'react'
+import { Link, useLocation } from 'react-router-dom'
+import { Icon, Modal, toast } from '@/components'
import { routeConfig } from '@/pages/router'
-import { menuConfig } from './config-provider/menu-config'
-import { Switch } from '../index'
+// import { useConfigContext } from './index'
+// import { menuConfig } from './config-provider/menu-config'
import { clearStore } from '@/utils/hooks/use-store'
-import { useRouteFind, useRouteMatch } from '@/utils/hooks/use-routers'
+import { useRouteFind } from '@/utils/hooks/use-routers'
import { useIsMobile } from '@/utils/hooks/use-device'
import cx from 'classnames'
import styles from './slide-item.module.scss'
-export const SlideMenu = () => {
- const { menus, dispatchMenus } = useConfigContext()
+export const SlideMenu = memo(() => {
+ // const { menus, dispatchMenus } = useConfigContext()
const { pathname } = useLocation()
- const navigate = useNavigate()
const [extend, setExtend] = useState
(false)
- const curRoute = useRouteMatch()
+ const [cleanStoreVisible, setCleanStoreVisible] = useState(false)
const homeRoute = useRouteFind('Home')
- const showBack = useMemo(() => !!curRoute?.meta?.back, [curRoute])
const isMobile = useIsMobile()
const toggleExtend = useCallback(() => {
setExtend(!extend)
}, [extend])
+ const toggleCleanStoreVisible = useCallback(() => {
+ setCleanStoreVisible(!cleanStoreVisible)
+ }, [cleanStoreVisible])
+
const header = (
Buitar
@@ -44,7 +45,7 @@ export const SlideMenu = () => {
)}
>
{route.meta?.icon && }
- {extend && {route.name}
}
+ {route.name}
))
@@ -61,83 +62,72 @@ export const SlideMenu = () => {
)}
onClick={() => setExtend(false)}
>
- {route.meta?.icon && }
+ {route.meta?.icon && }
{route.name}
))
- // 侧边栏设置项
- // const options = menuConfig.map((item, index) => {
- // const checked = !!menus[item.key]
- // return (
- //
- // {item.name}
- // {
- // dispatchMenus({ type: 'set', payload: { [item.key]: value } })
- // }}
- // />
- //
- // )
- // })
- // options.push(
- //
- // 重置
- // 清理缓存
- //
- // )
- // options.unshift()
-
- const footer = (
- ,
+
+
+
清理
+
{
+ toggleCleanStoreVisible()
+ clearStore()
+ toast('清理完成')
+ }}
>
-
- Github
-
+ 确认清理 Buitar 数据?
+
+
,
+
+
+ Github
+ ,
+ ]
+
+ const pcTrigger = (
+
+
+
+ )
+
+ const mobileTrigger = (
+
+
)
return (
-