From 07f77875cfd2c5493badc5ea5fd14df91dac4444 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Wed, 31 May 2023 12:15:54 +0200 Subject: [PATCH] Add TxMsgCreateVestingAccountDetails --- .../TxMsgCreateVestingAccountDetails.tsx | 80 +++++++++++++++++++ .../dataViews/TransactionInfo/index.tsx | 5 ++ 2 files changed, 85 insertions(+) create mode 100644 components/dataViews/TransactionInfo/TxMsgCreateVestingAccountDetails.tsx diff --git a/components/dataViews/TransactionInfo/TxMsgCreateVestingAccountDetails.tsx b/components/dataViews/TransactionInfo/TxMsgCreateVestingAccountDetails.tsx new file mode 100644 index 0000000..62ad5e7 --- /dev/null +++ b/components/dataViews/TransactionInfo/TxMsgCreateVestingAccountDetails.tsx @@ -0,0 +1,80 @@ +import { useAppContext } from "../../../context/AppContext"; +import { printableCoins } from "../../../lib/displayHelpers"; +import { TxMsgCreateVestingAccount } from "../../../types/txMsg"; +import HashView from "../HashView"; + +interface TxMsgCreateVestingAccountDetailsProps { + readonly msg: TxMsgCreateVestingAccount; +} + +const TxMsgCreateVestingAccountDetails = ({ msg }: TxMsgCreateVestingAccountDetailsProps) => { + const { state } = useAppContext(); + const endTimeDateObj = new Date(msg.value.endTime * 1000); + const endTimeDate = endTimeDateObj.toLocaleDateString(); + const endTimeHours = endTimeDateObj.toLocaleTimeString().slice(0, -3); + + return ( + <> +
+ {endTimeDate} {endTimeHours} +
+{msg.value.delayed ? "Yes" : "No"}
+