From 6e2faff0a34946cab8317a047d14fcac4bf10c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Ram=C3=ADrez?= Date: Wed, 4 Dec 2024 09:11:17 -0300 Subject: [PATCH] fix: add attachment to requests --- src/components/Global/FileUploadInput/index.tsx | 2 +- src/components/Request/Create/Views/Initial.view.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Global/FileUploadInput/index.tsx b/src/components/Global/FileUploadInput/index.tsx index 2be245236..5f5dceca6 100644 --- a/src/components/Global/FileUploadInput/index.tsx +++ b/src/components/Global/FileUploadInput/index.tsx @@ -1,7 +1,7 @@ import Icon from '../Icon' import { useEffect, useState } from 'react' import * as utils from '@/utils' -interface IFileUploadInputProps { +export interface IFileUploadInputProps { attachmentOptions: { fileUrl: string | undefined message: string | undefined diff --git a/src/components/Request/Create/Views/Initial.view.tsx b/src/components/Request/Create/Views/Initial.view.tsx index d61cecc8c..edee7906e 100644 --- a/src/components/Request/Create/Views/Initial.view.tsx +++ b/src/components/Request/Create/Views/Initial.view.tsx @@ -1,6 +1,6 @@ import TokenAmountInput from '@/components/Global/TokenAmountInput' import * as _consts from '../Create.consts' -import FileUploadInput from '@/components/Global/FileUploadInput' +import FileUploadInput, { IFileUploadInputProps } from '@/components/Global/FileUploadInput' import { useContext, useEffect, useState, useCallback } from 'react' import * as context from '@/context' import Loading from '@/components/Global/Loading' @@ -53,6 +53,7 @@ export const InitialView = ({ userBalances, tokenValue, tokenData, + attachmentOptions, }: { recipientAddress: string | undefined tokenAddress: string @@ -60,6 +61,7 @@ export const InitialView = ({ userBalances: IUserBalance[] tokenValue: string | undefined tokenData: Pick | undefined + attachmentOptions: IFileUploadInputProps['attachmentOptions'] }) => { if (!recipientAddress) { setErrorState({ @@ -173,6 +175,7 @@ export const InitialView = ({ userBalances: balances, tokenValue, tokenData: selectedTokenData, + attachmentOptions, }) }} /> @@ -202,6 +205,7 @@ export const InitialView = ({ userBalances: balances, tokenValue, tokenData: selectedTokenData, + attachmentOptions, }) }} disabled={!isValidRecipient || inputChanging || isLoading || !_tokenValue}