flotilla/src/app/components/SpaceCreate.svelte

59 lines
2 KiB
Svelte
Raw Normal View History

2024-08-08 21:02:46 +00:00
<script lang="ts">
2024-08-16 17:50:38 +00:00
import InputProfilePicture from "@lib/components/InputProfilePicture.svelte"
2024-08-09 23:22:09 +00:00
import Button from "@lib/components/Button.svelte"
2024-08-16 17:50:38 +00:00
import Field from "@lib/components/Field.svelte"
import Icon from "@lib/components/Icon.svelte"
2024-10-09 23:11:23 +00:00
import ModalHeader from "@lib/components/ModalHeader.svelte"
import InfoRelay from "@app/components/InfoRelay.svelte"
2024-08-16 17:50:38 +00:00
import SpaceCreateFinish from "@app/components/SpaceCreateFinish.svelte"
import {pushModal} from "@app/modal"
2024-08-08 21:02:46 +00:00
const back = () => history.back()
2024-08-08 23:32:46 +00:00
2024-08-09 00:22:17 +00:00
const next = () => pushModal(SpaceCreateFinish)
2024-08-08 23:32:46 +00:00
let file: File
let name = ""
let relay = ""
2024-08-08 21:02:46 +00:00
</script>
2024-08-09 23:22:09 +00:00
<form class="column gap-4" on:submit|preventDefault={next}>
2024-10-09 23:11:23 +00:00
<ModalHeader>
<div slot="title">Customize your Space</div>
<div slot="info">
Give people a few details to go on. You can always change this later.
</div>
</ModalHeader>
2024-08-08 23:32:46 +00:00
<div class="flex justify-center py-2">
<InputProfilePicture bind:file />
</div>
<Field>
<p slot="label">Space Name</p>
2024-08-16 17:50:38 +00:00
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
2024-08-08 23:32:46 +00:00
<Icon icon="fire-minimalistic" />
<input bind:value={name} class="grow" type="text" />
</label>
</Field>
2024-08-08 21:02:46 +00:00
<Field>
2024-08-08 23:32:46 +00:00
<p slot="label">Relay</p>
2024-08-16 17:50:38 +00:00
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
2024-08-08 23:32:46 +00:00
<Icon icon="remote-controller-minimalistic" />
<input bind:value={relay} class="grow" type="text" />
</label>
<p slot="info">
This can be any nostr relay where you'd like to host your space.
<Button class="link" on:click={() => pushModal(InfoRelay)}>What is a relay?</Button>
2024-08-08 23:32:46 +00:00
</p>
2024-08-08 21:02:46 +00:00
</Field>
2024-08-16 17:50:38 +00:00
<div class="flex flex-row items-center justify-between gap-4">
2024-08-09 23:22:09 +00:00
<Button class="btn btn-link" on:click={back}>
2024-08-08 21:02:46 +00:00
<Icon icon="alt-arrow-left" />
Go back
2024-08-09 23:22:09 +00:00
</Button>
<Button type="submit" class="btn btn-primary">
2024-08-08 21:02:46 +00:00
Next
<Icon icon="alt-arrow-right" class="!bg-base-300" />
2024-08-09 23:22:09 +00:00
</Button>
2024-08-08 21:02:46 +00:00
</div>
2024-08-09 23:22:09 +00:00
</form>