From 5a11f83fea64459b03fffb9ebf40dd36a677339f Mon Sep 17 00:00:00 2001 From: muzam1l Date: Tue, 7 Jun 2022 00:52:59 +0530 Subject: [PATCH] Set payment as default transaction --- components/Transaction/ui.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/components/Transaction/ui.tsx b/components/Transaction/ui.tsx index ee08688..25cbac1 100644 --- a/components/Transaction/ui.tsx +++ b/components/Transaction/ui.tsx @@ -1,4 +1,4 @@ -import { FC, useCallback, useState } from "react"; +import { FC, useCallback, useEffect, useState } from "react"; import Container from "../Container"; import Flex from "../Flex"; import Input from "../Input"; @@ -110,6 +110,16 @@ export const TxUI: FC = ({ k => !specialFields.includes(k) ) as [keyof TxFields]; + useEffect(() => { + const defaultOption = transactionsOptions.find( + tt => tt.value === "Payment" + ); + if (defaultOption) { + handleChangeTxType(defaultOption); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + return (