mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: card contaner, disable card instead of removing it
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import { isCloud } from '$lib/system';
|
||||
import CardPlanLimit from './cardPlanLimit.svelte';
|
||||
|
||||
export let showEmpty = true;
|
||||
export let disableEmpty = true;
|
||||
export let offset = 0;
|
||||
export let total = 0;
|
||||
export let event: string = null;
|
||||
@@ -25,8 +25,8 @@
|
||||
{#if total > 3 ? total < limit + offset : total % 2 !== 0}
|
||||
{#if isCloud && serviceId && total >= planLimit}
|
||||
<CardPlanLimit {service} />
|
||||
{:else if showEmpty}
|
||||
<Empty on:click target={event}>
|
||||
{:else}
|
||||
<Empty on:click target={event} disabled={disableEmpty}>
|
||||
<slot name="empty" />
|
||||
</Empty>
|
||||
{/if}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
export let href: string = null;
|
||||
export let allowCreate = true;
|
||||
export let description = 'Need a hand? Learn more in our documentation.';
|
||||
export let disabled = false;
|
||||
export let src: string = null;
|
||||
|
||||
function track() {
|
||||
@@ -47,7 +48,7 @@
|
||||
</Empty>
|
||||
</Card.Base>
|
||||
{:else}
|
||||
<Card.Button on:click on:click={track} aria-label="create">
|
||||
<Card.Button on:click on:click={track} aria-label="create" {disabled}>
|
||||
<Layout.Stack justifyContent="center" alignItems="center" gap="m">
|
||||
<Avatar size="s"><Icon icon={IconPlus} size="s" /></Avatar>
|
||||
<Typography.Text variation="m-400" align="center"><slot /></Typography.Text>
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
{#if data.projects.total}
|
||||
<CardContainer
|
||||
showEmpty={$canWriteProjects}
|
||||
disableEmpty={!$canWriteProjects}
|
||||
total={data.projects.total}
|
||||
offset={data.offset}
|
||||
on:click={handleCreateProject}>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</script>
|
||||
|
||||
<CardContainer
|
||||
showEmpty={$canWriteCollections}
|
||||
disableEmpty={!$canWriteCollections}
|
||||
total={data.collections.total}
|
||||
on:click={() => (showCreate = true)}
|
||||
event="collection">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</script>
|
||||
|
||||
<CardContainer
|
||||
showEmpty={$canWriteDatabases}
|
||||
disableEmpty={!$canWriteDatabases}
|
||||
total={data.databases.total}
|
||||
on:click={() => (showCreate = true)}
|
||||
event="database"
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
{#if data.functions.total}
|
||||
<CardContainer
|
||||
{offset}
|
||||
showEmpty={$canWriteFunctions}
|
||||
disableEmpty={!$canWriteFunctions}
|
||||
event="functions"
|
||||
total={data.functions.total}
|
||||
service="functions"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</script>
|
||||
|
||||
<CardContainer
|
||||
showEmpty={$canWriteBuckets}
|
||||
disableEmpty={!$canWriteBuckets}
|
||||
total={data.buckets.total}
|
||||
offset={data.offset}
|
||||
event="bucket"
|
||||
|
||||
Reference in New Issue
Block a user