From c4047ff57a2b649fa3acdfa0579bde0babad64a2 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Sun, 6 Oct 2024 21:42:22 +0800 Subject: [PATCH] adjust the switching area --- .../src/components/profiles/profile-item.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/components/profiles/profile-item.tsx b/src/renderer/src/components/profiles/profile-item.tsx index 92055bf..36c66a7 100644 --- a/src/renderer/src/components/profiles/profile-item.tsx +++ b/src/renderer/src/components/profiles/profile-item.tsx @@ -243,21 +243,27 @@ const ProfileItem: React.FC = (props) => { {info.type === 'remote' && extra && (
{ - e.stopPropagation() - patchAppConfig({ - profileDisplayDate: profileDisplayDate === 'expire' ? 'update' : 'expire' - }) - }} className={`mt-2 flex justify-between ${isCurrent ? 'text-primary-foreground' : 'text-foreground'}`} > {`${calcTraffic(usage)}/${calcTraffic(total)}`} {profileDisplayDate === 'expire' ? ( - + { + e.stopPropagation() + patchAppConfig({ profileDisplayDate: 'update' }) + }} + > {extra.expire ? dayjs.unix(extra.expire).format('YYYY-MM-DD') : '长期有效'} ) : ( - {dayjs(info.updated).fromNow()} + { + e.stopPropagation() + patchAppConfig({ profileDisplayDate: 'expire' }) + }} + > + {dayjs(info.updated).fromNow()} + )}
)}