Skip to content

Commit

Permalink
fix(TableColumn): moved type to the types folder to clean up Table co…
Browse files Browse the repository at this point in the history
…mponent
  • Loading branch information
Craig Howell committed Oct 1, 2022
1 parent fb7ff15 commit f2e6e5b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/lib/components/table/Table.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<script lang="ts" context="module">
export const TABLE_CONTEXT_ID = 'table-context-id';
// TODO: move this to the types folder
export interface TableColumn {
label: string;
column: string;
placement: 'left' | 'center' | 'right';
}
</script>

<script lang="ts">
import { twMerge } from 'tailwind-merge';
import { setContext } from 'svelte';
import { writable } from 'svelte/store';
import type { TableColumn } from '../../types/table-column';
export let columns: TableColumn[];
Expand Down
5 changes: 5 additions & 0 deletions src/lib/types/table-column.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface TableColumn {
label: string;
column: string;
placement: 'left' | 'center' | 'right';
}
3 changes: 1 addition & 2 deletions src/routes/table/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { Button, Card, Col, Pagination, Table } from '../../lib';
// TODO: move this to the types folder
import type { TableColumn } from '../../lib/components/table/Table.svelte';
import type { TableColumn } from '../../lib/types/table-column';
const columns: TableColumn[] = [
{
Expand Down

0 comments on commit f2e6e5b

Please sign in to comment.