improve guild selection, add Wip
This commit is contained in:
parent
f0a0700aa1
commit
80ecfd6747
7 changed files with 22 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@yusurko/vigil",
|
||||
"private": true,
|
||||
"version": "0.1.0-dev42",
|
||||
"version": "0.1.0-dev43",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { backend, type GuildEntry } from "./backend";
|
||||
|
||||
|
||||
let value = $state("");
|
||||
let { value = $bindable("") } = $props();
|
||||
|
||||
let suggestions: Promise<GuildEntry[]> = $derived(getSuggestions(value));
|
||||
|
||||
|
|
|
|||
8
src/lib/Wip.svelte
Normal file
8
src/lib/Wip.svelte
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<script lang="ts">
|
||||
import { RiBarricadeLine } from "svelte-remixicon";
|
||||
import Centered from "./Centered.svelte";
|
||||
|
||||
</script>
|
||||
<Centered>
|
||||
<faint><RiBarricadeLine /></faint>
|
||||
</Centered>
|
||||
|
|
@ -22,8 +22,6 @@ export function setHealth ({ name, version, post_count, user_count, color_theme
|
|||
health.color_theme = color_theme;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function setMe (me: UserEntry | null) {
|
||||
health.me = me;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,16 @@
|
|||
import { getMe } from "$lib/globals.svelte";
|
||||
import GuildSelect from "$lib/GuildSelect.svelte";
|
||||
import SLayout from "$lib/SLayout.svelte";
|
||||
import Wip from "$lib/Wip.svelte";
|
||||
import { RiErrorWarningLine } from "svelte-remixicon";
|
||||
|
||||
let me = getMe();
|
||||
|
||||
let content = $state("");
|
||||
let privacy = $state(0);
|
||||
let guildName = $state("");
|
||||
|
||||
|
||||
let enablePost = $derived(!!content && !!guildName && false);
|
||||
</script>
|
||||
|
||||
|
||||
|
|
@ -22,7 +24,7 @@
|
|||
|
||||
<label>
|
||||
Post to:
|
||||
<GuildSelect />
|
||||
<GuildSelect bind:value={guildName} />
|
||||
</label>
|
||||
|
||||
<EditPost bind:content bind:privacy />
|
||||
|
|
@ -31,16 +33,16 @@
|
|||
<span class="warning"><RiErrorWarningLine /> Your post will be PUBLIC!</span>
|
||||
{/if}
|
||||
|
||||
<button class="card primary" disabled>Create</button>
|
||||
<button class="card primary" disabled={!enablePost}>Create</button>
|
||||
|
||||
</form>
|
||||
|
||||
{#snippet left()}
|
||||
...
|
||||
<Wip />
|
||||
{/snippet}
|
||||
|
||||
{#snippet right()}
|
||||
...
|
||||
<Wip />
|
||||
{/snippet}
|
||||
</SLayout>
|
||||
{:else}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
import { getMe } from "$lib/globals.svelte";
|
||||
import GuildSelect from "$lib/GuildSelect.svelte";
|
||||
import SLayout from "$lib/SLayout.svelte";
|
||||
import Wip from "$lib/Wip.svelte";
|
||||
import { RiErrorWarningLine } from "svelte-remixicon";
|
||||
|
||||
let me = getMe();
|
||||
|
|
@ -38,11 +39,11 @@
|
|||
</form>
|
||||
|
||||
{#snippet left()}
|
||||
...
|
||||
<Wip />
|
||||
{/snippet}
|
||||
|
||||
{#snippet right()}
|
||||
...
|
||||
<Wip />
|
||||
{/snippet}
|
||||
</SLayout>
|
||||
{:else if me}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { enhance } from "$app/forms";
|
||||
import Centered from "$lib/Centered.svelte";
|
||||
import Wip from "$lib/Wip.svelte";
|
||||
import { RiInformationLine, RiUserLine } from "svelte-remixicon";
|
||||
|
||||
let username = $state("");
|
||||
|
|
@ -25,7 +26,7 @@ let disabled = $derived(username.length < 2 || username.length > 30 ||
|
|||
<small class="faint">Must be a working e-mail address <abbr title="Will be used for password recovery and important communications"><RiInformationLine /></abbr></small>
|
||||
<input type="text" name="username" bind:value={email} />
|
||||
</label>
|
||||
...
|
||||
<Wip />
|
||||
|
||||
<button class="primary" disabled={disabled}>Sign up</button>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue