Code format

This commit is contained in:
2024-06-12 09:47:49 +02:00
parent 5a791dcb3d
commit a7d76a1f14
2 changed files with 72 additions and 69 deletions

View File

@@ -1,12 +1,9 @@
<script lang="ts"> <script lang="ts">
import { type Food, FoodService } from '$lib/database/food' import { type Food, FoodService } from '$lib/database/food'
import { toast } from 'svelte-sonner' import { toast } from 'svelte-sonner'
import { createEventDispatcher } from 'svelte'
import type { Err } from '$lib/types' import type { Err } from '$lib/types'
import { foodStore } from '$lib/store/foodStore' import { foodStore } from '$lib/store/foodStore'
const dispatch = createEventDispatcher()
let item: Food = { let item: Food = {
food: '', food: '',
amount: 0, amount: 0,

View File

@@ -1,18 +1,18 @@
<script lang="ts"> <script lang="ts">
import { appWindow } from '@tauri-apps/api/window' import { appWindow } from '@tauri-apps/api/window'
import { faXmark, faWindowMinimize } from '@fortawesome/free-solid-svg-icons' import { faWindowMinimize, faXmark } from '@fortawesome/free-solid-svg-icons'
import { faGithub } from '@fortawesome/free-brands-svg-icons' import { faGithub } from '@fortawesome/free-brands-svg-icons'
import Fa from 'svelte-fa' import Fa from 'svelte-fa'
import { link } from 'svelte-spa-router' import { link, location } from 'svelte-spa-router'
import { Button } from '$components/ui/button' import { Button } from '$components/ui/button'
import { Sun, Moon } from 'lucide-svelte' import { Moon, Sun } from 'lucide-svelte'
import { toggleMode } from 'mode-watcher' import { toggleMode } from 'mode-watcher'
import { cn } from '$lib/utils' import { cn } from '$lib/utils'
import { location } from 'svelte-spa-router'
import { dbStateStore } from '$lib/store/dbState' import { dbStateStore } from '$lib/store/dbState'
import { DBService } from '$lib/database' import { DBService } from '$lib/database'
Fa
// You can structure your links however you'd like, but I like to keep them in an array of objects // You can structure your links however you'd like, but I like to keep them in an array of objects
type Link = { type Link = {
label: string label: string
@@ -23,6 +23,10 @@
label: 'Home', label: 'Home',
href: '/' href: '/'
}, },
{
label: 'Daily',
href: '/daily'
}
] ]
</script> </script>
@@ -45,8 +49,10 @@
class="flex space-x-4 text-xl font-bold select-none" class="flex space-x-4 text-xl font-bold select-none"
on:dragstart|preventDefault on:dragstart|preventDefault
> >
<div class:text-amber-500="{$dbStateStore.transacting}" on:click={DBService.Begin} class="cursor-pointer">T</div> <div class:text-amber-500="{$dbStateStore.transacting}" on:click={DBService.Begin} class="cursor-pointer">T
<div class:text-emerald-600={$dbStateStore.transacting} on:click={DBService.Commit} class="cursor-pointer">C</div> </div>
<div class:text-emerald-600={$dbStateStore.transacting} on:click={DBService.Commit} class="cursor-pointer">C
</div>
<div class:text-red-700={$dbStateStore.transacting} on:click={DBService.Rollback} class="cursor-pointer">R</div> <div class:text-red-700={$dbStateStore.transacting} on:click={DBService.Rollback} class="cursor-pointer">R</div>
{#each links as { href, label }} {#each links as { href, label }}
<a <a