Skip to content

Commit 9781deb

Browse files
committed
fix: mobile view
1 parent 141121f commit 9781deb

2 files changed

Lines changed: 29 additions & 12 deletions

File tree

src/lib/components/variables/environmentVariables.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
const tableColumns = $derived(
6767
$isSmallViewport
6868
? [
69-
{ id: 'key', width: { min: 360 } },
70-
{ id: 'value', width: { min: 220 } },
69+
{ id: 'key', width: { min: 420 } },
70+
{ id: 'value', width: { min: 240 } },
7171
{ id: 'actions', width: 40 }
7272
]
7373
: [
@@ -82,8 +82,8 @@
8282
<Layout.Stack gap="xl">
8383
Set up environment variables to securely manage keys and settings for your project.
8484
<Layout.Stack gap="l">
85-
<Layout.Stack direction="row" gap="s" wrap="wrap">
86-
<Layout.Stack direction="row" gap="s" wrap="wrap">
85+
<Layout.Stack direction="row" gap="s">
86+
<Layout.Stack direction="row" gap="s">
8787
<Button
8888
secondary
8989
size="s"
@@ -146,7 +146,7 @@
146146
{:else if variables?.length}
147147
<Paginator items={variables} limit={6} hideFooter={variables.length <= 6}>
148148
{#snippet children(paginatedItems)}
149-
<Table.Root let:root columns={tableColumns}>
149+
<Table.Root class="responsive-table" let:root columns={tableColumns}>
150150
<svelte:fragment slot="header" let:root>
151151
<Table.Header.Cell column="key" {root}>Key</Table.Header.Cell>
152152
<Table.Header.Cell column="value" {root}>Value</Table.Header.Cell>

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

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,12 @@
270270
271271
$: variableColumns = $isSmallViewport
272272
? [
273-
{ id: 'key', width: { min: 320, max: 480 } },
274-
{ id: 'value', width: { min: 180, max: 320 } },
273+
{ id: 'key', width: { min: 380, max: 520 } },
274+
{ id: 'value', width: { min: 200, max: 320 } },
275275
{ id: 'actions', width: 50 }
276276
]
277277
: [
278-
{ id: 'key', width: { min: 200, max: 400 } },
278+
{ id: 'key', width: { min: 280, max: 420 } },
279279
{ id: 'value', width: { min: 200, max: 400 } },
280280
{ id: 'actions', width: 50 }
281281
];
@@ -301,8 +301,8 @@
301301
{/if}
302302
<svelte:fragment slot="aside">
303303
<Layout.Stack gap="l">
304-
<Layout.Stack direction="row" gap="s" wrap="wrap">
305-
<Layout.Stack direction="row" gap="s" wrap="wrap">
304+
<Layout.Stack direction="row" gap="s" wrap={$isSmallViewport ? 'wrap' : 'nowrap'}>
305+
<Layout.Stack direction="row" gap="s" wrap={$isSmallViewport ? 'wrap' : 'nowrap'}>
306306
<Button
307307
secondary
308308
on:mousedown={() => {
@@ -358,7 +358,7 @@
358358
</p>
359359
</Alert.Inline>
360360
{/if}
361-
<Table.Root columns={variableColumns} let:root>
361+
<Table.Root class="responsive-table" columns={variableColumns} let:root>
362362
<svelte:fragment slot="header" let:root>
363363
<Table.Header.Cell column="key" {root}>Key</Table.Header.Cell>
364364
<Table.Header.Cell column="value" {root}>Value</Table.Header.Cell>
@@ -373,7 +373,11 @@
373373
) !== undefined
374374
: false}
375375

376-
<Layout.Stack gap="xxs" alignItems="center" direction="row">
376+
<Layout.Stack
377+
gap="xxs"
378+
alignItems="center"
379+
direction="row"
380+
class="variable-key-cell">
377381
{#if isConflicting && hasConflictOnPage}
378382
<span
379383
class="icon-exclamation u-color-text-warning"
@@ -533,3 +537,16 @@
533537
<p>Are you sure you want to delete this variable? This action is irreversible.</p>
534538
</Confirm>
535539
{/if}
540+
541+
<style>
542+
:global(.variable-key-cell) {
543+
min-width: 0;
544+
}
545+
546+
:global(.variable-key-cell > :last-child) {
547+
min-width: 0;
548+
overflow: hidden;
549+
text-overflow: ellipsis;
550+
white-space: nowrap;
551+
}
552+
</style>

0 commit comments

Comments
 (0)