Skip to content

Commit 30f3bba

Browse files
committed
Merge branch 'main' of github.com:RequestNetwork/web-components into 161-colorize-the-status-column-in-the-invoice-dashboard
2 parents 6d91db2 + 787dc39 commit 30f3bba

20 files changed

+528
-8
lines changed

packages/invoice-dashboard/src/lib/view-requests.svelte

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import ChevronUp from "@requestnetwork/shared-icons/chevron-up.svelte";
2323
import Download from "@requestnetwork/shared-icons/download.svelte";
2424
import Search from "@requestnetwork/shared-icons/search.svelte";
25+
import Network from "@requestnetwork/shared-icons/network/network-icon.svelte";
2526
// Types
2627
import type {
2728
GetAccountReturnType,
@@ -32,9 +33,9 @@
3233
import type { IConfig } from "@requestnetwork/shared-types";
3334
import type { RequestNetwork } from "@requestnetwork/request-client.js";
3435
// Utils
35-
import { checkStatus } from "@requestnetwork/shared-utils/checkStatus";
3636
import { config as defaultConfig } from "@requestnetwork/shared-utils/config";
3737
import { initializeCurrencyManager } from "@requestnetwork/shared-utils/initCurrencyManager";
38+
import { checkStatus } from "@requestnetwork/shared-utils/checkStatus";
3839
import { exportToPDF } from "@requestnetwork/shared-utils/generateInvoice";
3940
import { getCurrencyFromManager } from "@requestnetwork/shared-utils/getCurrency";
4041
import { CurrencyManager } from "@requestnetwork/currency";
@@ -563,11 +564,22 @@
563564
</i>
564565
</div>
565566
</th>
567+
<th on:click={() => handleSort("currencyInfo.network")}>
568+
<div>
569+
Payment Chain<i class={`caret `}>
570+
{#if sortOrder === "asc" && sortColumn === "currencyInfo.network"}
571+
<ChevronUp />
572+
{:else}
573+
<ChevronDown />
574+
{/if}
575+
</i>
576+
</div>
577+
</th>
566578
<th></th>
567579
</tr>
568580
</thead>
569581
<tbody>
570-
{#if !loading && processedRequests}
582+
{#if processedRequests.length > 0}
571583
{#each processedRequests as request}
572584
<tr class="row" on:click={(e) => handleRequestSelect(e, request)}>
573585
{#if columns.issuedAt}
@@ -590,7 +602,6 @@
590602
{new Date(request.timestamp * 1000).toLocaleDateString()}
591603
</td>
592604
<td>{request.contentData.invoiceNumber || "-"}</td>
593-
<td>{request.contentData.invoiceNumber || "-"}</td>
594605
{#if currentTab === "All"}
595606
<td
596607
><div class="address">
@@ -638,6 +649,13 @@
638649
/>
639650
</td>
640651
<td><StatusLabel status={checkStatus(request)} /></td>
652+
<td>
653+
{#if request.paymentCurrencies.length > 0}
654+
<Network network={request.paymentCurrencies[0]?.network} />
655+
{:else}
656+
<span class="text-gray-400">-</span>
657+
{/if}
658+
</td>
641659
<td
642660
><Tooltip text="Download PDF">
643661
<Download
@@ -654,7 +672,7 @@
654672
);
655673
} catch (error) {
656674
toast.error(`Failed to export PDF`, {
657-
description: `An error occurred while generating the PDF.`,
675+
description: `${error}`,
658676
action: {
659677
label: "X",
660678
onClick: () => console.info("Close"),

shared/components/dashboard-skeleton.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script>
22
import Skeleton from "./skeleton.svelte";
33
4-
export let rows = 7;
5-
export let columns = 10;
4+
export let rows = 10;
5+
export let columns = 8;
66
let skeletonConfig = {
77
colors: {
88
main: "#D9D9D9",
@@ -11,9 +11,9 @@
1111
};
1212
</script>
1313

14-
{#each Array(columns) as _}
14+
{#each Array(rows) as _}
1515
<tr class="skeleton-wrapper">
16-
{#each Array(rows) as _}
16+
{#each Array(columns) as _}
1717
<td class="skeleton-item"
1818
><Skeleton config={skeletonConfig} lineCount={1} /></td
1919
>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<svg
2+
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003"
3+
xmlns="http://www.w3.org/2000/svg"
4+
xmlns:xlink="http://www.w3.org/1999/xlink"
5+
version="1.1"
6+
id="Layer_1"
7+
x="0px"
8+
y="0px"
9+
viewBox="0 0 2500 2500"
10+
style="enable-background:new 0 0 2500 2500;"
11+
xml:space="preserve"
12+
width="24"
13+
height="24"
14+
>
15+
<style type="text/css">
16+
.st0 {
17+
fill: none;
18+
}
19+
.st1 {
20+
fill: #213147;
21+
}
22+
.st2 {
23+
fill: #12aaff;
24+
}
25+
.st3 {
26+
fill: #9dcced;
27+
}
28+
.st4 {
29+
fill: #ffffff;
30+
}
31+
</style>
32+
<g id="Layer_x0020_1">
33+
<g id="_2405588477232">
34+
<rect class="st0" width="2500" height="2500" />
35+
<g>
36+
<g>
37+
<path
38+
class="st1"
39+
d="M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"
40+
/>
41+
<g>
42+
<g>
43+
<g>
44+
<path
45+
class="st2"
46+
d="M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"
47+
/>
48+
</g>
49+
<g>
50+
<path
51+
class="st2"
52+
d="M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"
53+
/>
54+
</g>
55+
</g>
56+
</g>
57+
<g>
58+
<path
59+
class="st3"
60+
d="M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"
61+
/>
62+
</g>
63+
<polygon
64+
class="st1"
65+
points="642,2179 727,1947 897,2088 738,2234 "
66+
/>
67+
<g>
68+
<path
69+
class="st4"
70+
d="M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"
71+
/>
72+
<path
73+
class="st4"
74+
d="M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"
75+
/>
76+
</g>
77+
</g>
78+
</g>
79+
</g>
80+
</g>
81+
</svg>

shared/icons/network/avax.svelte

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<svg
2+
xmlns="http://www.w3.org/2000/svg"
3+
width="24"
4+
height="24"
5+
viewBox="0 0 1503 1504"
6+
fill="none"
7+
>
8+
<rect x="287" y="258" width="928" height="844" fill="white" />
9+
<path
10+
fill-rule="evenodd"
11+
clip-rule="evenodd"
12+
d="M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z"
13+
fill="#E84142"
14+
/>
15+
</svg>

shared/icons/network/base.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<svg
2+
xmlns="http://www.w3.org/2000/svg"
3+
width="24"
4+
height="24"
5+
viewBox="0 0 111 111"
6+
fill="none"
7+
>
8+
<path
9+
d="M54.921 110.034C85.359 110.034 110.034 85.402 110.034 55.017C110.034 24.6319 85.359 0 54.921 0C26.0432 0 2.35281 22.1714 0 50.3923H72.8467V59.6416H3.9565e-07C2.35281 87.8625 26.0432 110.034 54.921 110.034Z"
10+
fill="#0052FF"
11+
/>
12+
</svg>

shared/icons/network/bsc.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<svg
2+
xmlns="http://www.w3.org/2000/svg"
3+
viewBox="0 0 32 32"
4+
width="24"
5+
height="24"
6+
>
7+
<g fill="none">
8+
<circle cx="16" cy="16" r="16" fill="#F3BA2F" />
9+
<path
10+
fill="#FFF"
11+
d="M12.116 14.404L16 10.52l3.886 3.886 2.26-2.26L16 6l-6.144 6.144 2.26 2.26zM6 16l2.26-2.26L10.52 16l-2.26 2.26L6 16zm6.116 1.596L16 21.48l3.886-3.886 2.26 2.259L16 26l-6.144-6.144-.003-.003 2.263-2.257zM21.48 16l2.26-2.26L26 16l-2.26 2.26L21.48 16zm-3.188-.002h.002V16L16 18.294l-2.291-2.29-.004-.004.004-.003.401-.402.195-.195L16 13.706l2.293 2.293z"
12+
/></g
13+
></svg
14+
>

shared/icons/network/celo.svelte

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<svg
2+
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003"
3+
xmlns="http://www.w3.org/2000/svg"
4+
xmlns:xlink="http://www.w3.org/1999/xlink"
5+
version="1.1"
6+
id="Layer_1"
7+
x="0px"
8+
y="0px"
9+
viewBox="0 0 2500 2500"
10+
style="enable-background:new 0 0 2500 2500;"
11+
xml:space="preserve"
12+
width="24"
13+
height="24"
14+
>
15+
<style type="text/css">
16+
.st0 {
17+
fill-rule: evenodd;
18+
clip-rule: evenodd;
19+
fill: #fcff52;
20+
}
21+
.st1 {
22+
fill-rule: evenodd;
23+
clip-rule: evenodd;
24+
}
25+
</style>
26+
<g id="Layer_x0020_1">
27+
<g id="_1942792544736">
28+
<circle class="st0" cx="1250" cy="1250" r="1250" />
29+
<path
30+
class="st1"
31+
d="M1949.3,546.2H550.7v1407.7h1398.7v-491.4h-232.1c-80,179.3-260.1,304.1-466.2,304.1 c-284.1,0-514.2-233.6-514.2-517.5c0-284,230.1-515.6,514.2-515.6c210.1,0,390.2,128.9,470.2,312.1h228.1V546.2z"
32+
/>
33+
</g>
34+
</g>
35+
</svg>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<svg
2+
xmlns="http://www.w3.org/2000/svg"
3+
width="24"
4+
height="24"
5+
viewBox="0 0 32 32"
6+
><g fill="none" fill-rule="evenodd"
7+
><circle cx="16" cy="16" r="16" fill="#627EEA" /><g
8+
fill="#FFF"
9+
fill-rule="nonzero"
10+
><path fill-opacity=".602" d="M16.498 4v8.87l7.497 3.35z" /><path
11+
d="M16.498 4L9 16.22l7.498-3.35z"
12+
/><path fill-opacity=".602" d="M16.498 21.968v6.027L24 17.616z" /><path
13+
d="M16.498 27.995v-6.028L9 17.616z"
14+
/><path
15+
fill-opacity=".2"
16+
d="M16.498 20.573l7.497-4.353-7.497-3.348z"
17+
/><path fill-opacity=".602" d="M9 16.22l7.498 4.353v-7.701z" /></g
18+
></g
19+
></svg
20+
>

shared/icons/network/fantom.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<svg
2+
width="24"
3+
height="24"
4+
viewBox="0 0 606 773"
5+
fill="none"
6+
xmlns="http://www.w3.org/2000/svg"
7+
>
8+
<path
9+
d="M269.733 8.39516C288.399 -1.46505 316.801 -1.46505 335.467 8.39516L525.937 109.01C537.179 114.948 543.353 123.797 544.459 132.932L544.641 132.932V638.67C544.393 648.635 538.161 658.533 525.937 664.99L335.467 765.605C316.801 775.465 288.399 775.465 269.733 765.605L79.2635 664.99C67.0909 658.56 61.2491 648.593 60.9598 638.67C60.9301 637.652 60.9275 636.813 60.9589 636.122L60.9598 136.337C60.9314 135.634 60.9311 134.934 60.9591 134.237L60.9598 132.932L61.0449 132.932C61.8909 123.696 67.7847 115.073 79.2635 109.01L269.733 8.39516ZM514.66 415.079L335.467 509.737C316.801 519.598 288.399 519.598 269.733 509.737L90.939 415.29V637.675L269.733 731.621C280.299 737.267 291.285 742.768 301.983 743.008L302.6 743.016C313.277 743.051 323.643 737.629 334.154 732.496L514.66 636.865V415.079ZM29.9802 627.675C29.9802 647.052 32.2319 659.788 36.7027 668.76C40.4083 676.197 45.9683 681.88 56.1205 688.796L56.7 689.188C58.928 690.691 61.3823 692.265 64.3699 694.114L67.893 696.272L78.7116 702.802L63.1948 728.458L51.086 721.144L49.0507 719.894C45.5496 717.732 42.6477 715.876 39.941 714.05C11.007 694.541 0.216146 673.271 0.00322222 629.023L0 627.675H29.9802ZM287.61 279.527C286.222 280.003 284.921 280.555 283.735 281.181L93.2651 381.796C93.0652 381.901 92.8746 382.006 92.6932 382.109L92.5319 382.202L92.831 382.374L93.2651 382.609L283.735 483.224C284.921 483.85 286.222 484.402 287.61 484.878V279.527ZM317.59 279.527V484.878C318.979 484.402 320.28 483.85 321.466 483.224L511.935 382.609C512.135 382.504 512.326 382.399 512.507 382.296L512.669 382.202L512.37 382.031L511.935 381.796L321.466 281.181C320.28 280.555 318.979 280.003 317.59 279.527ZM514.66 168.807L343.795 259.066L514.66 349.325V168.807ZM90.939 169.018V349.114L261.405 259.066L90.939 169.018ZM321.466 34.9087C311.561 29.6764 293.64 29.6764 283.735 34.9087L93.2651 135.523C93.0652 135.629 92.8746 135.733 92.6932 135.837L92.5319 135.93L92.831 136.101L93.2651 136.337L283.735 236.951C293.64 242.184 311.561 242.184 321.466 236.951L511.935 136.337C512.135 136.231 512.326 136.127 512.507 136.024L512.669 135.93L512.37 135.759L511.935 135.523L321.466 34.9087ZM542.805 45.9421L554.914 53.2562L556.949 54.5059C560.45 56.6673 563.352 58.5243 566.059 60.3494C594.993 79.8588 605.784 101.129 605.997 145.377L606 146.725H576.02C576.02 127.347 573.768 114.612 569.297 105.639C565.592 98.2027 560.032 92.5195 549.88 85.6042L549.3 85.2114C547.072 83.7092 544.618 82.1352 541.63 80.2858L538.107 78.1277L527.288 71.5981L542.805 45.9421Z"
10+
fill="#1969FF"
11+
/>
12+
</svg>

shared/icons/network/gnosis.svelte

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<svg
2+
xmlns="http://www.w3.org/2000/svg"
3+
xmlns:xlink="http://www.w3.org/1999/xlink"
4+
version="1.1"
5+
id="Layer_1"
6+
x="0px"
7+
y="0px"
8+
viewBox="0 0 428 428"
9+
style="enable-background:new 0 0 428 428;"
10+
xml:space="preserve"
11+
width="24"
12+
height="24"
13+
>
14+
<path
15+
style="fill:#00193C;"
16+
d="M125.8,243.7c12.3,0,24.3-4.1,34-11.6l-78-78c-18.8,24.3-14.3,59.3,10,78.1 C101.6,239.6,113.5,243.7,125.8,243.7L125.8,243.7z"
17+
/>
18+
<path
19+
style="fill:#00193C;"
20+
d="M357.8,188c0-12.3-4.1-24.3-11.6-34l-78,78c24.3,18.8,59.2,14.3,78-10 C353.7,212.3,357.8,200.3,357.8,188z"
21+
/>
22+
<path
23+
style="fill:#00193C;"
24+
d="M397.1,103.1l-34.5,34.5c27.8,33.3,23.4,82.9-9.9,110.7c-29.2,24.4-71.6,24.4-100.8,0L214,286.2 l-37.8-37.8c-33.3,27.8-82.9,23.4-110.7-9.9c-24.4-29.2-24.4-71.6,0-100.8L47.8,120L31,103.1C10.7,136.5,0,174.9,0,214 c0,118.2,95.8,214,214,214s214-95.8,214-214C428.1,174.9,417.3,136.5,397.1,103.1z"
25+
/>
26+
<path
27+
style="fill:#00193C;"
28+
d="M368.8,66.3c-81.5-85.5-216.9-88.7-302.4-7.2c-2.5,2.4-4.9,4.8-7.2,7.2c-5.3,5.6-10.3,11.4-15,17.5 L214,253.7L383.8,83.8C379.2,77.7,374.1,71.9,368.8,66.3z M214,28c50,0,96.6,19.3,131.6,54.5L214,214.1L82.4,82.5 C117.4,47.3,164,28,214,28z"
29+
/>
30+
</svg>

0 commit comments

Comments
 (0)