feat: switch to svh

This commit is contained in:
Xyphyn committed 2023-08-05 13:18:21 -07:00
1 parent 5c04bdb677
commit d59060ab35
6 files changed
+19 -12

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ import { getClient } from '$lib/lemmy.js'
import type { MyUserInfo } from 'lemmy-js-client' import type { MyUserInfo } from 'lemmy-js-client'
import { get, writable } from 'svelte/store' import { get, writable } from 'svelte/store'
const getDefaultProfile = () => ({ const getDefaultProfile = (): Profile => ({
id: -1, id: -1,
instance: get(profileData)?.defaultInstance ?? get(instance), instance: get(profileData)?.defaultInstance ?? get(instance),
}) })
+1
View File
@@ -70,6 +70,7 @@
{#if href} {#if href}
<a <a
{href} {href}
on:click
{...$$restProps} {...$$restProps}
class=" class="
{buttonColor[color]} {buttonColor[color]}
+1 -1
View File
@@ -1,6 +1,6 @@
<aside <aside
class="sticky top-16 break-words flex class="sticky top-16 break-words flex
flex-col gap-4 p-6 max-w-[20rem] min-w-[18rem] max-h-[calc(100vh-4rem)] flex-col gap-4 p-6 max-w-[20rem] min-w-[18rem] max-h-[calc(100svh-4rem)]
overflow-auto text-sm border-l border-slate-200 dark:border-zinc-800 {$$props.class}" overflow-auto text-sm border-l border-slate-200 dark:border-zinc-800 {$$props.class}"
> >
<slot /> <slot />
+13 -8
View File
@@ -21,20 +21,23 @@
<nav <nav
class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto sticky top-16 bottom-0 class="hidden sm:flex flex-col pl-4 pr-4 py-4 overflow-auto sticky top-16 bottom-0
gap-1 max-h-[calc(100vh-4rem)] w-full bg-slate-100 dark:bg-black gap-1 max-h-[calc(100svh-4rem)] w-full bg-slate-100 dark:bg-black
{$userSettings.expandSidebar {$userSettings.expandSidebar
? 'max-w-[25%] resize-x min-w-[12rem]' ? 'max-w-[25%] resize-x min-w-[12rem]'
: 'w-max max-w-max min-w-max'}" : 'w-max max-w-max min-w-max'}"
> >
<Button <Button
on:click={() => ($userSettings.expandSidebar = !$userSettings.expandSidebar)} on:click={() =>
($userSettings.expandSidebar = !$userSettings.expandSidebar)}
class="w-max !p-2 hover:bg-slate-200" class="w-max !p-2 hover:bg-slate-200"
> >
<Icon <Icon
src={ChevronDoubleLeft} src={ChevronDoubleLeft}
mini mini
size="16" size="16"
class="transition-transform {$userSettings.expandSidebar ? '' : 'rotate-180'}" class="transition-transform {$userSettings.expandSidebar
? ''
: 'rotate-180'}"
title="Toggle Sidebar" title="Toggle Sidebar"
/> />
</Button> </Button>
@@ -58,10 +61,9 @@
invalidateAll: true, invalidateAll: true,
}) })
}} }}
class="hover:bg-slate-200 {$userSettings.expandSidebar ? '' : '!p-1.5'} {$profile?.id == class="hover:bg-slate-200 {$userSettings.expandSidebar
prof.id ? ''
? 'font-bold' : '!p-1.5'} {$profile?.id == prof.id ? 'font-bold' : ''}"
: ''}"
> >
<Icon <Icon
src={UserCircle} src={UserCircle}
@@ -71,7 +73,10 @@
class="text-blue-500" class="text-blue-500"
style="filter: hue-rotate({index * 50}deg)" style="filter: hue-rotate({index * 50}deg)"
/> />
<span class:hidden={!$userSettings.expandSidebar} class="flex flex-col gap-0"> <span
class:hidden={!$userSettings.expandSidebar}
class="flex flex-col gap-0"
>
{prof.username} {prof.username}
<span class="text-slate-500 dark:text-zinc-400 font-normal text-xs"> <span class="text-slate-500 dark:text-zinc-400 font-normal text-xs">
{prof.instance} {prof.instance}
@@ -102,11 +102,11 @@
<img <img
src={post.url} src={post.url}
alt={post.name} alt={post.name}
class="rounded-md max-w-screen max-h-[80vh] mx-auto" class="rounded-md max-w-screen max-h-[80svh] mx-auto"
/> />
{:else if isVideo(post.url)} {:else if isVideo(post.url)}
<!-- svelte-ignore a11y-media-has-caption --> <!-- svelte-ignore a11y-media-has-caption -->
<video class="rounded-md max-w-screen max-h-[80vh] mx-auto" controls> <video class="rounded-md max-w-screen max-h-[80svh] mx-auto" controls>
<source src={post.url} /> <source src={post.url} />
</video> </video>
{:else if post.url && !post.thumbnail_url} {:else if post.url && !post.thumbnail_url}
+1
View File
@@ -21,6 +21,7 @@ const config = {
// }, // },
// mode: 'nonce' // mode: 'nonce'
// } // }
}, },
}; };