diff --git a/packages/create-invoice-form/src/lib/invoice/form-view.svelte b/packages/create-invoice-form/src/lib/invoice/form-view.svelte index b027102b..9645da8a 100644 --- a/packages/create-invoice-form/src/lib/invoice/form-view.svelte +++ b/packages/create-invoice-form/src/lib/invoice/form-view.svelte @@ -135,7 +135,7 @@

From - {formData.payeeAddress} + {formData.creatorId}

0 && "invoice-details-active"} `} @@ -166,11 +166,14 @@

Payment Chain - {currency?.network ? currency.network.charAt(0).toUpperCase() + currency.network.slice(1).toLowerCase() : ""} + {currency?.network + ? currency.network.charAt(0).toUpperCase() + + currency.network.slice(1).toLowerCase() + : ""}

Invoice Currency - {invoiceCurrency ? invoiceCurrency.symbol: ""} + {invoiceCurrency ? invoiceCurrency.symbol : ""}

Settlement Currency diff --git a/packages/create-invoice-form/src/lib/invoice/form.svelte b/packages/create-invoice-form/src/lib/invoice/form.svelte index 96bb541b..d0abf3b4 100644 --- a/packages/create-invoice-form/src/lib/invoice/form.svelte +++ b/packages/create-invoice-form/src/lib/invoice/form.svelte @@ -9,6 +9,7 @@ // Icons import Trash from "@requestnetwork/shared-icons/trash.svelte"; import Plus from "@requestnetwork/shared-icons/plus.svelte"; + import Close from "@requestnetwork/shared-icons/close.svelte"; // Types import type { IConfig, CustomFormData } from "@requestnetwork/shared-types"; @@ -49,11 +50,7 @@ }, }; - let creatorId = ""; - - $: { - creatorId = formData.creatorId; - } + let showPayeeAddressInput = false; const validateEmail = (email: string, type: "sellerInfo" | "buyerInfo") => { validationErrors[`${type}`].email = !isEmail(email); @@ -154,6 +151,17 @@ const removeInvoiceItem = (index: number) => { formData.invoiceItems = formData.invoiceItems.filter((_, i) => i !== index); }; + + const togglePayeeAddress = () => { + showPayeeAddressInput = !showPayeeAddressInput; + if (!showPayeeAddressInput) { + formData.payeeAddress = formData.creatorId; + } + }; + + $: if (!showPayeeAddressInput && formData.creatorId) { + formData.payeeAddress = formData.creatorId; + }

@@ -178,10 +186,42 @@ disabled id="creatorId" type="text" - value={creatorId} + value={formData.creatorId} label="From" placeholder="Connect wallet to populate" /> + {#if !showPayeeAddressInput} + +
+ {/if}
filterSettlementCurrencies(currency)) .map((currency) => ({ value: currency, - label: `${currency.symbol ?? 'Unknown'} (${currency?.network ?? 'Unknown'})`, + label: `${currency.symbol ?? "Unknown"} (${currency?.network ?? "Unknown"})`, }))} onchange={handleCurrencyChange} /> -
@@ -639,6 +667,20 @@ gap: 20px; } + :global(.invoice-form-add-recipient-button) { + background-color: transparent !important; + color: var(--mainColor) !important; + text-transform: uppercase; + transform: none !important; + font-weight: 500; + font-size: 14px !important; + width: fit-content; + } + + :global(.invoice-form-add-recipient-button:hover) { + color: var(--secondaryColor) !important; + } + .invoice-form-section { display: flex; flex-direction: column; @@ -795,4 +837,25 @@ width: 12px; height: 12px; } + + .payee-address-container { + position: relative; + display: flex; + align-items: flex-start; + gap: 10px; + } + + .payee-address-container :global(.input-wrapper) { + flex: 1; + } + + :global(.invoice-form-close-recipient-button) { + position: absolute; + right: 0; + top: -4px; + } + + :global(.invoice-form-close-recipient-button div) { + padding: 4px !important; + } diff --git a/shared/components/button.svelte b/shared/components/button.svelte index 37e49cdb..9a50a391 100644 --- a/shared/components/button.svelte +++ b/shared/components/button.svelte @@ -17,7 +17,7 @@ {type} {disabled} on:click={onClick} - class={`button ${padding} ${className} main-button`} + class={`button ${padding} main-button ${className}`} > {#if icon}