mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 11:42:19 +08:00
adjust the switching area
This commit is contained in:
parent
558b9e7c30
commit
c4047ff57a
|
@ -243,21 +243,27 @@ const ProfileItem: React.FC<Props> = (props) => {
|
|||
</div>
|
||||
{info.type === 'remote' && extra && (
|
||||
<div
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
patchAppConfig({
|
||||
profileDisplayDate: profileDisplayDate === 'expire' ? 'update' : 'expire'
|
||||
})
|
||||
}}
|
||||
className={`mt-2 flex justify-between ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`}
|
||||
>
|
||||
<small>{`${calcTraffic(usage)}/${calcTraffic(total)}`}</small>
|
||||
{profileDisplayDate === 'expire' ? (
|
||||
<small>
|
||||
<small
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
patchAppConfig({ profileDisplayDate: 'update' })
|
||||
}}
|
||||
>
|
||||
{extra.expire ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : '长期有效'}
|
||||
</small>
|
||||
) : (
|
||||
<small>{dayjs(info.updated).fromNow()}</small>
|
||||
<small
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
patchAppConfig({ profileDisplayDate: 'expire' })
|
||||
}}
|
||||
>
|
||||
{dayjs(info.updated).fromNow()}
|
||||
</small>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue
Block a user