forked from coracle/flotilla
Fix some icons, add privacy nav item, add close button to modal dialog, make settings menu nicer
This commit is contained in:
@@ -1,12 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {Capacitor} from "@capacitor/core"
|
import {Capacitor} from "@capacitor/core"
|
||||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
import {pubkey} from "@welshman/app"
|
||||||
import UserRounded from "@assets/icons/user-rounded.svg?dataurl"
|
|
||||||
import Server from "@assets/icons/server.svg?dataurl"
|
import Server from "@assets/icons/server.svg?dataurl"
|
||||||
import Moon from "@assets/icons/moon.svg?dataurl"
|
import GalleryMinimalistic from "@assets/icons/gallery-minimalistic.svg?dataurl"
|
||||||
import Settings from "@assets/icons/settings-minimalistic.svg?dataurl"
|
import Shield from "@assets/icons/shield-minimalistic.svg?dataurl"
|
||||||
import Code2 from "@assets/icons/code-2.svg?dataurl"
|
|
||||||
import Exit from "@assets/icons/logout-3.svg?dataurl"
|
|
||||||
import Bell from "@assets/icons/bell.svg?dataurl"
|
import Bell from "@assets/icons/bell.svg?dataurl"
|
||||||
import Wallet from "@assets/icons/wallet.svg?dataurl"
|
import Wallet from "@assets/icons/wallet.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
@@ -14,120 +11,69 @@
|
|||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
import Modal from "@lib/components/Modal.svelte"
|
import Modal from "@lib/components/Modal.svelte"
|
||||||
import ModalBody from "@lib/components/ModalBody.svelte"
|
import ModalBody from "@lib/components/ModalBody.svelte"
|
||||||
import CardButton from "@lib/components/CardButton.svelte"
|
import Profile from "@app/components/Profile.svelte"
|
||||||
import LogOut from "@app/components/LogOut.svelte"
|
import LogOut from "@app/components/LogOut.svelte"
|
||||||
import {PLATFORM_NAME} from "@app/core/state"
|
|
||||||
import {pushModal} from "@app/util/modal"
|
import {pushModal} from "@app/util/modal"
|
||||||
import {theme} from "@app/util/theme"
|
import {theme} from "@app/util/theme"
|
||||||
|
|
||||||
const back = () => history.back()
|
|
||||||
const logout = () => pushModal(LogOut)
|
const logout = () => pushModal(LogOut)
|
||||||
const toggleTheme = () => theme.set($theme === "dark" ? "light" : "dark")
|
const toggleTheme = () => theme.set($theme === "dark" ? "light" : "dark")
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal>
|
<Modal>
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-8 items-center py-12 max-w-[16rem] m-auto w-full">
|
||||||
<Link replaceState href="/settings/profile">
|
{#if $pubkey}
|
||||||
<CardButton class="btn-neutral">
|
<Link replaceState href="/settings/profile">
|
||||||
{#snippet icon()}
|
<Profile inert pubkey={$pubkey} />
|
||||||
<div><Icon icon={UserRounded} size={7} /></div>
|
|
||||||
{/snippet}
|
|
||||||
{#snippet title()}
|
|
||||||
<div>Profile</div>
|
|
||||||
{/snippet}
|
|
||||||
{#snippet info()}
|
|
||||||
<div>Customize your user profile</div>
|
|
||||||
{/snippet}
|
|
||||||
</CardButton>
|
|
||||||
</Link>
|
|
||||||
<Link replaceState href="/settings/alerts">
|
|
||||||
<CardButton class="btn-neutral">
|
|
||||||
{#snippet icon()}
|
|
||||||
<div><Icon icon={Bell} size={7} /></div>
|
|
||||||
{/snippet}
|
|
||||||
{#snippet title()}
|
|
||||||
<div>Alerts</div>
|
|
||||||
{/snippet}
|
|
||||||
{#snippet info()}
|
|
||||||
<div>Set up email digests and push notifications</div>
|
|
||||||
{/snippet}
|
|
||||||
</CardButton>
|
|
||||||
</Link>
|
|
||||||
{#if Capacitor.getPlatform() !== "ios"}
|
|
||||||
<Link replaceState href="/settings/wallet">
|
|
||||||
<CardButton class="btn-neutral">
|
|
||||||
{#snippet icon()}
|
|
||||||
<div><Icon icon={Wallet} size={7} /></div>
|
|
||||||
{/snippet}
|
|
||||||
{#snippet title()}
|
|
||||||
<div>Wallet</div>
|
|
||||||
{/snippet}
|
|
||||||
{#snippet info()}
|
|
||||||
<div>Connect a bitcoin wallet for sending social tips</div>
|
|
||||||
{/snippet}
|
|
||||||
</CardButton>
|
|
||||||
</Link>
|
</Link>
|
||||||
{/if}
|
{/if}
|
||||||
<Link replaceState href="/settings/relays">
|
<div class="grid grid-cols-2 gap-3 w-full">
|
||||||
<CardButton class="btn-neutral">
|
<Link
|
||||||
{#snippet icon()}
|
replaceState
|
||||||
<div><Icon icon={Server} size={7} /></div>
|
href="/settings/alerts"
|
||||||
{/snippet}
|
class="aspect-square btn h-[unset] btn-neutral flex flex-col gap-4 text-center">
|
||||||
{#snippet title()}
|
<Icon icon={Bell} size={7} />
|
||||||
<div>Relays</div>
|
Alerts
|
||||||
{/snippet}
|
</Link>
|
||||||
{#snippet info()}
|
{#if Capacitor.getPlatform() !== "ios"}
|
||||||
<div>Control how {PLATFORM_NAME} talks to the network</div>
|
<Link
|
||||||
{/snippet}
|
replaceState
|
||||||
</CardButton>
|
href="/settings/wallet"
|
||||||
</Link>
|
class="aspect-square btn h-[unset] btn-neutral flex flex-col gap-4 text-center">
|
||||||
<Link replaceState href="/settings/content">
|
<Icon icon={Wallet} size={7} />
|
||||||
<CardButton class="btn-neutral">
|
Wallet
|
||||||
{#snippet icon()}
|
</Link>
|
||||||
<div><Icon icon={Settings} size={7} /></div>
|
{/if}
|
||||||
{/snippet}
|
<Link
|
||||||
{#snippet title()}
|
replaceState
|
||||||
<div>Settings</div>
|
href="/settings/relays"
|
||||||
{/snippet}
|
class="aspect-square btn h-[unset] btn-neutral flex flex-col gap-4 text-center">
|
||||||
{#snippet info()}
|
<Icon icon={Server} size={7} />
|
||||||
<div>Get into the details about how {PLATFORM_NAME} works</div>
|
Relays
|
||||||
{/snippet}
|
</Link>
|
||||||
</CardButton>
|
<Link
|
||||||
</Link>
|
replaceState
|
||||||
<Button onclick={toggleTheme}>
|
href="/settings/content"
|
||||||
<CardButton class="btn-neutral">
|
class="aspect-square btn h-[unset] btn-neutral flex flex-col gap-4 text-center">
|
||||||
{#snippet icon()}
|
<Icon icon={GalleryMinimalistic} size={7} />
|
||||||
<div><Icon icon={Moon} size={7} /></div>
|
Content
|
||||||
{/snippet}
|
</Link>
|
||||||
{#snippet title()}
|
<Link
|
||||||
<div>Theme</div>
|
replaceState
|
||||||
{/snippet}
|
href="/settings/privacy"
|
||||||
{#snippet info()}
|
class="aspect-square btn h-[unset] btn-neutral flex flex-col gap-4 text-center">
|
||||||
<div>Switch between light and dark mode</div>
|
<Icon icon={Shield} size={7} />
|
||||||
{/snippet}
|
Privacy
|
||||||
</CardButton>
|
</Link>
|
||||||
</Button>
|
</div>
|
||||||
<Link replaceState href="/settings/about">
|
<div class="flex gap-3 items-center opacity-75 text-sm">
|
||||||
<CardButton class="btn-neutral">
|
<Button onclick={toggleTheme}>Theme</Button>
|
||||||
{#snippet icon()}
|
/
|
||||||
<div><Icon icon={Code2} size={7} /></div>
|
<Link replaceState href="/settings/about">About</Link>
|
||||||
{/snippet}
|
/
|
||||||
{#snippet title()}
|
<Button onclick={logout}>Log Out</Button>
|
||||||
<div>About</div>
|
</div>
|
||||||
{/snippet}
|
|
||||||
{#snippet info()}
|
|
||||||
<div>Learn about {PLATFORM_NAME} and support the developer</div>
|
|
||||||
{/snippet}
|
|
||||||
</CardButton>
|
|
||||||
</Link>
|
|
||||||
<Button onclick={logout} class="btn btn-neutral">
|
|
||||||
<Icon icon={Exit} /> Log Out
|
|
||||||
</Button>
|
|
||||||
<Button class="btn btn-link w-full md:hidden" onclick={back}>
|
|
||||||
<Icon icon={AltArrowLeft} />
|
|
||||||
Go back
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -17,15 +17,20 @@
|
|||||||
url?: string
|
url?: string
|
||||||
showPubkey?: boolean
|
showPubkey?: boolean
|
||||||
avatarSize?: number
|
avatarSize?: number
|
||||||
|
inert?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const {pubkey, url, showPubkey, avatarSize = 10}: Props = $props()
|
const {pubkey, url, showPubkey, inert, avatarSize = 10}: Props = $props()
|
||||||
|
|
||||||
const relays = removeUndefined([url])
|
const relays = removeUndefined([url])
|
||||||
const profileDisplay = deriveProfileDisplay(pubkey, relays)
|
const profileDisplay = deriveProfileDisplay(pubkey, relays)
|
||||||
const handle = deriveHandleForPubkey(pubkey)
|
const handle = deriveHandleForPubkey(pubkey)
|
||||||
|
|
||||||
const openProfile = () => pushModal(ProfileDetail, {pubkey, url})
|
const openProfile = () => {
|
||||||
|
if (!inert) {
|
||||||
|
pushModal(ProfileDetail, {pubkey, url})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const copyPubkey = () => clip(nip19.npubEncode(pubkey))
|
const copyPubkey = () => clip(nip19.npubEncode(pubkey))
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
import cx from "classnames"
|
import cx from "classnames"
|
||||||
import {noop} from "@welshman/lib"
|
import {noop} from "@welshman/lib"
|
||||||
import {fade, fly} from "@lib/transition"
|
import {fade, fly} from "@lib/transition"
|
||||||
|
import Close from "@assets/icons/close.svg?dataurl"
|
||||||
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
|
import Button from "@lib/components/Button.svelte"
|
||||||
|
import {clearModals} from "@app/util/modal"
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onClose?: any
|
onClose?: any
|
||||||
@@ -43,6 +47,11 @@
|
|||||||
</button>
|
</button>
|
||||||
<div class={wrapperClass}>
|
<div class={wrapperClass}>
|
||||||
<div class={innerClass} transition:fly>
|
<div class={innerClass} transition:fly>
|
||||||
|
<Button
|
||||||
|
class="absolute -top-4 right-3 btn btn-circle btn-neutral btn-sm"
|
||||||
|
onclick={clearModals}>
|
||||||
|
<Icon icon={Close} size={6} />
|
||||||
|
</Button>
|
||||||
<children.component {...children.props} />
|
<children.component {...children.props} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import Wallet from "@assets/icons/wallet.svg?dataurl"
|
import Wallet from "@assets/icons/wallet.svg?dataurl"
|
||||||
import Server from "@assets/icons/server.svg?dataurl"
|
import Server from "@assets/icons/server.svg?dataurl"
|
||||||
import Moon from "@assets/icons/moon.svg?dataurl"
|
import Moon from "@assets/icons/moon.svg?dataurl"
|
||||||
import InfoSquare from "@assets/icons/info-square.svg?dataurl"
|
import Code2 from "@assets/icons/code-2.svg?dataurl"
|
||||||
import Exit from "@assets/icons/logout-3.svg?dataurl"
|
import Exit from "@assets/icons/logout-3.svg?dataurl"
|
||||||
import GalleryMinimalistic from "@assets/icons/gallery-minimalistic.svg?dataurl"
|
import GalleryMinimalistic from "@assets/icons/gallery-minimalistic.svg?dataurl"
|
||||||
import Shield from "@assets/icons/shield-minimalistic.svg?dataurl"
|
import Shield from "@assets/icons/shield-minimalistic.svg?dataurl"
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div in:fly|local={{delay: 350}}>
|
<div in:fly|local={{delay: 350}}>
|
||||||
<SecondaryNavItem href="/settings/about">
|
<SecondaryNavItem href="/settings/about">
|
||||||
<Icon icon={InfoSquare} /> About
|
<Icon icon={Code2} /> About
|
||||||
</SecondaryNavItem>
|
</SecondaryNavItem>
|
||||||
</div>
|
</div>
|
||||||
<div in:fly|local={{delay: 400}}>
|
<div in:fly|local={{delay: 400}}>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {insertAt, removeAt} from "@welshman/lib"
|
import {insertAt, removeAt} from "@welshman/lib"
|
||||||
import SettingsMinimalistic from "@assets/icons/settings-minimalistic.svg?dataurl"
|
import Planet from "@assets/icons/planet-3.svg?dataurl"
|
||||||
import AddCircle from "@assets/icons/add-circle.svg?dataurl"
|
import AddCircle from "@assets/icons/add-circle.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<PageBar class="cw-full">
|
<PageBar class="cw-full">
|
||||||
<div class="flex items-center justify-between gap-4">
|
<div class="flex items-center justify-between gap-4">
|
||||||
<div class="ellipsize flex items-center gap-4 whitespace-nowrap">
|
<div class="ellipsize flex items-center gap-4 whitespace-nowrap">
|
||||||
<Icon icon={SettingsMinimalistic} />
|
<Icon icon={Planet} />
|
||||||
<strong>Your Spaces</strong>
|
<strong>Your Spaces</strong>
|
||||||
</div>
|
</div>
|
||||||
{#if $userSpaceUrls.length > 0 && PLATFORM_RELAYS.length === 0}
|
{#if $userSpaceUrls.length > 0 && PLATFORM_RELAYS.length === 0}
|
||||||
|
|||||||
Reference in New Issue
Block a user