mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat(core): show expiration time in link invitation dialog (#11610)
close BS-3095
This commit is contained in:
@@ -111,24 +111,42 @@ export const LinkInvite = ({
|
||||
});
|
||||
}, [revokeInvitationLink]);
|
||||
|
||||
const expireTime = useMemo(() => {
|
||||
return t['com.affine.payment.member.team.invite.expire-at']({
|
||||
expireTime: invitationLink?.expireTime
|
||||
? new Date(invitationLink.expireTime).toLocaleString()
|
||||
: '',
|
||||
});
|
||||
}, [invitationLink, t]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.invitationLinkContainer}>
|
||||
<div className={styles.modalSubTitle}>
|
||||
{t['com.affine.payment.member.team.invite.link-expiration']()}
|
||||
</div>
|
||||
<Menu
|
||||
items={items}
|
||||
contentOptions={{
|
||||
style: {
|
||||
width: 'var(--radix-dropdown-menu-trigger-width)',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<MenuTrigger style={{ width: '100%' }}>
|
||||
{currentSelectedLabel}
|
||||
</MenuTrigger>
|
||||
</Menu>
|
||||
{invitationLink ? (
|
||||
<Input
|
||||
value={expireTime}
|
||||
disabled
|
||||
style={{
|
||||
backgroundColor: cssVarV2('input/background'),
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<Menu
|
||||
items={items}
|
||||
contentOptions={{
|
||||
style: {
|
||||
width: 'var(--radix-dropdown-menu-trigger-width)',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<MenuTrigger style={{ width: '100%' }}>
|
||||
{currentSelectedLabel}
|
||||
</MenuTrigger>
|
||||
</Menu>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.invitationLinkContainer}>
|
||||
<div className={styles.modalSubTitle}>
|
||||
|
||||
Reference in New Issue
Block a user