This commit is contained in:
Jon Staab
2024-10-17 16:03:50 -07:00
parent 2f561149fa
commit fd5b0a9af3
33 changed files with 129 additions and 140 deletions
+20 -17
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import {onMount} from "svelte"
import {derived} from 'svelte/store'
import {addToMapKey, dec, gt, inc} from "@welshman/lib"
import {derived} from "svelte/store"
import {addToMapKey, dec, gt} from "@welshman/lib"
import type {Relay} from "@welshman/app"
import {relays, createSearch, relaySelections} from "@welshman/app"
import {createScroller} from "@lib/html"
@@ -12,24 +12,27 @@
import RelayDescription from "@app/components/RelayDescription.svelte"
import SpaceCheck from "@app/components/SpaceCheck.svelte"
import ProfileCircles from "@app/components/ProfileCircles.svelte"
import {userMembership, memberships, membershipByPubkey, getMembershipUrls, getDefaultPubkeys} from "@app/state"
import {
userMembership,
memberships,
membershipByPubkey,
getMembershipUrls,
getDefaultPubkeys,
} from "@app/state"
import {discoverRelays} from "@app/commands"
import {pushModal} from "@app/modal"
const wotGraph = derived(
membershipByPubkey,
$m => {
const scores = new Map<string, Set<string>>()
const wotGraph = derived(membershipByPubkey, $m => {
const scores = new Map<string, Set<string>>()
for (const pubkey of getDefaultPubkeys()) {
for (const url of getMembershipUrls($m.get(pubkey))) {
addToMapKey(scores, url, pubkey)
}
for (const pubkey of getDefaultPubkeys()) {
for (const url of getMembershipUrls($m.get(pubkey))) {
addToMapKey(scores, url, pubkey)
}
return scores
}
)
return scores
})
const openSpace = (url: string) => pushModal(SpaceCheck, {url})
@@ -83,7 +86,7 @@
class="card2 bg-alt col-4 text-left shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]"
on:click={() => openSpace(relay.url)}>
<div class="col-2">
<div class="flex gap-4 relative">
<div class="relative flex gap-4">
<div class="relative">
<div class="avatar relative">
<div
@@ -97,14 +100,14 @@
</div>
{#if getMembershipUrls($userMembership).includes(relay.url)}
<div
class="absolute -right-1 -top-1 tooltip h-5 w-5 rounded-full bg-primary"
class="tooltip absolute -right-1 -top-1 h-5 w-5 rounded-full bg-primary"
data-tip="You are already a member of this space.">
<Icon icon="check-circle" class="scale-110" />
</div>
{/if}
</div>
<div>
<h2 class="text-xl ellipsize whitespace-nowrap">
<h2 class="ellipsize whitespace-nowrap text-xl">
<RelayName url={relay.url} />
</h2>
<p class="text-sm opacity-75">{relay.url}</p>
+1 -1
View File
@@ -11,7 +11,7 @@
import {onMount} from "svelte"
import {page} from "$app/stores"
import {derived, writable} from "svelte/store"
import {ctx, assoc, sortBy, now, remove} from "@welshman/lib"
import {assoc, sortBy, remove} from "@welshman/lib"
import type {TrustedEvent, EventContent} from "@welshman/util"
import {createEvent, DIRECT_MESSAGE} from "@welshman/util"
import {
+2 -5
View File
@@ -1,13 +1,10 @@
<script lang="ts">
import {onMount} from "svelte"
import {createScroller} from "@lib/html"
import {uniq, shuffle} from "@welshman/lib"
import {getPubkeyTagValues, getListTags} from "@welshman/util"
import {profileSearch, userFollows} from "@welshman/app"
import {profileSearch} from "@welshman/app"
import Icon from "@lib/components/Icon.svelte"
import PageHeader from "@lib/components/PageHeader.svelte"
import PeopleItem from "@app/components/PeopleItem.svelte"
import {getDefaultPubkeys} from '@app/state'
import {getDefaultPubkeys} from "@app/state"
const defaultPubkeys = getDefaultPubkeys()
+11 -4
View File
@@ -9,6 +9,8 @@
import {pushToast} from "@app/toast"
import {SETTINGS, userSettings} from "@app/state"
const settings = {...$userSettings?.values}
const reset = () => {
mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
}
@@ -29,12 +31,11 @@
pushToast({message: "Your settings have been saved!"})
}
let settings = {...$userSettings?.values}
let mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
</script>
<form class="content column gap-4" on:submit|preventDefault={onSubmit}>
<div class="card2 bg-alt shadow-xl col-4">
<div class="card2 bg-alt col-4 shadow-xl">
<Field>
<p slot="label">Muted Accounts</p>
<div slot="input">
@@ -43,8 +44,14 @@
</Field>
<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, flotilla will hide it by default.</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, flotilla will hide it by default.
</p>
</FieldInline>
<div class="mt-4 flex flex-row items-center justify-between gap-4">
<Button class="btn btn-neutral" on:click={reset}>Discard Changes</Button>
+4 -1
View File
@@ -43,7 +43,10 @@
</span>
</p>
<p class="text-xs">
Icons by <Link external class="link" href="https://www.figma.com/community/file/1166831539721848736">480 Design</Link>
Icons by <Link
external
class="link"
href="https://www.figma.com/community/file/1166831539721848736">480 Design</Link>
</p>
</div>
<div class="flex justify-center gap-4">
+1 -1
View File
@@ -9,7 +9,7 @@
createProfile,
isPublishedProfile,
} from "@welshman/util"
import {pubkey, profilesByPubkey, publishThunk, displayNip05, deriveProfile} from "@welshman/app"
import {pubkey, publishThunk, displayNip05, deriveProfile} from "@welshman/app"
import {slide} from "@lib/transition"
import Icon from "@lib/components/Icon.svelte"
import Field from "@lib/components/Field.svelte"
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import {onMount} from 'svelte'
import {onMount} from "svelte"
import {derived} from "svelte/store"
import {
getRelayUrls,
@@ -8,9 +8,9 @@
</script>
<script lang="ts">
import {onMount} from 'svelte'
import {onMount} from "svelte"
import {page} from "$app/stores"
import {writable} from 'svelte/store'
import {writable} from "svelte/store"
import {sortBy, now, assoc, append} from "@welshman/lib"
import type {TrustedEvent, EventContent} from "@welshman/util"
import {createEvent} from "@welshman/util"
@@ -82,7 +82,7 @@
}
onMount(() => {
subscribe({filters: [{'#~': [room], since: now()}], relays: [url]})
subscribe({filters: [{"#~": [room], since: now()}], relays: [url]})
})
setTimeout(() => {