misc: bump version

This commit is contained in:
Xylight committed 2024-06-12 16:24:15 -07:00
1 parent 75a30b20be
commit 741604d1db
5 files changed
+98 -21

No files matched your search

@@ -1,8 +1,11 @@
<script lang="ts">
import Avatar from '$lib/components/ui/Avatar.svelte'
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
import { communityLink } from '$lib/lemmy/generic'
import { addResumable } from '$lib/lemmy/item'
import type { Community } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Icon, Star } from 'svelte-hero-icons'
import { flip } from 'svelte/animate'
import { expoOut } from 'svelte/easing'
import { slide } from 'svelte/transition'
@@ -12,24 +15,41 @@
{#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)}
<div
class="inline-flex w-full"
class="inline-flex w-full items-center px-3"
animate:flip={{ duration: 500, easing: expoOut }}
>
<div class="flex-none grid group">
<Button
rounding="pill"
size="custom"
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
items-center justify-center box-border w-7 h-7"
style="grid-column: 1; grid-row: 1;"
on:click={() =>
addResumable({
id: follow.id,
name: follow.title,
type: 'community',
url: communityLink(follow),
avatar: follow.icon,
})}
>
<Icon src={Star} size="16" mini />
</Button>
<Avatar
url={follow.icon}
alt={follow.name}
title={follow.title}
width={28}
class="group-hover:hidden"
/>
</div>
<SidebarButton
class="font-normal w-full h-max"
class="font-normal w-full h-max !px-1"
color="tertiary"
alignment="left"
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
>
<div class="flex-none">
<Avatar
url={follow.icon}
alt={follow.name}
title={follow.title}
width={24}
slot="prefix"
/>
</div>
<div class="flex flex-col max-w-full break-words" slot="label">
<span>{follow.title}</span>
<span class="text-xs text-slate-600 dark:text-zinc-400">
+53 -2
View File
@@ -27,6 +27,7 @@
import EndPlaceholder from '../EndPlaceholder.svelte'
import Application from '../../../../routes/admin/applications/Application.svelte'
import { t } from '$lib/translations'
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
</script>
<nav
@@ -93,15 +94,65 @@
</SidebarButton>
{/if}
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{#if $profile?.favorites && $profile?.favorites.length > 0}
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expand.favorites}
>
<span
slot="title"
class="px-2 py-1 w-full {$userSettings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder>
{$t('routes.profile.favorites')}
<span slot="action" class="dark:text-white text-black">
{$profile.favorites.length}
</span>
</EndPlaceholder>
</span>
<ItemList
items={$profile.favorites.map((i) => ({
avatar: i.avatar ?? '',
id: i.id,
name: i.name,
url: i.url.toString(),
instance: 'doesnt exist',
}))}
/>
</Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
{#if $profile?.user}
{#if $profile?.user.moderates.length > 0}
<CommunityList items={$profile.user.moderates.map((i) => i.community)} />
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expand.moderates}
>
<span
slot="title"
class="px-2 py-1 w-full {$userSettings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder>
{$t('routes.profile.moderates')}
<span slot="action" class="dark:text-white text-black">
{$profile.user.moderates.length}
</span>
</EndPlaceholder>
</span>
<CommunityList
items={$profile.user.moderates.map((i) => i.community)}
/>
</Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expandCommunities}
bind:open={$userSettings.expand.communities}
>
<span
slot="title"
+3 -4
View File
@@ -70,7 +70,7 @@ export const isPrivateMessageReport = (
): item is PrivateMessageReportView => 'private_message_report' in item
export interface ResumableItem {
url: URL
url: string
id: number
name: string
avatar?: string
@@ -88,10 +88,9 @@ export function addResumable(item: ResumableItem) {
let favs = p.favorites ?? []
if (favs.map((fav) => fav.url.toString()).includes(item.url.toString()))
return
if (favs.length >= 5) favs.pop()
favs.unshift(item)
profile.update(() => ({
...p,
favorites: favs
favorites: favs,
}))
}
}
+10 -3
View File
@@ -46,7 +46,11 @@ interface Settings {
removed: boolean
}
expandSidebar: boolean
expandCommunities: boolean
expand: {
communities: boolean
moderates: boolean
favorites: boolean
}
displayNames: boolean
nsfwBlur: boolean
moderation: {
@@ -104,8 +108,11 @@ export const defaultSettings: Settings = {
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? true,
},
expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true,
expandCommunities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
expandFavorites: toBool(env.PUBLIC_EXPAND_FAVORITES) ?? true,
expand: {
communities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
favorites: toBool(env.PUBLIC_EXPAND_FAVORITES) ?? true,
moderates: toBool(env.PUBLIC_EXPAND_MODERATES) ?? true,
},
displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true,
nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true,
moderation: {