Skip to content

Commit 0b7a64c

Browse files
Update table column types and adjust payment layouts
The changes include typing updates for table columns and layout improvements for payment history and methods pages, with better handling of payment error states and responsive column widths.
1 parent 3f3af27 commit 0b7a64c

File tree

5 files changed

+38
-19
lines changed

5 files changed

+38
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@appwrite.io/pink-icons": "0.25.0",
2727
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
2828
"@appwrite.io/pink-legacy": "^1.0.3",
29-
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778",
29+
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@267da11",
3030
"@popperjs/core": "^2.11.8",
3131
"@sentry/sveltekit": "^8.38.0",
3232
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

Lines changed: 25 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/helpers/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export type TableRootProp = {
6060
selectedAll: boolean;
6161
selectedNone: boolean;
6262
selectedSome: boolean;
63-
columns: Record<PinkColumn['id'], PinkColumn>;
63+
columns: Array<Column> | number;
64+
columnsMap: Record<Column['id'], Column>;
6465
toggle: (id: string) => void;
6566
toggleAll: () => void;
6667
addAvailableId: (id: string) => void;

src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
$: if (offset !== null) {
6262
request();
6363
}
64+
65+
$: hasPaymentError = invoiceList?.invoices.some((invoice) => invoice?.lastError);
6466
</script>
6567

6668
<CardGrid>
@@ -71,8 +73,8 @@
7173
<Table.Root
7274
let:root
7375
columns={[
74-
{ id: 'dueDate' },
75-
{ id: 'status', width: { min: 200 } },
76+
{ id: 'dueDate', width: { min: 120 } },
77+
{ id: 'status', width: { min: hasPaymentError ? 200 : 100 } },
7678
{ id: 'amount', width: { min: 120 } },
7779
{ id: 'action', width: 40 }
7880
]}>
@@ -162,10 +164,10 @@
162164
{/each}
163165
</Table.Root>
164166
{#if invoiceList.total > limit}
165-
<div class="u-flex u-main-space-between">
167+
<Layout.Stack direction="row" justifyContent="space-between" alignItems="center">
166168
<p class="text">Total results: {invoiceList.total}</p>
167169
<PaginationInline {limit} bind:offset total={invoiceList.total} hidePages />
168-
</div>
170+
</Layout.Stack>
169171
{/if}
170172
{:else}
171173
<Card.Base>

src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@
115115
<Table.Root
116116
let:root
117117
columns={[
118-
{ id: 'cc', width: 140 },
118+
{ id: 'cc', width: { min: 155 } },
119119
{ id: 'name', width: { min: 140 } },
120-
{ id: 'expiry', width: 100 },
121-
{ id: 'status', width: 110, hide: !hasPaymentError },
120+
{ id: 'expiry', width: { min: 75 } },
121+
{ id: 'status', width: { min: 110 }, hide: !hasPaymentError },
122122
{ id: 'actions', width: 40 }
123123
]}>
124124
<svelte:fragment slot="header" let:root>
125125
<Table.Header.Cell column="cc" {root}>Credit card</Table.Header.Cell>
126126
<Table.Header.Cell column="name" {root}>Name</Table.Header.Cell>
127-
<Table.Header.Cell column="expiry" {root}>Expiration date</Table.Header.Cell>
127+
<Table.Header.Cell column="expiry" {root}>Expiration</Table.Header.Cell>
128128
<Table.Header.Cell column="status" {root} />
129129
<Table.Header.Cell column="actions" {root} />
130130
</svelte:fragment>

0 commit comments

Comments
 (0)