Skip to content

Commit

Permalink
Move ButtonsPagination.svelte component in ui-components
Browse files Browse the repository at this point in the history
  • Loading branch information
ninokeldishvili committed Dec 10, 2024
1 parent f9a5742 commit 03d3bc4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
39 changes: 39 additions & 0 deletions packages/ui-components/src/lib/components/ButtonsPagination.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script lang="ts">
import { ArrowLeftOutline, ArrowRightOutline } from 'flowbite-svelte-icons';
import { createEventDispatcher } from 'svelte';
import { Button, Spinner } from 'flowbite-svelte';
const dispatch = createEventDispatcher();
export let index: number = 1;
export let loading = false;
</script>

<div class="flex items-center">
{#if loading}
<Spinner class="mr-4 h-5 w-5" color="white" />
{/if}
<Button
class="border-1 rounded-none rounded-l-lg"
disabled={loading || index == 1}
on:click={() => dispatch('previous')}
color="light"
>
<ArrowLeftOutline class="me-2 h-3.5 w-3.5" />
Previous
</Button>
<div
class="justify-center border border-gray-300 bg-white px-5 py-2.5 text-center text-sm font-medium dark:border-gray-600 dark:bg-gray-800 dark:text-white"
>
{index}
</div>
<Button
class="border-1 rounded-none rounded-r-lg"
disabled={loading}
on:click={() => dispatch('next')}
color="light"
>
Next
<ArrowRightOutline class="ms-2 h-3.5 w-3.5" />
</Button>
</div>
1 change: 1 addition & 0 deletions packages/ui-components/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export { default as Heading } from './components/Heading.svelte';
export { default as Text } from './components/Text.svelte';
export { default as DropdownProperty } from './components/DropdownProperty.svelte';
export { default as IconError } from './components/IconError.svelte';
export { default as ButtonsPagination } from './components/ButtonsPagination.svelte';

//Types
export type { AppStoresInterface } from './types/appStores.ts';
Expand Down
2 changes: 1 addition & 1 deletion tauri-app/src/lib/components/AppTable.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" generics="T">
import { Spinner, Table, TableBody, TableBodyRow, TableHead } from 'flowbite-svelte';
import { FileCsvOutline } from 'flowbite-svelte-icons';
import ButtonsPagination from '$lib/components/ButtonsPagination.svelte';
import { ButtonsPagination } from '@rainlanguage/ui-components';
import type { ListStore } from '$lib/storesGeneric/listStore';
import ButtonLoading from './ButtonLoading.svelte';
import { createEventDispatcher } from 'svelte';
Expand Down
39 changes: 0 additions & 39 deletions tauri-app/src/lib/components/ButtonsPagination.svelte

This file was deleted.

0 comments on commit 03d3bc4

Please sign in to comment.