chore: edit vault modal ui fixes
This commit is contained in:
@@ -221,14 +221,16 @@ const EditVaultModal: FunctionComponent<Props> = ({ onCloseDialog, existingVault
|
|||||||
setShouldShowIconPicker((shouldShow) => !shouldShow)
|
setShouldShowIconPicker((shouldShow) => !shouldShow)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const canShowMembers =
|
||||||
|
members.length > 0 && !members.every((member) => application.vaultUsers.isVaultUserOwner(member))
|
||||||
|
|
||||||
if (existingVault && application.vaultLocks.isVaultLocked(existingVault)) {
|
if (existingVault && application.vaultLocks.isVaultLocked(existingVault)) {
|
||||||
return <div>Vault is locked.</div>
|
return <div>Vault is locked.</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal title={existingVault ? 'Edit Vault' : 'Create New Vault'} close={handleDialogClose} actions={modalActions}>
|
<Modal title={existingVault ? 'Edit Vault' : 'Create New Vault'} close={handleDialogClose} actions={modalActions}>
|
||||||
<div className="px-4.5 pb-1.5 pt-4">
|
<div className="px-4.5 pb-1.5 pt-4 flex w-full flex-col">
|
||||||
<div className="flex w-full flex-col">
|
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<div className="text-lg">Vault Info</div>
|
<div className="text-lg">Vault Info</div>
|
||||||
<div className="mt-1">The vault name and description are end-to-end encrypted.</div>
|
<div className="mt-1">The vault name and description are end-to-end encrypted.</div>
|
||||||
@@ -283,7 +285,7 @@ const EditVaultModal: FunctionComponent<Props> = ({ onCloseDialog, existingVault
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{existingVault && (
|
{existingVault && canShowMembers && (
|
||||||
<VaultModalMembers vault={existingVault} members={members} onChange={reloadVaultInfo} isAdmin={isAdmin} />
|
<VaultModalMembers vault={existingVault} members={members} onChange={reloadVaultInfo} isAdmin={isAdmin} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -291,15 +293,10 @@ const EditVaultModal: FunctionComponent<Props> = ({ onCloseDialog, existingVault
|
|||||||
<VaultModalInvites invites={invites} onChange={reloadVaultInfo} isAdmin={isAdmin} />
|
<VaultModalInvites invites={invites} onChange={reloadVaultInfo} isAdmin={isAdmin} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<PasswordTypePreference
|
<PasswordTypePreference value={passwordType} onChange={setPasswordType} onCustomKeyChange={setCustomPassword} />
|
||||||
value={passwordType}
|
|
||||||
onChange={setPasswordType}
|
|
||||||
onCustomKeyChange={setCustomPassword}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<KeyStoragePreference value={keyStorageMode} onChange={setKeyStorageMode} />
|
<KeyStoragePreference value={keyStorageMode} onChange={setKeyStorageMode} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export const VaultModalInvites = ({
|
|||||||
return (
|
return (
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<div className="mb-3 text-lg">Pending Invites</div>
|
<div className="mb-3 text-lg">Pending Invites</div>
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
{invites.map((invite) => {
|
{invites.map((invite) => {
|
||||||
const contact = application.contacts.findContactForInvite(invite)
|
const contact = application.contacts.findContactForInvite(invite)
|
||||||
return (
|
return (
|
||||||
@@ -46,7 +47,6 @@ export const VaultModalInvites = ({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button label="Cancel Invite" className="mt-1 mr-3 text-xs" onClick={() => deleteInvite(invite)} />
|
<Button label="Cancel Invite" className="mt-1 mr-3 text-xs" onClick={() => deleteInvite(invite)} />
|
||||||
)}
|
)}
|
||||||
@@ -55,5 +55,6 @@ export const VaultModalInvites = ({
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user