Skip to content

Commit d73fa09

Browse files
committed
feat: added header at the top of the table
1 parent 618db1a commit d73fa09

File tree

9 files changed

+292
-276
lines changed

9 files changed

+292
-276
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script lang="ts">
2+
import type { Snippet } from "svelte";
3+
4+
let { children }:{children: Snippet} = $props();
5+
</script>
6+
7+
<article class="bg-gray rounded-[26px] px-4 py-7">
8+
{@render children?.()}
9+
</article>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script lang="ts">
2+
let { title, searchValue = $bindable(""), rightTitle}:{title: string, searchValue: string, rightTitle: string} = $props();
3+
</script>
4+
5+
<header class="w-full flex items-center justify-between mb-4 px-4">
6+
<div class="flex items-center gap-4">
7+
<p class="text-black-700 font-semibold whitespace-nowrap">{title}</p>
8+
<input
9+
type="text"
10+
placeholder="Search eVaults"
11+
bind:value={searchValue}
12+
class="border border-gray-300 bg-black-100 px-4 py-1.5 rounded-[8px] w-full text-xs text-black-700 placeholder:text-black-700 outline-0"
13+
/>
14+
</div>
15+
16+
<div class="flex gap-2 items-center">
17+
<span class='w-2 h-2 inline-block rounded-full bg-secondary'></span>
18+
<p class="text-sm text-black-700">{rightTitle}</p>
19+
</div>
20+
</header>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export { default as LiveDataFlow } from "./LiveDataFlow/LiveDataFlow.svelte";
22
export { default as Logs } from "./Logs/Logs.svelte";
3-
export { default as VaultNode } from "./Nodes/VaultNode.svelte";
3+
export { default as VaultNode } from "./Nodes/VaultNode.svelte";
4+
export { default as TableCard } from "./TableCard/TableCard.svelte";
5+
export { default as TableCardHeader } from "./TableCardHeader/TableCardHeader.svelte";

infrastructure/control-panel/src/routes/+layout.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
{#if pageUrl === "/"}
1515
<div class="flex items-center gap-4">
1616
<ButtonAction size="sm" variant="soft">Refresh</ButtonAction>
17-
<ButtonAction size="sm" class="whitespace-nowrap" variant="soft" callback={() => goto("/monitoring")}>Start Monitoring</ButtonAction>
17+
<ButtonAction size="sm" class="whitespace-nowrap" variant="solid" callback={() => goto("/monitoring")}>Start Monitoring</ButtonAction>
1818
</div>
1919
{:else}
20-
<ButtonAction size="sm" class="whitespace-nowrap" variant="soft" callback={() => goto("/")}>Exit Monitoring</ButtonAction>
20+
<ButtonAction size="sm" class="whitespace-nowrap" variant="solid" callback={() => goto("/")}>Exit Monitoring</ButtonAction>
2121
{/if}
2222
</header>
2323
<section class="px-10">

infrastructure/control-panel/src/routes/+page.svelte

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import {TableCard, TableCardHeader} from '$lib/fragments';
23
import { Table } from '$lib/ui';
34
45
const handlePreviousPage = async () => {
@@ -15,11 +16,13 @@
1516
'Smart Contract'
1617
// "Ledger Link",
1718
];
19+
1820
const pages = [
1921
{ name: '1', href: '#' },
2022
{ name: '2', href: '#' },
2123
{ name: '3', href: '#' }
2224
];
25+
2326
const tableData = [
2427
{
2528
image: 'https://example.com/image1.jpg',
@@ -61,12 +64,6 @@
6164
type: 'text',
6265
value: row.smartContract
6366
}
64-
// rowSix: {
65-
// type: "snippet",
66-
// snippet: BadgeCell,
67-
// value:
68-
// row.ledgerLink,
69-
// },
7067
};
7168
});
7269
@@ -95,18 +92,31 @@
9592
</script>
9693

9794
<section>
98-
<Table
99-
class="mb-7"
100-
tableData= {mappedData}
101-
withSelection= {true}
102-
{handlePreviousPage}
103-
{handleNextPage}
104-
/>
95+
<TableCard>
96+
<TableCardHeader
97+
title="Events"
98+
searchValue=""
99+
rightTitle="No evault selected. Select an evault to monitor logs"/>
100+
<Table
101+
class="mb-7"
102+
tableData= {mappedData}
103+
withSelection= {true}
104+
{handlePreviousPage}
105+
{handleNextPage}
106+
/>
107+
</TableCard>
105108

106-
<Table
107-
tableData= {mappedData}
108-
withSelection= {true}
109-
{handlePreviousPage}
110-
{handleNextPage}
111-
/>
109+
<TableCard>
110+
<TableCardHeader
111+
title="Events"
112+
searchValue=""
113+
rightTitle="No evault selected. Select an evault to monitor logs"/>
114+
<Table
115+
class="mb-7"
116+
tableData= {mappedData}
117+
withSelection= {true}
118+
{handlePreviousPage}
119+
{handleNextPage}
120+
/>
121+
</TableCard>
112122
</section>

infrastructure/control-panel/src/routes/example/+page.svelte

Lines changed: 0 additions & 223 deletions
This file was deleted.

0 commit comments

Comments
 (0)