diff --git a/src/lib/components/atoms/buttons/ActionEntryButton.svelte b/src/lib/components/atoms/buttons/ActionEntryButton.svelte new file mode 100644 index 0000000..94e9235 --- /dev/null +++ b/src/lib/components/atoms/buttons/ActionEntryButton.svelte @@ -0,0 +1,61 @@ + + + + +
setTimeout(onclick, 100))} + class={["rounded-xl", props.class]} +> +
+
+ {@render children?.()} +
+ {#if ActionButtonIcon} + + {/if} +
+
+ + diff --git a/src/lib/components/atoms/buttons/index.ts b/src/lib/components/atoms/buttons/index.ts index 1765400..fc5022f 100644 --- a/src/lib/components/atoms/buttons/index.ts +++ b/src/lib/components/atoms/buttons/index.ts @@ -1,3 +1,4 @@ +export { default as ActionEntryButton } from "./ActionEntryButton.svelte"; export { default as Button } from "./Button.svelte"; export { default as EntryButton } from "./EntryButton.svelte"; export { default as FloatingButton } from "./FloatingButton.svelte"; diff --git a/src/lib/components/molecules/labels/IconLabel.svelte b/src/lib/components/molecules/labels/IconLabel.svelte index c4a982a..038f6c9 100644 --- a/src/lib/components/molecules/labels/IconLabel.svelte +++ b/src/lib/components/molecules/labels/IconLabel.svelte @@ -18,12 +18,12 @@
-
-

+

+

{@render children?.()}

{#if subtext} -

+

{@render subtext()}

{/if} diff --git a/src/lib/molecules/Categories/Category.svelte b/src/lib/molecules/Categories/Category.svelte index ea2c392..aab227c 100644 --- a/src/lib/molecules/Categories/Category.svelte +++ b/src/lib/molecules/Categories/Category.svelte @@ -2,11 +2,11 @@ import type { Component } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; import type { Writable } from "svelte/store"; + import { ActionEntryButton } from "$lib/components/atoms"; + import { CategoryLabel } from "$lib/components/molecules"; import type { CategoryInfo } from "$lib/modules/filesystem"; import type { SelectedCategory } from "./service"; - import IconCategory from "~icons/material-symbols/category"; - interface Props { info: Writable; menuIcon?: Component; @@ -14,58 +14,30 @@ onMenuClick?: (category: SelectedCategory) => void; } - let { info, menuIcon: MenuIcon, onclick, onMenuClick }: Props = $props(); + let { info, menuIcon, onclick, onMenuClick }: Props = $props(); const openCategory = () => { const { id, dataKey, dataKeyVersion, name } = $info as CategoryInfo; if (!dataKey || !dataKeyVersion) return; // TODO: Error handling - setTimeout(() => { - onclick({ id, dataKey, dataKeyVersion, name }); - }, 100); + onclick({ id, dataKey, dataKeyVersion, name }); }; - const openMenu = (e: Event) => { - e.stopPropagation(); - + const openMenu = () => { const { id, dataKey, dataKeyVersion, name } = $info as CategoryInfo; if (!dataKey || !dataKeyVersion) return; // TODO: Error handling - setTimeout(() => { - onMenuClick!({ id, dataKey, dataKeyVersion, name }); - }, 100); + onMenuClick!({ id, dataKey, dataKeyVersion, name }); }; {#if $info} - - -
-
-
- -
-

- {$info.name} -

- {#if MenuIcon && onMenuClick} - - {/if} -
-
+ + + {/if} - - diff --git a/src/lib/organisms/Category/File.svelte b/src/lib/organisms/Category/File.svelte index e611b0b..5263b95 100644 --- a/src/lib/organisms/Category/File.svelte +++ b/src/lib/organisms/Category/File.svelte @@ -1,9 +1,10 @@ {#if $info} - - -
-
-
- -
-

- {$info.name} -

- {#if onRemoveClick} - - {/if} -
-
+ + + {/if} - - diff --git a/src/routes/(main)/directory/[[id]]/DirectoryEntries/File.svelte b/src/routes/(main)/directory/[[id]]/DirectoryEntries/File.svelte index b25bd2f..fd59d03 100644 --- a/src/routes/(main)/directory/[[id]]/DirectoryEntries/File.svelte +++ b/src/routes/(main)/directory/[[id]]/DirectoryEntries/File.svelte @@ -1,10 +1,11 @@ {#if $info} - - -
-
-
- -
-
-

- {$info.name} -

-

- {formatDateTime($info.createdAt ?? $info.lastModifiedAt)} -

-
- -
-
+ + + {/if} - - diff --git a/src/routes/(main)/directory/[[id]]/DirectoryEntries/SubDirectory.svelte b/src/routes/(main)/directory/[[id]]/DirectoryEntries/SubDirectory.svelte index bea9e73..5454695 100644 --- a/src/routes/(main)/directory/[[id]]/DirectoryEntries/SubDirectory.svelte +++ b/src/routes/(main)/directory/[[id]]/DirectoryEntries/SubDirectory.svelte @@ -1,9 +1,10 @@ {#if $info} - - -
-
-
- -
-

- {$info.name} -

- -
-
+ + + {/if} - -