Skip to content

Commit 8a9f37f

Browse files
committed
chore: update readme, fix uknown name for network
1 parent ee02507 commit 8a9f37f

File tree

4 files changed

+69
-5
lines changed

4 files changed

+69
-5
lines changed

packages/create-invoice-form/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ npm install @requestnetwork/create-invoice-form
2424

2525
You can directly pass props into the create-invoice-form web component without needing to create references or use workarounds.
2626

27+
##### Important Note on Currencies Prop
28+
29+
- The currencies prop is now optional.
30+
- If you include the currencies prop and follow the proper format, it will override the default currencies.
31+
- To use the default currencies list, simply omit the currencies prop.
32+
2733
```tsx
2834
import Head from "next/head";
2935
import { config } from "@/utils/config";
@@ -53,6 +59,30 @@ export default function CreateInvoice() {
5359
}
5460
```
5561

62+
#### Example Override for Currencies
63+
64+
If you need to customize the currencies list, ensure you follow the correct format:
65+
66+
```ts
67+
export const currencies: CurrencyTypes.CurrencyInput[] = [
68+
{
69+
symbol: "FAU",
70+
address: "0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C",
71+
network: "sepolia",
72+
decimals: 18,
73+
type: RequestLogicTypes.CURRENCY.ERC20,
74+
},
75+
{
76+
symbol: "ETH",
77+
network: "sepolia",
78+
decimals: 18,
79+
type: RequestLogicTypes.CURRENCY.ETH,
80+
},
81+
];
82+
```
83+
84+
When added, this will replace the default currencies list. To retain the defaults, do not include the `currencies` prop.
85+
5686
#### [initializeRN.ts](https://github.com/RequestNetwork/invoicing-template/blob/main/utils/initializeRN.ts)
5787

5888
Initialize the `RequestNetwork` object using an Ethers `Signer` or Viem `WalletClient`.

packages/invoice-dashboard/README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ npm install @requestnetwork/invoice-dashboard
2424

2525
You can directly pass props into the invoice-dashboard web component without needing to create references or use workarounds.
2626

27+
##### Important Note on Currencies Prop
28+
29+
- The currencies prop is now optional.
30+
- If you include the currencies prop and follow the proper format, it will override the default currencies.
31+
- To use the default currencies list, simply omit the currencies prop.
32+
2733
```tsx
2834
import Head from "next/head";
2935
import { config } from "@/utils/config";
@@ -53,6 +59,30 @@ export default function InvoiceDashboardPage() {
5359
}
5460
```
5561

62+
#### Example Override for Currencies
63+
64+
If you need to customize the currencies list, ensure you follow the correct format:
65+
66+
```ts
67+
export const currencies: CurrencyTypes.CurrencyInput[] = [
68+
{
69+
symbol: "FAU",
70+
address: "0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C",
71+
network: "sepolia",
72+
decimals: 18,
73+
type: RequestLogicTypes.CURRENCY.ERC20,
74+
},
75+
{
76+
symbol: "ETH",
77+
network: "sepolia",
78+
decimals: 18,
79+
type: RequestLogicTypes.CURRENCY.ETH,
80+
},
81+
];
82+
```
83+
84+
When added, this will replace the default currencies list. To retain the defaults, do not include the `currencies` prop.
85+
5686
#### [initializeRN.ts](https://github.com/RequestNetwork/invoicing-template/blob/main/utils/initializeRN.ts)
5787

5888
Initialize the `RequestNetwork` object using an Ethers `Signer` or Viem `WalletClient`.
@@ -124,14 +154,14 @@ export const config: IConfig = {
124154
| Cancel Request ||
125155
| Add Stakeholder ||
126156
| Native Payment ||
127-
| Conversion Payment | |
157+
| Conversion Payment | |
128158
| Batch Payment ||
129159
| Declarative Payment ||
130160
| Swap-to-Pay Payment ||
131161
| Swap-to-Conversion Payment ||
132162
| Escrow Payment ||
133-
| Improved UI and UX | |
134-
| More Chains and Currencies | |
163+
| Improved UI and UX | |
164+
| More Chains and Currencies | |
135165
| More Configuration Options ||
136166
| Attachments ||
137167

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@
445445
await getRequests();
446446
loading = false;
447447
};
448+
448449
$: sliderValueForDecryption, enableDecryption();
449450
</script>
450451

@@ -726,7 +727,10 @@
726727
<td><StatusLabel status={checkStatus(request)} /></td>
727728
<td>
728729
{#if request.paymentCurrencies.length > 0}
729-
<Network network={request.paymentCurrencies[0]?.network} />
730+
<Network
731+
network={request.paymentCurrencies[0]?.network}
732+
showLabel={true}
733+
/>
730734
{:else}
731735
<span class="text-gray-400">-</span>
732736
{/if}

shared/icons/network/network-icon.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="network-icon" aria-label={`Network: ${capitalize(network)}`}>
1313
<svelte:component this={icon} />
1414
{#if showLabel}
15-
<span>{capitalize(network)}</span>
15+
<span>{capitalize(network) || "Unknown"}</span>
1616
{/if}
1717
</div>
1818
{/if}

0 commit comments

Comments
 (0)