Skip to content

Commit 141121f

Browse files
committed
fixed table in mobile view
1 parent efd7cdb commit 141121f

2 files changed

Lines changed: 32 additions & 16 deletions

File tree

src/lib/components/variables/environmentVariables.svelte

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import DeleteVariableModal from './deleteVariableModal.svelte';
3232
import UpdateVariableModal from './updateVariableModal.svelte';
3333
import { Click, trackEvent } from '$lib/actions/analytics';
34+
import { isSmallViewport } from '$lib/stores/viewport';
3435
3536
const DOCS_LINKS: Record<ProductLabel, string> = {
3637
site: 'https://appwrite.io/docs/products/sites/develop#accessing-environment-variables',
@@ -62,19 +63,27 @@
6263
const createSource = $derived(analyticsCreateSource || analyticsSource);
6364
const docsLink = $derived(DOCS_LINKS[productLabel]);
6465
65-
const tableColumns = [
66-
{ id: 'key', width: { min: 300 } },
67-
{ id: 'value', width: { min: 280 } },
68-
{ id: 'actions', width: 40 }
69-
];
66+
const tableColumns = $derived(
67+
$isSmallViewport
68+
? [
69+
{ id: 'key', width: { min: 360 } },
70+
{ id: 'value', width: { min: 220 } },
71+
{ id: 'actions', width: 40 }
72+
]
73+
: [
74+
{ id: 'key', width: { min: 300 } },
75+
{ id: 'value', width: { min: 280 } },
76+
{ id: 'actions', width: 40 }
77+
]
78+
);
7079
</script>
7180

7281
<Accordion title="Environment variables" badge="Optional" hideDivider>
7382
<Layout.Stack gap="xl">
7483
Set up environment variables to securely manage keys and settings for your project.
7584
<Layout.Stack gap="l">
76-
<Layout.Stack direction="row">
77-
<Layout.Stack direction="row" gap="s">
85+
<Layout.Stack direction="row" gap="s" wrap="wrap">
86+
<Layout.Stack direction="row" gap="s" wrap="wrap">
7887
<Button
7988
secondary
8089
size="s"

src/routes/(console)/project-[region]-[project]/updateVariables.svelte

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import SecretVariableModal from './secretVariableModal.svelte';
4040
import { Confirm } from '$lib/components';
4141
import { resolveRoute, withPath } from '$lib/stores/navigation';
42+
import { isSmallViewport } from '$lib/stores/viewport';
4243
4344
export let project: Models.Project;
4445
export let variableList: Models.VariableList;
@@ -266,6 +267,18 @@
266267
});
267268
})
268269
: false;
270+
271+
$: variableColumns = $isSmallViewport
272+
? [
273+
{ id: 'key', width: { min: 320, max: 480 } },
274+
{ id: 'value', width: { min: 180, max: 320 } },
275+
{ id: 'actions', width: 50 }
276+
]
277+
: [
278+
{ id: 'key', width: { min: 200, max: 400 } },
279+
{ id: 'value', width: { min: 200, max: 400 } },
280+
{ id: 'actions', width: 50 }
281+
];
269282
</script>
270283

271284
<CardGrid>
@@ -288,8 +301,8 @@
288301
{/if}
289302
<svelte:fragment slot="aside">
290303
<Layout.Stack gap="l">
291-
<Layout.Stack direction="row">
292-
<Layout.Stack direction="row" gap="s">
304+
<Layout.Stack direction="row" gap="s" wrap="wrap">
305+
<Layout.Stack direction="row" gap="s" wrap="wrap">
293306
<Button
294307
secondary
295308
on:mousedown={() => {
@@ -345,13 +358,7 @@
345358
</p>
346359
</Alert.Inline>
347360
{/if}
348-
<Table.Root
349-
columns={[
350-
{ id: 'key', width: { min: 200, max: 400 } },
351-
{ id: 'value', width: { min: 200, max: 400 } },
352-
{ id: 'actions', width: 50 }
353-
]}
354-
let:root>
361+
<Table.Root columns={variableColumns} let:root>
355362
<svelte:fragment slot="header" let:root>
356363
<Table.Header.Cell column="key" {root}>Key</Table.Header.Cell>
357364
<Table.Header.Cell column="value" {root}>Value</Table.Header.Cell>

0 commit comments

Comments
 (0)