add tooltip
Some checks are pending
Build / windows (arm64) (push) Waiting to run
Build / windows (ia32) (push) Waiting to run
Build / windows (x64) (push) Waiting to run
Build / windows7 (ia32) (push) Waiting to run
Build / windows7 (x64) (push) Waiting to run
Build / linux (arm64) (push) Waiting to run
Build / linux (x64) (push) Waiting to run
Build / macos (arm64) (push) Waiting to run
Build / macos (x64) (push) Waiting to run
Build / updater (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-bin) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron-bin) (push) Blocked by required conditions
Build / aur-git-updater (push) Waiting to run
Build / Update WinGet Package (push) Blocked by required conditions
Build / Update Homebrew cask (push) Blocked by required conditions

This commit is contained in:
pompurin404 2024-09-26 15:50:49 +08:00
parent 6eab062ff1
commit 3e723297fb
No known key found for this signature in database
2 changed files with 39 additions and 36 deletions

View File

@ -8,7 +8,8 @@ import {
DropdownItem,
DropdownMenu,
DropdownTrigger,
Progress
Progress,
Tooltip
} from '@nextui-org/react'
import { calcPercent, calcTraffic } from '@renderer/utils/calc'
import { IoMdMore, IoMdRefresh } from 'react-icons/io'
@ -192,24 +193,25 @@ const ProfileItem: React.FC<Props> = (props) => {
</h3>
<div className="flex">
{info.type === 'remote' && (
<Button
isIconOnly
size="sm"
variant="light"
color="default"
title={dayjs(info.updated).fromNow()}
disabled={updating}
onPress={async () => {
setUpdating(true)
await addProfileItem(info)
setUpdating(false)
}}
>
<IoMdRefresh
<Tooltip placement="left" content={dayjs(info.updated).fromNow()}>
<Button
isIconOnly
size="sm"
variant="light"
color="default"
className={`${isCurrent ? 'text-white' : 'text-foreground'} text-[24px] ${updating ? 'animate-spin' : ''}`}
/>
</Button>
disabled={updating}
onPress={async () => {
setUpdating(true)
await addProfileItem(info)
setUpdating(false)
}}
>
<IoMdRefresh
color="default"
className={`${isCurrent ? 'text-white' : 'text-foreground'} text-[24px] ${updating ? 'animate-spin' : ''}`}
/>
</Button>
</Tooltip>
)}
<Dropdown>

View File

@ -1,4 +1,4 @@
import { Button, Card, CardBody, CardFooter, Chip, Progress } from '@nextui-org/react'
import { Button, Card, CardBody, CardFooter, Chip, Progress, Tooltip } from '@nextui-org/react'
import { useProfileConfig } from '@renderer/hooks/use-profile-config'
import { useLocation } from 'react-router-dom'
import { calcTraffic, calcPercent } from '@renderer/utils/calc'
@ -95,23 +95,24 @@ const ProfileCard: React.FC = () => {
/>
</Button>
{info.type === 'remote' && (
<Button
isIconOnly
size="sm"
title={dayjs(info.updated).fromNow()}
disabled={updating}
variant="light"
color="default"
onPress={async () => {
setUpdating(true)
await addProfileItem(info)
setUpdating(false)
}}
>
<IoMdRefresh
className={`text-[24px] ${match ? 'text-white' : 'text-foreground'} ${updating ? 'animate-spin' : ''}`}
/>
</Button>
<Tooltip placement="left" content={dayjs(info.updated).fromNow()}>
<Button
isIconOnly
size="sm"
disabled={updating}
variant="light"
color="default"
onPress={async () => {
setUpdating(true)
await addProfileItem(info)
setUpdating(false)
}}
>
<IoMdRefresh
className={`text-[24px] ${match ? 'text-white' : 'text-foreground'} ${updating ? 'animate-spin' : ''}`}
/>
</Button>
</Tooltip>
)}
</div>
</div>