Skip to content

Commit

Permalink
refactor: follow svelte component schema
Browse files Browse the repository at this point in the history
  • Loading branch information
maalni committed Mar 24, 2024
1 parent 10719b8 commit 6f84c37
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/navigator/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@
icon={mdiHome}
{isSidebarOpen}
link={'/'}
onClick={closeSidebar}
on:click={closeSidebar}
title="Dashboard"
/>
<SidebarEntry
icon={mdiStar}
{isSidebarOpen}
link={'/wish-statistics/overview'}
onClick={closeSidebar}
on:click={closeSidebar}
title="Wish Statistics"
/>

Expand Down Expand Up @@ -135,7 +135,7 @@
icon={mdiCog}
{isSidebarOpen}
link={'/settings'}
onClick={closeSidebar}
on:click={closeSidebar}
title="Settings"
/>
</div>
Expand All @@ -152,7 +152,7 @@
icon={mdiAccount}
{isSidebarOpen}
link={'/login'}
onClick={closeSidebar}
on:click={closeSidebar}
title="Login or Register"
variant="default"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
link={path.link}
icon={path.icon}
{isSidebarOpen}
onClick={closeSidebar}
on:click={closeSidebar}
/>
{/each}
</CollapsibleContent>
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/navigator/entry/SidebarEntry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
export let link: string;
export let title: string;
export let isSidebarOpen: boolean;
export let onClick: () => void;
$: currentActivePath = $page.url.pathname;
</script>
Expand All @@ -15,7 +14,7 @@
{...$$restProps}
href={link}
{icon}
{onClick}
on:click
variant={currentActivePath === link ? 'activeSidebar' : 'sidebar'}
>
<div class={`${isSidebarOpen ? '' : 'sm:max-xl:hidden'}`}>{title}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
class="w-full"
disabled={value === undefined}
icon={mdiFilterRemove}
onClick={clearFilter}
on:click={clearFilter}
>
Clear Filter
</IconButton>
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/ui/icon-button/IconButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import { Button } from '$lib/components/ui/button/index.js';
export let icon: string = '';
export let onClick: () => void = () => {};
</script>

<Button {...$$restProps} on:click={onClick}>
<Button {...$$restProps} on:click>
<Icon path={icon} />
{#if $$slots}
<div class="ml-2">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/searchbar/Searchbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<IconButton
class="min-w-48 max-sm:flex-1 justify-start"
icon={mdiMagnify}
onClick={opencmd}
on:click={opencmd}
variant="outline"
>
Search...
Expand Down
2 changes: 1 addition & 1 deletion src/routes/characters/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<Searchbar searchGroup="Characters" searchableDataList={data} />
<IconButton icon={mdiSort}>Sort By</IconButton>
<IconButton icon={mdiFilterOutline}>Filter By</IconButton>
<IconButton icon={view ? mdiViewList : mdiViewGrid} onClick={toggleViewType} />
<IconButton icon={view ? mdiViewList : mdiViewGrid} on:click={toggleViewType} />
</svelte:fragment>
<div class="flex flex-wrap gap-4 justify-center">
{#each data as character}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<div class="flex flex-row gap-4">
<IconButton href="/settings/import" icon={mdiImport}>Import Data</IconButton>
<IconButton icon={mdiExport} onClick={handleSettingsExport}>Export Data</IconButton>
<IconButton icon={mdiExport} on:click={handleSettingsExport}>Export Data</IconButton>
</div>
</div>
</DefaultLayout>
4 changes: 2 additions & 2 deletions src/routes/settings/import/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</Tabs>

<div class="flex items-center gap-2">
<IconButton icon={mdiImport} onClick={selectFile}>Select file</IconButton>
<IconButton icon={mdiImport} on:click={selectFile}>Select file</IconButton>
{#if file !== undefined}
{file?.name}
{:else}
Expand All @@ -93,7 +93,7 @@
<IconButton
disabled={file === undefined}
icon={mdiImport}
onClick={() => {
on:click={() => {
dialogOpen = true;
}}
>
Expand Down

0 comments on commit 6f84c37

Please sign in to comment.