Fix notification badge on mobile nav

This commit is contained in:
Jon Staab
2026-04-02 16:47:32 -07:00
parent 8710043a02
commit 1c8457a4bf
3 changed files with 11 additions and 5 deletions
+4 -2
View File
@@ -14,7 +14,7 @@
import {userSpaceUrls, PLATFORM_RELAYS} from "@app/core/state"
import {pushModal} from "@app/util/modal"
import {notifications} from "@app/util/notifications"
import {goToChat} from "@app/util/routes"
import {goToChat, makeSpacePath} from "@app/util/routes"
type Props = {
children?: Snippet
@@ -26,7 +26,9 @@
const showSettingsMenu = () => pushModal(MenuSettings)
const anySpaceNotifications = $derived($userSpaceUrls.some(p => $notifications.has(p)))
const anySpaceNotifications = $derived(
$userSpaceUrls.some(p => $notifications.has(makeSpacePath(p))),
)
</script>
<div
+1 -1
View File
@@ -35,7 +35,7 @@
</div>
{/if}
</div>
<div>
<div class="min-w-0">
<h2 class="ellipsize whitespace-nowrap text-xl">
<RelayName {url} />
</h2>
+6 -2
View File
@@ -31,7 +31,8 @@
} from "@app/core/state"
import {setSpaceMembershipOrder} from "@app/core/commands"
import {pushModal} from "@app/util/modal"
import {goToSpace} from "@app/util/routes"
import {goToSpace, makeSpacePath} from "@app/util/routes"
import {notifications} from "@app/util/notifications"
const addSpace = () => pushModal(SpaceAdd)
@@ -254,9 +255,12 @@
ondrop={e => onDrop(e, url)}
ondragend={onDragEnd}>
<Button
class="card2 bg-alt shadow-md transition-all hover:shadow-lg hover:dark:brightness-[1.1] w-full"
class="card2 bg-alt shadow-md transition-all hover:shadow-lg hover:dark:brightness-[1.1] w-full relative"
onclick={() => openSpace(url)}>
<RelaySummary hideFavorites {url} />
{#if $notifications.has(makeSpacePath(url))}
<div class="absolute right-3 top-3 h-2 w-2 rounded-full bg-primary"></div>
{/if}
</Button>
</div>
{/each}