Skip to content

Commit fa9c9d4

Browse files
committed
feat: add quick create-organization button in org header
1 parent e977a00 commit fa9c9d4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { goto } from '$app/navigation';
23
import { base } from '$app/paths';
34
import { page } from '$app/state';
45
import { AvatarGroup, Tab, Tabs } from '$lib/components';
@@ -14,7 +15,12 @@
1415
readOnly,
1516
tierToPlan
1617
} from '$lib/stores/billing';
17-
import { members, newMemberModal, type Organization } from '$lib/stores/organization';
18+
import {
19+
members,
20+
newMemberModal,
21+
newOrgModal,
22+
type Organization
23+
} from '$lib/stores/organization';
1824
import {
1925
canSeeBilling,
2026
canSeeProjects,
@@ -93,7 +99,7 @@
9399
{#if organization?.$id}
94100
<Cover>
95101
<svelte:fragment slot="header">
96-
<span class="u-flex u-cross-center u-gap-8 u-min-width-0">
102+
<span class="u-flex u-cross-center u-gap-12 u-min-width-0">
97103
<Typography.Title color="--fgcolor-neutral-primary" size="xl" truncate>
98104
{organization.name}
99105
</Typography.Title>
@@ -114,6 +120,13 @@
114120
</svelte:fragment>
115121
</Tooltip>
116122
{/if}
123+
<Button
124+
secondary
125+
size="xs"
126+
on:click={() =>
127+
isCloud ? goto(`${base}/create-organization`) : newOrgModal.set(true)}>
128+
<Icon icon={IconPlus} size="s" />
129+
</Button>
117130
</span>
118131
<div class="u-margin-inline-start-auto">
119132
<Layout.Stack direction="row" alignItems="center" gap="xl">

0 commit comments

Comments
 (0)