chore: hide collaboration options if no account
This commit is contained in:
@@ -27,6 +27,8 @@ import NoProSubscription from '../Account/NoProSubscription'
|
|||||||
const Vaults = () => {
|
const Vaults = () => {
|
||||||
const application = useApplication()
|
const application = useApplication()
|
||||||
|
|
||||||
|
const hasAccount = application.hasAccount()
|
||||||
|
|
||||||
const [vaults, setVaults] = useState<VaultListingInterface[]>([])
|
const [vaults, setVaults] = useState<VaultListingInterface[]>([])
|
||||||
const [canCreateMoreVaults, setCanCreateMoreVaults] = useState(true)
|
const [canCreateMoreVaults, setCanCreateMoreVaults] = useState(true)
|
||||||
const [invites, setInvites] = useState<InviteRecord[]>([])
|
const [invites, setInvites] = useState<InviteRecord[]>([])
|
||||||
@@ -140,6 +142,7 @@ const Vaults = () => {
|
|||||||
</PreferencesGroup>
|
</PreferencesGroup>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{hasAccount && (
|
||||||
<PreferencesGroup>
|
<PreferencesGroup>
|
||||||
<PreferencesSegment>
|
<PreferencesSegment>
|
||||||
<Title>Contacts</Title>
|
<Title>Contacts</Title>
|
||||||
@@ -155,6 +158,7 @@ const Vaults = () => {
|
|||||||
</div>
|
</div>
|
||||||
</PreferencesSegment>
|
</PreferencesSegment>
|
||||||
</PreferencesGroup>
|
</PreferencesGroup>
|
||||||
|
)}
|
||||||
|
|
||||||
<PreferencesGroup>
|
<PreferencesGroup>
|
||||||
<PreferencesSegment>
|
<PreferencesSegment>
|
||||||
@@ -181,6 +185,7 @@ const Vaults = () => {
|
|||||||
</PreferencesSegment>
|
</PreferencesSegment>
|
||||||
</PreferencesGroup>
|
</PreferencesGroup>
|
||||||
|
|
||||||
|
{hasAccount && (
|
||||||
<PreferencesGroup>
|
<PreferencesGroup>
|
||||||
<PreferencesSegment>
|
<PreferencesSegment>
|
||||||
<Title>CollaborationID</Title>
|
<Title>CollaborationID</Title>
|
||||||
@@ -221,6 +226,7 @@ const Vaults = () => {
|
|||||||
)}
|
)}
|
||||||
</PreferencesSegment>
|
</PreferencesSegment>
|
||||||
</PreferencesGroup>
|
</PreferencesGroup>
|
||||||
|
)}
|
||||||
</PreferencesPane>
|
</PreferencesPane>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ const VaultItem = ({ vault }: Props) => {
|
|||||||
<EditVaultModal existingVaultUuid={vault.uuid} onCloseDialog={closeVaultModal} />
|
<EditVaultModal existingVaultUuid={vault.uuid} onCloseDialog={closeVaultModal} />
|
||||||
</ModalOverlay>
|
</ModalOverlay>
|
||||||
|
|
||||||
<div className="flex flex-row gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow">
|
<div className="flex flex-row gap-3.5 rounded-lg border border-border px-3.5 py-2.5 shadow-sm">
|
||||||
<Icon type={vault.iconString} size="custom" className="mt-2.5 h-5.5 w-5.5 flex-shrink-0" />
|
<Icon type={vault.iconString} size="custom" className="mt-2.5 h-5.5 w-5.5 flex-shrink-0" />
|
||||||
<div className="flex flex-col gap-1.5 py-1.5">
|
<div className="flex flex-col gap-1.5 py-1.5">
|
||||||
<span className="mr-auto overflow-hidden text-ellipsis text-base font-bold">{vault.name}</span>
|
<span className="mr-auto overflow-hidden text-ellipsis text-base font-bold">{vault.name}</span>
|
||||||
@@ -164,14 +164,14 @@ const VaultItem = ({ vault }: Props) => {
|
|||||||
)}
|
)}
|
||||||
{vault.isSharedVaultListing() ? (
|
{vault.isSharedVaultListing() ? (
|
||||||
<Button colorStyle="info" label="Invite Contacts" className="text-xs" onClick={openInviteModal} />
|
<Button colorStyle="info" label="Invite Contacts" className="text-xs" onClick={openInviteModal} />
|
||||||
) : (
|
) : application.hasAccount() ? (
|
||||||
<Button
|
<Button
|
||||||
colorStyle="info"
|
colorStyle="info"
|
||||||
label="Enable Collaboration"
|
label="Enable Collaboration"
|
||||||
className="text-xs"
|
className="text-xs"
|
||||||
onClick={convertToSharedVault}
|
onClick={convertToSharedVault}
|
||||||
/>
|
/>
|
||||||
)}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user