Skip to content

Commit 07ee334

Browse files
dislpaying tenant list
Signed-off-by: jackdisalvatore <[email protected]>
1 parent 5cf499d commit 07ee334

File tree

4 files changed

+62
-5
lines changed

4 files changed

+62
-5
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div class="layout-container">
2+
<aside class="side-bar h-full">
3+
<slot name="side-bar" />
4+
</aside>
5+
<div class="main-content"><slot name="main-content" /></div>
6+
</div>
7+
8+
<style>
9+
.layout-container {
10+
height: 100%;
11+
display: grid;
12+
grid-template-columns: 400px auto;
13+
}
14+
.main-content {
15+
flex-grow: 1;
16+
height: 100%;
17+
}
18+
19+
.side-bar {
20+
position: relative;
21+
width: 400px;
22+
}
23+
24+
aside {
25+
overflow-y: auto;
26+
}
27+
</style>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script lang="ts">
2+
import { Button, List } from 'stwui';
3+
4+
export let tenants;
5+
</script>
6+
7+
{#if tenants}
8+
<div class="h-full">
9+
<List divided={false}>
10+
{#each tenants as tenant}
11+
<List.Item class="m-2 rounded-md py-0">
12+
<Button class="flex w-full justify-start" on:click={() => alert('TODO')}>
13+
{tenant.name}
14+
</Button>
15+
</List.Item>
16+
{/each}
17+
</List>
18+
</div>
19+
{/if}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script lang="ts">
2+
import SideBarMainContentLayout from '$lib/components/SideBarMainContentLayout/SideBarMainContentLayout.svelte';
3+
</script>
4+
5+
<SideBarMainContentLayout>
6+
<slot slot="side-bar" />
7+
<div slot="main-content" class="relative flex h-full" id="main-content"></div>
8+
</SideBarMainContentLayout>
9+
10+
<style>
11+
#main-content {
12+
background-color: hsl(var(--background));
13+
}
14+
</style>
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<script lang="ts">
22
import { useUnityAuthContext } from '$lib/context/UnityAuthContext';
3+
import Tenants from '$lib/components/Tenants/Tenants.svelte';
34
45
const unityAuthContext = useUnityAuthContext();
56
const user = unityAuthContext.user;
67
</script>
78

89
{#if $user && $user.tenants}
9-
<ul>
10-
{#each $user.tenants as tenant}
11-
<li>{tenant.name}</li>
12-
{/each}
13-
</ul>
10+
<Tenants tenants={$user.tenants} />
1411
{/if}

0 commit comments

Comments
 (0)