Set payment as default transaction

This commit is contained in:
muzam1l
2022-06-07 00:52:59 +05:30
parent ea977816a4
commit 5a11f83fea

View File

@@ -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<UIProps> = ({
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 (
<Container
css={{