Work on migrating files from sveltekit to svelte

This commit is contained in:
Aleksi Lassila
2024-01-15 01:25:07 +02:00
parent a36a65f874
commit fd1a87a2fe
19 changed files with 361 additions and 340 deletions

View File

@@ -1,31 +1,31 @@
<script lang="ts">
import Selectable from '../components/Selectable.svelte';
import classNames from 'classnames';
import { useNavigate } from 'svelte-navigator';
import { get } from 'svelte/store';
import { Container } from '../actions/focusAction';
export let to: string;
export let parentContainer: Container;
const { container, hasFocus } = parentContainer.createChild('navBarItem').getStores();
const navigate = useNavigate();
function handleClick() {
navigate(to);
get(Container.focusedObject)?.giveFocus('right');
}
</script>
<button on:click={handleClick}>
<Selectable {container}>
<div
class={classNames('flex items-center my-2', {
'text-amber-200': $hasFocus
})}
>
<slot name="icon" />
<slot name="text" />
</div>
</Selectable>
</button>
<script lang="ts">
import Selectable from '../components/Selectable.svelte';
import classNames from 'classnames';
import { useNavigate } from 'svelte-navigator';
import { get } from 'svelte/store';
import { Container } from '../actions/focusAction';
export let to: string;
export let parentContainer: Container;
const { container, hasFocus } = parentContainer.createChild('navBarItem').getStores();
const navigate = useNavigate();
function handleClick() {
navigate(to);
get(Container.focusedObject)?.giveFocus('right');
}
</script>
<button on:click={handleClick}>
<Selectable {container}>
<div
class={classNames('flex items-center my-2', {
'text-amber-200': $hasFocus
})}
>
<slot name="icon" />
<slot name="text" />
</div>
</Selectable>
</button>