Migrate more stuff
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
import SecondaryNavSection from "@lib/components/SecondaryNavSection.svelte"
|
||||
import LogOut from "@app/components/LogOut.svelte"
|
||||
import {pushModal} from "@app/modal"
|
||||
interface Props {
|
||||
children?: import("svelte").Snippet
|
||||
}
|
||||
|
||||
let {children}: Props = $props()
|
||||
|
||||
const logout = () => pushModal(LogOut)
|
||||
</script>
|
||||
@@ -42,5 +47,5 @@
|
||||
</SecondaryNav>
|
||||
|
||||
<Page>
|
||||
<slot />
|
||||
{@render children?.()}
|
||||
</Page>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {preventDefault} from "svelte/legacy"
|
||||
|
||||
import {ctx} from "@welshman/lib"
|
||||
import {getListTags, createEvent, getPubkeyTagValues, MUTES} from "@welshman/util"
|
||||
import {pubkey, signer, userMutes, tagPubkey, publishThunk} from "@welshman/app"
|
||||
@@ -31,72 +33,94 @@
|
||||
pushToast({message: "Your settings have been saved!"})
|
||||
}
|
||||
|
||||
let settings = {...$userSettingValues}
|
||||
let mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
||||
let settings = $state({...$userSettingValues})
|
||||
let mutedPubkeys = $state(getPubkeyTagValues(getListTags($userMutes)))
|
||||
</script>
|
||||
|
||||
<form class="content column gap-4" on:submit|preventDefault={onSubmit}>
|
||||
<form class="content column gap-4" onsubmit={preventDefault(onSubmit)}>
|
||||
<div class="card2 bg-alt col-4 shadow-xl">
|
||||
<p class="text-lg">Content Settings</p>
|
||||
<FieldInline>
|
||||
<p slot="label">Hide sensitive content?</p>
|
||||
<input
|
||||
slot="input"
|
||||
type="checkbox"
|
||||
class="toggle toggle-primary"
|
||||
bind:checked={settings.hide_sensitive} />
|
||||
<p slot="info">
|
||||
If content is marked by the author as sensitive, {PLATFORM_NAME} will hide it by default.
|
||||
</p>
|
||||
{#snippet label()}
|
||||
<p>Hide sensitive content?</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<input
|
||||
type="checkbox"
|
||||
class="toggle toggle-primary"
|
||||
bind:checked={settings.hide_sensitive} />
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>
|
||||
If content is marked by the author as sensitive, {PLATFORM_NAME} will hide it by default.
|
||||
</p>
|
||||
{/snippet}
|
||||
</FieldInline>
|
||||
<FieldInline>
|
||||
<p slot="label">Show media?</p>
|
||||
<input
|
||||
slot="input"
|
||||
type="checkbox"
|
||||
class="toggle toggle-primary"
|
||||
bind:checked={settings.show_media} />
|
||||
<p slot="info">Use this to disable link previews and image rendering.</p>
|
||||
{#snippet label()}
|
||||
<p>Show media?</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<input type="checkbox" class="toggle toggle-primary" bind:checked={settings.show_media} />
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>Use this to disable link previews and image rendering.</p>
|
||||
{/snippet}
|
||||
</FieldInline>
|
||||
<Field>
|
||||
<p slot="label">Muted Accounts</p>
|
||||
<div slot="input">
|
||||
<ProfileMultiSelect bind:value={mutedPubkeys} />
|
||||
</div>
|
||||
{#snippet label()}
|
||||
<p>Muted Accounts</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<div>
|
||||
<ProfileMultiSelect bind:value={mutedPubkeys} />
|
||||
</div>
|
||||
{/snippet}
|
||||
</Field>
|
||||
<p class="text-lg">Editor Settings</p>
|
||||
<FieldInline>
|
||||
<p slot="label">Send Delay</p>
|
||||
<input
|
||||
class="range range-primary"
|
||||
slot="input"
|
||||
type="range"
|
||||
min="0"
|
||||
max="10000"
|
||||
step="1000"
|
||||
bind:value={settings.send_delay} />
|
||||
<p slot="info">
|
||||
Delay sending chat messages for {settings.send_delay / 1000}
|
||||
{settings.send_delay === 1000 ? "second" : "seconds"}.
|
||||
</p>
|
||||
{#snippet label()}
|
||||
<p>Send Delay</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<input
|
||||
class="range range-primary"
|
||||
type="range"
|
||||
min="0"
|
||||
max="10000"
|
||||
step="1000"
|
||||
bind:value={settings.send_delay} />
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>
|
||||
Delay sending chat messages for {settings.send_delay / 1000}
|
||||
{settings.send_delay === 1000 ? "second" : "seconds"}.
|
||||
</p>
|
||||
{/snippet}
|
||||
</FieldInline>
|
||||
<Field>
|
||||
<p slot="label">Media Server</p>
|
||||
<div slot="input" class="flex flex-col gap-2 sm:flex-row">
|
||||
<select bind:value={settings.upload_type} class="select select-bordered">
|
||||
<option value="nip96">NIP 96 (default)</option>
|
||||
<option value="blossom">Blossom</option>
|
||||
</select>
|
||||
<label class="input input-bordered flex flex-grow items-center gap-2">
|
||||
<Icon icon="link-round" />
|
||||
{#if settings.upload_type === "nip96"}
|
||||
<input class="grow" bind:value={settings.nip96_urls[0]} />
|
||||
{:else}
|
||||
<input class="grow" bind:value={settings.blossom_urls[0]} />
|
||||
{/if}
|
||||
</label>
|
||||
</div>
|
||||
<p slot="info">Choose a media server type and url for files you upload to flotilla.</p>
|
||||
{#snippet label()}
|
||||
<p>Media Server</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<div class="flex flex-col gap-2 sm:flex-row">
|
||||
<select bind:value={settings.upload_type} class="select select-bordered">
|
||||
<option value="nip96">NIP 96 (default)</option>
|
||||
<option value="blossom">Blossom</option>
|
||||
</select>
|
||||
<label class="input input-bordered flex flex-grow items-center gap-2">
|
||||
<Icon icon="link-round" />
|
||||
{#if settings.upload_type === "nip96"}
|
||||
<input class="grow" bind:value={settings.nip96_urls[0]} />
|
||||
{:else}
|
||||
<input class="grow" bind:value={settings.blossom_urls[0]} />
|
||||
{/if}
|
||||
</label>
|
||||
</div>
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>Choose a media server type and url for files you upload to flotilla.</p>
|
||||
{/snippet}
|
||||
</Field>
|
||||
<div class="mt-4 flex flex-row items-center justify-between gap-4">
|
||||
<Button class="btn btn-neutral" on:click={reset}>Discard Changes</Button>
|
||||
|
||||
@@ -56,48 +56,64 @@
|
||||
{#if $session?.email}
|
||||
<div class="card2 bg-alt col-4 shadow-xl">
|
||||
<FieldInline>
|
||||
<p slot="label">Email Address</p>
|
||||
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
|
||||
<Icon icon="user-rounded" />
|
||||
<input readonly value={$session.email} class="grow" />
|
||||
</label>
|
||||
<p slot="info">
|
||||
Your email and password can only be used to log into {PLATFORM_NAME}.
|
||||
<Button class="link" on:click={startEject}>Start holding your own keys</Button>
|
||||
</p>
|
||||
{#snippet label()}
|
||||
<p>Email Address</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<label class="input input-bordered flex w-full items-center gap-2">
|
||||
<Icon icon="user-rounded" />
|
||||
<input readonly value={$session.email} class="grow" />
|
||||
</label>
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>
|
||||
Your email and password can only be used to log into {PLATFORM_NAME}.
|
||||
<Button class="link" on:click={startEject}>Start holding your own keys</Button>
|
||||
</p>
|
||||
{/snippet}
|
||||
</FieldInline>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="card2 bg-alt col-4 shadow-xl">
|
||||
<FieldInline>
|
||||
<p slot="label">Public Key</p>
|
||||
<label
|
||||
class="input input-bordered flex w-full items-center justify-between gap-2"
|
||||
slot="input">
|
||||
<div class="row-2 flex-grow items-center">
|
||||
<Icon icon="link-round" />
|
||||
<input readonly class="ellipsize flex-grow" value={$session?.pubkey} />
|
||||
</div>
|
||||
<Button class="flex items-center" on:click={copyNpub}>
|
||||
<Icon icon="copy" />
|
||||
</Button>
|
||||
</label>
|
||||
<p slot="info">
|
||||
Your public key is your nostr user identifier. It also allows other people to authenticate
|
||||
your messages.
|
||||
</p>
|
||||
</FieldInline>
|
||||
{#if $session?.method === "nip01"}
|
||||
<FieldInline>
|
||||
<p slot="label">Private Key</p>
|
||||
<label class="input input-bordered flex w-full items-center gap-2" slot="input">
|
||||
<Icon icon="link-round" />
|
||||
<input readonly value={$session.secret} class="grow" type="password" />
|
||||
<Button class="flex items-center" on:click={copyNsec}>
|
||||
{#snippet label()}
|
||||
<p>Public Key</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<label class="input input-bordered flex w-full items-center justify-between gap-2">
|
||||
<div class="row-2 flex-grow items-center">
|
||||
<Icon icon="link-round" />
|
||||
<input readonly class="ellipsize flex-grow" value={$session?.pubkey} />
|
||||
</div>
|
||||
<Button class="flex items-center" on:click={copyNpub}>
|
||||
<Icon icon="copy" />
|
||||
</Button>
|
||||
</label>
|
||||
<p slot="info">Your private key is your nostr password. Keep this somewhere safe!</p>
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>
|
||||
Your public key is your nostr user identifier. It also allows other people to authenticate
|
||||
your messages.
|
||||
</p>
|
||||
{/snippet}
|
||||
</FieldInline>
|
||||
{#if $session?.method === "nip01"}
|
||||
<FieldInline>
|
||||
{#snippet label()}
|
||||
<p>Private Key</p>
|
||||
{/snippet}
|
||||
{#snippet input()}
|
||||
<label class="input input-bordered flex w-full items-center gap-2">
|
||||
<Icon icon="link-round" />
|
||||
<input readonly value={$session.secret} class="grow" type="password" />
|
||||
<Button class="flex items-center" on:click={copyNsec}>
|
||||
<Icon icon="copy" />
|
||||
</Button>
|
||||
</label>
|
||||
{/snippet}
|
||||
{#snippet info()}
|
||||
<p>Your private key is your nostr password. Keep this somewhere safe!</p>
|
||||
{/snippet}
|
||||
</FieldInline>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -53,15 +53,19 @@
|
||||
|
||||
<div class="content column gap-4">
|
||||
<Collapse class="card2 bg-alt column gap-4">
|
||||
<h2 slot="title" class="flex items-center gap-3 text-xl">
|
||||
<Icon icon="earth" />
|
||||
Outbox Relays
|
||||
</h2>
|
||||
<p slot="description" class="text-sm">
|
||||
These relays will be advertised on your profile as places where you send your public notes. Be
|
||||
sure to select relays that will accept your notes, and which will let people who follow you
|
||||
read them.
|
||||
</p>
|
||||
{#snippet title()}
|
||||
<h2 class="flex items-center gap-3 text-xl">
|
||||
<Icon icon="earth" />
|
||||
Outbox Relays
|
||||
</h2>
|
||||
{/snippet}
|
||||
{#snippet description()}
|
||||
<p class="text-sm">
|
||||
These relays will be advertised on your profile as places where you send your public notes.
|
||||
Be sure to select relays that will accept your notes, and which will let people who follow
|
||||
you read them.
|
||||
</p>
|
||||
{/snippet}
|
||||
<div class="column gap-2">
|
||||
{#each $writeRelayUrls.sort() as url (url)}
|
||||
<RelayItem {url}>
|
||||
@@ -82,14 +86,18 @@
|
||||
</div>
|
||||
</Collapse>
|
||||
<Collapse class="card2 bg-alt column gap-4">
|
||||
<h2 slot="title" class="flex items-center gap-3 text-xl">
|
||||
<Icon icon="inbox" />
|
||||
Inbox Relays
|
||||
</h2>
|
||||
<p slot="description" class="text-sm">
|
||||
These relays will be advertised on your profile as places where other people should send notes
|
||||
intended for you. Be sure to select relays that will accept notes that tag you.
|
||||
</p>
|
||||
{#snippet title()}
|
||||
<h2 class="flex items-center gap-3 text-xl">
|
||||
<Icon icon="inbox" />
|
||||
Inbox Relays
|
||||
</h2>
|
||||
{/snippet}
|
||||
{#snippet description()}
|
||||
<p class="text-sm">
|
||||
These relays will be advertised on your profile as places where other people should send
|
||||
notes intended for you. Be sure to select relays that will accept notes that tag you.
|
||||
</p>
|
||||
{/snippet}
|
||||
<div class="column gap-2">
|
||||
{#each $readRelayUrls.sort() as url (url)}
|
||||
<RelayItem {url}>
|
||||
@@ -110,15 +118,19 @@
|
||||
</div>
|
||||
</Collapse>
|
||||
<Collapse class="card2 bg-alt column gap-4">
|
||||
<h2 slot="title" class="flex items-center gap-3 text-xl">
|
||||
<Icon icon="mailbox" />
|
||||
Messaging Relays
|
||||
</h2>
|
||||
<p slot="description" class="text-sm">
|
||||
These relays will be advertised on your profile as places you use to send and receive direct
|
||||
messages. Be sure to select relays that will accept your messages and messages from people
|
||||
you'd like to be in contact with.
|
||||
</p>
|
||||
{#snippet title()}
|
||||
<h2 class="flex items-center gap-3 text-xl">
|
||||
<Icon icon="mailbox" />
|
||||
Messaging Relays
|
||||
</h2>
|
||||
{/snippet}
|
||||
{#snippet description()}
|
||||
<p class="text-sm">
|
||||
These relays will be advertised on your profile as places you use to send and receive direct
|
||||
messages. Be sure to select relays that will accept your messages and messages from people
|
||||
you'd like to be in contact with.
|
||||
</p>
|
||||
{/snippet}
|
||||
<div class="column gap-2">
|
||||
{#each $inboxRelayUrls.sort() as url (url)}
|
||||
<RelayItem {url}>
|
||||
|
||||
Reference in New Issue
Block a user