-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a62d38
commit ef095d9
Showing
8 changed files
with
295 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
src/lib/objects/split/views/choose-collection-members.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<script lang="ts"> | ||
import ChevronLeft from '$lib/components/icons/chevron-left.svelte' | ||
import Close from '$lib/components/icons/close.svelte' | ||
import Header from '$lib/components/header.svelte' | ||
import Button from '$lib/components/button.svelte' | ||
import Container from '$lib/components/container.svelte' | ||
import Layout from '$lib/components/layout.svelte' | ||
import Avatar from '$lib/components/avatar.svelte' | ||
import type { User } from '$lib/objects/schemas' | ||
import Checkmark from '$lib/components/icons/checkmark.svelte' | ||
export let users: User[] | ||
export let exitObject: () => void | ||
export let goBack: () => void | ||
export let goNext: () => void | ||
</script> | ||
|
||
<Layout> | ||
<svelte:fragment slot="header"> | ||
<Header title="Split"> | ||
<Button slot="left" variant="icon" on:click={goBack}> | ||
<ChevronLeft /> | ||
</Button> | ||
<Button slot="right" variant="icon" on:click={exitObject}> | ||
<Close /> | ||
</Button> | ||
</Header> | ||
</svelte:fragment> | ||
<Container gap={12} padX={24}> | ||
<h2>Shared with everyone</h2> | ||
<p> | ||
Expenses added to this collection will be shared equally between everyone in the group chat. | ||
</p> | ||
<ul> | ||
{#each users as user} | ||
<li> | ||
<Container grow> | ||
<div class="chat"> | ||
<Avatar size={48} picture={user.avatar} seed={user.address} /> | ||
<div class="content"> | ||
<div class="user-info"> | ||
<span class="username text-lg"> | ||
{user.name} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</Container> | ||
</li> | ||
{/each} | ||
</ul> | ||
</Container> | ||
<Container justify="flex-end"> | ||
<Button variant="strong" on:click={goNext}> | ||
<Checkmark /> Create collection | ||
</Button> | ||
</Container> | ||
</Layout> | ||
|
||
<style> | ||
li { | ||
display: flex; | ||
align-items: center; | ||
gap: var(--spacing-12); | ||
border-bottom: 1px solid var(--color-step-20, var(--color-dark-step-40)); | ||
cursor: pointer; | ||
} | ||
.chat { | ||
display: flex; | ||
flex-direction: row; | ||
gap: var(--spacing-12); | ||
justify-content: flex-start; | ||
align-items: center; | ||
} | ||
.content { | ||
flex-grow: 1; | ||
} | ||
.user-info { | ||
margin-bottom: var(--spacing-3); | ||
display: flex; | ||
flex-direction: row; | ||
gap: var(--spacing-6); | ||
align-items: baseline; | ||
justify-content: space-between; | ||
} | ||
.username { | ||
display: inline-flex; | ||
flex-direction: row; | ||
gap: var(--spacing-6); | ||
align-items: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<script lang="ts"> | ||
import ArrowRight from '$lib/components/icons/arrow-right.svelte' | ||
import Close from '$lib/components/icons/close.svelte' | ||
import Header from '$lib/components/header.svelte' | ||
import Button from '$lib/components/button.svelte' | ||
import Container from '$lib/components/container.svelte' | ||
import Input from '$lib/components/input-field.svelte' | ||
import Layout from '$lib/components/layout.svelte' | ||
export let collectionName: string | ||
export let instanceId: string | ||
export let exitObject: () => void | ||
export let goNext: () => void | ||
function confirm() { | ||
if (!collectionName) collectionName = `#${instanceId.slice(0, 4)}` | ||
goNext() | ||
} | ||
</script> | ||
|
||
<Layout> | ||
<svelte:fragment slot="header"> | ||
<Header title="Create a collection"> | ||
<Button slot="right" variant="icon" on:click={exitObject}> | ||
<Close /> | ||
</Button> | ||
</Header> | ||
</svelte:fragment> | ||
<Container gap={12} justify="center" padX={24}> | ||
<h2>Give a name to your collection</h2> | ||
<p>Help others understand which expenses should be shared within this collection.</p> | ||
<div class="input"> | ||
<Input | ||
label="Collection name" | ||
autofocus | ||
bind:value={collectionName} | ||
placeholder={`#${instanceId.slice(0, 4)}`} | ||
/> | ||
</div> | ||
</Container> | ||
<Container justify="flex-end"> | ||
<Button variant="strong" on:click={confirm}> | ||
<ArrowRight /> | ||
</Button> | ||
</Container> | ||
</Layout> | ||
|
||
<style> | ||
.input { | ||
margin-top: 24px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.