Fix space membership on discover page

This commit is contained in:
Jon Staab
2024-10-09 09:44:41 -07:00
parent beaaa0e2ed
commit 3d85846f5f
2 changed files with 11 additions and 8 deletions
+1
View File
@@ -21,3 +21,4 @@ A discord-like nostr client based on the idea of "relays as groups". WIP.
- [ ] Sort/migrate repository data to keep important events - [ ] Sort/migrate repository data to keep important events
- Get rid of stuff from spaces the user isn't currently a member of - Get rid of stuff from spaces the user isn't currently a member of
- [ ] Apply mutes - [ ] Apply mutes
- [ ] Add discover > people/content tabs that pull from network rather than follows
+10 -8
View File
@@ -6,7 +6,7 @@
import {createScroller} from "@lib/html" import {createScroller} from "@lib/html"
import Icon from "@lib/components/Icon.svelte" import Icon from "@lib/components/Icon.svelte"
import {makeSpacePath} from "@app/routes" import {makeSpacePath} from "@app/routes"
import {userMembership, discoverRelays, getMembershipRoomsByUrl} from "@app/state" import {userMembership, discoverRelays, getMembershipUrls} from "@app/state"
let term = "" let term = ""
let limit = 20 let limit = 20
@@ -47,7 +47,7 @@
let:item={relay}> let:item={relay}>
<a <a
href={makeSpacePath(relay.url)} href={makeSpacePath(relay.url)}
class="card2 bg-alt shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]"> class="flex flex-col gap-2 card2 bg-alt shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]">
<div class="center avatar mt-8"> <div class="center avatar mt-8">
<div <div
class="center relative !flex w-20 rounded-full border-2 border-solid border-base-300 bg-base-300"> class="center relative !flex w-20 rounded-full border-2 border-solid border-base-300 bg-base-300">
@@ -58,12 +58,14 @@
{/if} {/if}
</div> </div>
</div> </div>
{#if getMembershipRoomsByUrl(relay.url, $userMembership)} {#if getMembershipUrls($userMembership).includes(relay.url)}
<div class="center absolute flex w-full"> <div class="flex justify-center">
<div <div class="relative">
class="tooltip relative left-8 top-[38px] h-5 w-5 rounded-full bg-primary" <div
data-tip="You are already a member of this space."> class="tooltip absolute -top-[88px] left-5 h-5 w-5 rounded-full bg-primary"
<Icon icon="check-circle" class="scale-110" /> data-tip="You are already a member of this space.">
<Icon icon="check-circle" class="scale-110" />
</div>
</div> </div>
</div> </div>
{/if} {/if}