Skip to content

Commit a1a0094

Browse files
authored
Add disabled prop (#2472)
1 parent 035de27 commit a1a0094

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Diff for: src/lib/pages/nexus-empty-state.svelte

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import { useDarkMode } from '$lib/utilities/dark-mode';
66
import { routeForNexusEndpointCreate } from '$lib/utilities/route-for';
77
import andromeda from '$lib/vendor/andromeda.png';
8+
9+
export let createDisabled = false;
810
</script>
911

1012
<div class="flex min-h-screen flex-col gap-8 p-10">
@@ -35,7 +37,10 @@
3537
a uniform interface to get the status of an operation or its result,
3638
receive a completion callback, or cancel the operation.
3739
</p>
38-
<Button variant="primary" href={routeForNexusEndpointCreate()}
40+
<Button
41+
disabled={createDisabled}
42+
variant="primary"
43+
href={routeForNexusEndpointCreate()}
3944
>{translate('nexus.create-endpoint')}</Button
4045
>
4146
</div>

Diff for: src/lib/pages/nexus-endpoints.svelte

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
2323
export let endpoints: NexusEndpoint[] = [];
2424
export let searchPlaceholder = translate('common.search');
25+
export let createDisabled = false;
2526
2627
let search = '';
2728
$: searchParam = $page.url.searchParams.get('search') || '';
@@ -40,13 +41,16 @@
4041
</script>
4142

4243
{#if !endpoints?.length && !searchParam}
43-
<NexusEmptyState />
44+
<NexusEmptyState {createDisabled} />
4445
{:else}
4546
<div class="mb-8 flex items-center justify-between">
4647
<h1 data-testid="namespace-selector-title">
4748
{translate('nexus.endpoints')}
4849
</h1>
49-
<Button variant="primary" href={routeForNexusEndpointCreate()}
50+
<Button
51+
disabled={createDisabled}
52+
variant="primary"
53+
href={routeForNexusEndpointCreate()}
5054
>{translate('nexus.create-endpoint')}</Button
5155
>
5256
</div>

0 commit comments

Comments
 (0)