diff --git a/packages/create-invoice-form/src/lib/invoice/form.svelte b/packages/create-invoice-form/src/lib/invoice/form.svelte index 49923b6a..48bddf36 100644 --- a/packages/create-invoice-form/src/lib/invoice/form.svelte +++ b/packages/create-invoice-form/src/lib/invoice/form.svelte @@ -43,6 +43,7 @@ let validationErrors = { payeeAddress: false, clientAddress: false, + sameAddress: false, sellerInfo: { email: false, }, @@ -58,12 +59,21 @@ validationErrors[`${type}`].email = !isEmail(email); }; + const checkSameAddress = () => { + return ( + formData.payerAddress?.toLowerCase() === + formData.payeeAddress?.toLowerCase() + ); + }; + const checkPayeeAddress = () => { validationErrors.payeeAddress = !checkAddress(formData.payeeAddress); + validationErrors.sameAddress = checkSameAddress(); }; const checkClientAddress = () => { validationErrors.clientAddress = !checkAddress(formData.payerAddress); + validationErrors.sameAddress = checkSameAddress(); }; const calculateInputWidth = (value: string) => { @@ -338,7 +348,9 @@ onBlur={checkClientAddress} error={validationErrors.clientAddress ? "Please enter a valid Ethereum address" - : ""} + : validationErrors.sameAddress + ? "Payer address cannot be the same as Payee address" + : ""} />
diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index e829683a..1eb9aeb3 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -717,6 +717,7 @@ diff --git a/shared/components/tx-type.svelte b/shared/components/tx-type.svelte index 97765ccf..1440d4a8 100644 --- a/shared/components/tx-type.svelte +++ b/shared/components/tx-type.svelte @@ -1,22 +1,56 @@ -
- {type} -
+{#if showBoth} +
+
IN
+
OUT
+
+{:else} +
+ {type} +
+{/if}