fix: remove sidebar stuff

This commit is contained in:
Xyphyn committed 2023-10-03 20:00:22 -07:00
1 parent a0ce677abc
commit e4a8718ba4
4 files changed
+15 -48

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "1.16.3", "version": "1.16.4",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
@@ -7,7 +7,6 @@
import { slide } from 'svelte/transition' import { slide } from 'svelte/transition'
export let items: Community[] export let items: Community[]
export let expanded: boolean
</script> </script>
{#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)} {#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)}
@@ -16,7 +15,7 @@
animate:flip={{ duration: 500, easing: expoOut }} animate:flip={{ duration: 500, easing: expoOut }}
> >
<Button <Button
class="font-normal w-full h-max {expanded ? '' : '!p-1.5'}" class="font-normal w-full h-max"
color="tertiary" color="tertiary"
alignment="left" alignment="left"
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}" href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
@@ -30,10 +29,7 @@
slot="prefix" slot="prefix"
/> />
</div> </div>
<div <div class="flex flex-col max-w-full break-words">
class="flex flex-col max-w-full break-words"
class:hidden={!expanded}
>
<span>{follow.title}</span> <span>{follow.title}</span>
<span class="text-xs text-slate-600 dark:text-zinc-400"> <span class="text-xs text-slate-600 dark:text-zinc-400">
{new URL(follow.actor_id).hostname} {new URL(follow.actor_id).hostname}
+11 -36
View File
@@ -23,33 +23,14 @@
<nav <nav
class="flex flex-col pl-4 pr-4 py-4 overflow-auto class="flex flex-col pl-4 pr-4 py-4 overflow-auto
gap-1 max-h-[calc(100svh-4rem)] gap-1 max-h-[calc(100svh-4rem)] {$$props.class}"
{$userSettings.expandSidebar
? ''
: 'w-max max-w-max min-w-max'} {$$props.class}"
style={$$props.style} style={$$props.style}
> >
<!-- <Button <SidebarButton href="/">
on:click={() =>
($userSettings.expandSidebar = !$userSettings.expandSidebar)}
class="w-max !p-2"
aria-label="Collapse sidebar"
>
<Icon
src={ChevronDoubleLeft}
mini
size="16"
class="transition-transform {$userSettings.expandSidebar
? ''
: 'rotate-180'}"
title="Toggle Sidebar"
/>
</Button> -->
<SidebarButton href="/" expanded={$userSettings.expandSidebar}>
<Icon src={Home} mini={route == '/'} size="20" title="Frontpage" /> <Icon src={Home} mini={route == '/'} size="20" title="Frontpage" />
<span>Frontpage</span> <span>Frontpage</span>
</SidebarButton> </SidebarButton>
<SidebarButton href="/settings" expanded={$userSettings.expandSidebar}> <SidebarButton href="/settings">
<Icon <Icon
src={Cog6Tooth} src={Cog6Tooth}
mini={route == '/settings'} mini={route == '/settings'}
@@ -58,7 +39,7 @@
/> />
<span>Settings</span> <span>Settings</span>
</SidebarButton> </SidebarButton>
<SidebarButton expanded={$userSettings.expandSidebar} href="/communities"> <SidebarButton href="/communities">
<Icon mini={route == '/communities'} src={GlobeAlt} size="20" /> <Icon mini={route == '/communities'} src={GlobeAlt} size="20" />
<span>Communities</span> <span>Communities</span>
</SidebarButton> </SidebarButton>
@@ -66,10 +47,10 @@
<hr class="border-slate-300 dark:border-zinc-800 my-1" /> <hr class="border-slate-300 dark:border-zinc-800 my-1" />
{#each $profileData.profiles as prof, index (prof.id)} {#each $profileData.profiles as prof, index (prof.id)}
<div animate:flip={{ duration: 300, easing: expoOut }} class="w-full"> <div animate:flip={{ duration: 300, easing: expoOut }} class="w-full">
<ProfileButton {index} {prof} expanded={$userSettings.expandSidebar} /> <ProfileButton {index} {prof} />
</div> </div>
{/each} {/each}
<SidebarButton href="/accounts" expanded={$userSettings.expandSidebar}> <SidebarButton href="/accounts">
<Icon src={UserGroup} mini size="20" /> <Icon src={UserGroup} mini size="20" />
<span>Accounts</span> <span>Accounts</span>
</SidebarButton> </SidebarButton>
@@ -77,20 +58,14 @@
<hr class="border-slate-300 dark:border-zinc-800 my-1" /> <hr class="border-slate-300 dark:border-zinc-800 my-1" />
{#if $profile?.user} {#if $profile?.user}
{#if $profile?.user.moderates.length > 0} {#if $profile?.user.moderates.length > 0}
<CommunityList <CommunityList items={$profile.user.moderates.map((i) => i.community)} />
expanded={$userSettings.expandSidebar}
items={$profile.user.moderates.map((i) => i.community)}
/>
<hr class="border-slate-300 dark:border-zinc-800 my-1" /> <hr class="border-slate-300 dark:border-zinc-800 my-1" />
{/if} {/if}
<CommunityList <CommunityList items={$profile.user.follows.map((i) => i.community)} />
expanded={$userSettings.expandSidebar}
items={$profile.user.follows.map((i) => i.community)}
/>
{:else} {:else}
<Button <Button
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}" class="hover:bg-slate-200"
href="/login" href="/login"
color="tertiary" color="tertiary"
alignment="left" alignment="left"
@@ -100,7 +75,7 @@
<span>Log In</span> <span>Log In</span>
</Button> </Button>
<Button <Button
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}" class="hover:bg-slate-200"
href="/signup" href="/signup"
color="tertiary" color="tertiary"
alignment="left" alignment="left"
@@ -110,7 +85,7 @@
<span>Sign Up</span> <span>Sign Up</span>
</Button> </Button>
<Button <Button
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'}" class="hover:bg-slate-200"
href="/accounts" href="/accounts"
color="tertiary" color="tertiary"
alignment="left" alignment="left"
@@ -1,7 +1,5 @@
<script lang="ts"> <script lang="ts">
import { Button } from 'mono-svelte' import { Button } from 'mono-svelte'
export let expanded: boolean
</script> </script>
<Button <Button
@@ -9,9 +7,7 @@
color="tertiary" color="tertiary"
alignment="left" alignment="left"
on:click on:click
class="hover:bg-slate-100 font-normal {expanded class="hover:bg-slate-100 font-normal {$$props.class}"
? ''
: '!p-1.5'} {$$props.class}"
> >
<slot /> <slot />
</Button> </Button>