working on the frontend, adding torrent page, working on show directory, working on the api

This commit is contained in:
maxDorninger
2025-05-11 10:59:38 +02:00
parent 180771882d
commit ef7b020043
164 changed files with 5389 additions and 1594 deletions

View File

@@ -1,6 +1,6 @@
import {IsMobile} from "$lib/hooks/is-mobile.svelte.js";
import {getContext, setContext} from "svelte";
import {SIDEBAR_KEYBOARD_SHORTCUT} from "./constants.js";
import {IsMobile} from '$lib/hooks/is-mobile.svelte.js';
import {getContext, setContext} from 'svelte';
import {SIDEBAR_KEYBOARD_SHORTCUT} from './constants.js';
type Getter<T> = () => T;
@@ -24,9 +24,9 @@ class SidebarState {
readonly props: SidebarStateProps;
open = $derived.by(() => this.props.open());
openMobile = $state(false);
setOpen: SidebarStateProps["setOpen"];
state = $derived.by(() => (this.open ? "expanded" : "collapsed"));
setOpen: SidebarStateProps['setOpen'];
#isMobile: IsMobile;
state = $derived.by(() => (this.open ? 'expanded' : 'collapsed'));
constructor(props: SidebarStateProps) {
this.setOpen = props.setOpen;
@@ -53,13 +53,11 @@ class SidebarState {
};
toggle = () => {
return this.#isMobile.current
? (this.openMobile = !this.openMobile)
: this.setOpen(!this.open);
return this.#isMobile.current ? (this.openMobile = !this.openMobile) : this.setOpen(!this.open);
};
}
const SYMBOL_KEY = "scn-sidebar";
const SYMBOL_KEY = 'scn-sidebar';
/**
* Instantiates a new `SidebarState` instance and sets it in the context.