Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
feat: ✨ add miniMenu hover tips
Browse files Browse the repository at this point in the history
  • Loading branch information
AruSeito committed Apr 10, 2024
1 parent f02a780 commit f9c2b66
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
45 changes: 35 additions & 10 deletions apps/agent/src/Layout/Workspace/pc/modules/Menu/MiniMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Icon from "@ant-design/icons"
import { Button, Divider, Tooltip } from "antd"
import { Button, ConfigProvider, Divider, Tooltip } from "antd"
import { FC, useCallback, useContext } from "react"
import { useTranslation } from "react-i18next"
import { TipisTrack } from "@illa-public/track-utils"
import UserInfoContent from "@/Layout/Workspace/components/UserInfoContent"
import RecentTabs from "@/Layout/Workspace/modules/RecentTabs"
Expand All @@ -21,6 +22,8 @@ import {
const MiniMenu: FC = () => {
const { changeCollapsed } = useContext(MenuStatusUIContext)

const { t } = useTranslation()

const onClickFoldButton = useCallback(() => {
TipisTrack.track("click_collapse")

Expand All @@ -36,7 +39,7 @@ const MiniMenu: FC = () => {
</div>
<div css={miniMenuLockSideBarContainerStyle}>
<Tooltip
title="展開"
title={t("homepage.left_panel.tab.expand_menu")}
placement="right"
align={{
offset: [16, 0],
Expand All @@ -50,21 +53,43 @@ const MiniMenu: FC = () => {
</Tooltip>
</div>
<div css={dividerContainerStyle}>
<Divider
style={{
margin: "0",
<ConfigProvider
theme={{
components: {
Divider: {
textPaddingInline: 0,
colorSplit: "rgba(16, 9, 116, 0.08);",
},
},
}}
/>
>
<Divider
style={{
margin: "0",
}}
/>
</ConfigProvider>
</div>
<RecentTabs isMiniSize />
</div>
<div css={miniMenuFooterContainerStyle}>
<div css={dividerContainerStyle}>
<Divider
style={{
margin: "0",
<ConfigProvider
theme={{
components: {
Divider: {
textPaddingInline: 0,
colorSplit: "rgba(16, 9, 116, 0.08);",
},
},
}}
/>
>
<Divider
style={{
margin: "0",
}}
/>
</ConfigProvider>
</div>
<div css={userInfoContainerStyle}>
<UserInfoContent isMiniSize />
Expand Down
1 change: 1 addition & 0 deletions apps/agent/src/Layout/Workspace/pc/modules/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const PCWorkspaceMenu: FC = () => {
components: {
Divider: {
textPaddingInline: 0,
colorSplit: "rgba(16, 9, 116, 0.08);",
},
},
}}
Expand Down
22 changes: 16 additions & 6 deletions apps/agent/src/Layout/Workspace/pc/modules/MenuHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Icon from "@ant-design/icons"
import { Button } from "antd"
import { Button, Tooltip } from "antd"
import { FC, useCallback, useContext } from "react"
import { useTranslation } from "react-i18next"
import { TipisTrack } from "@illa-public/track-utils"
import TextAndLogo from "@/assets/public/textLogo.svg?react"
import MenuCollapseIcon from "@/assets/workspace/menuCollapse.svg?react"
Expand All @@ -9,6 +10,7 @@ import { logoAndProjectNameContainerStyle, menuHeaderStyle } from "./style"

const MenuHeader: FC = () => {
const { changeCollapsed } = useContext(MenuStatusUIContext)
const { t } = useTranslation()

const onClickFoldButton = useCallback(() => {
TipisTrack.track("click_collapse")
Expand All @@ -22,11 +24,19 @@ const MenuHeader: FC = () => {
<TextAndLogo />
</div>
<div>
<Button
icon={<Icon component={MenuCollapseIcon} />}
type="text"
onClick={onClickFoldButton}
/>
<Tooltip
title={t("homepage.left_panel.tab.collapse_menu")}
placement="right"
align={{
offset: [24, 0],
}}
>
<Button
icon={<Icon component={MenuCollapseIcon} />}
type="text"
onClick={onClickFoldButton}
/>
</Tooltip>
</div>
</div>
)
Expand Down

0 comments on commit f9c2b66

Please sign in to comment.