diff --git a/web/app/components/explore/sidebar/index.tsx b/web/app/components/explore/sidebar/index.tsx index c936029fea..a37962d857 100644 --- a/web/app/components/explore/sidebar/index.tsx +++ b/web/app/components/explore/sidebar/index.tsx @@ -13,7 +13,8 @@ import Confirm from '@/app/components/base/confirm' import Divider from '@/app/components/base/divider' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import { useGetInstalledApps, useUninstallApp, useUpdateAppPinStatus } from '@/service/use-explore' -import { RiAppsFill } from '@remixicon/react' +import { RiAppsFill, RiExpandRightLine, RiLayoutLeft2Line } from '@remixicon/react' +import { useBoolean } from 'ahooks' export type IExploreSideBarProps = { controlUpdateInstalledApps: number @@ -33,6 +34,9 @@ const SideBar: FC = ({ const media = useBreakpoints() const isMobile = media === MediaType.mobile + const [isFold, { + toggle: toggleIsFold, + }] = useBoolean(false) const [showConfirm, setShowConfirm] = useState(false) const [currId, setCurrId] = useState('') @@ -72,7 +76,7 @@ const SideBar: FC = ({ const pinnedAppsCount = installedApps.filter(({ is_pinned }) => is_pinned).length return ( -
+
= ({
- {!isMobile &&
{t('explore.sidebar.title')}
} + {!isMobile && !isFold &&
{t('explore.sidebar.title')}
} {installedApps.length > 0 && (
-

{t('explore.sidebar.webApps')}

+ {!isMobile && !isFold &&

{t('explore.sidebar.webApps')}

}
= ({ {installedApps.map(({ id, is_pinned, uninstallable, app: { name, icon_type, icon, icon_url, icon_background } }, index) => ( = ({
)} + + {!isMobile && ( +
+ {isFold ? : ( + + )} +
+ )} + {showConfirm && (