From 571f1d348b9c00bb739ad0e0a864a87982077450 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Tue, 28 May 2024 11:17:02 +0700 Subject: [PATCH] fix: add capitalize and bug --- src/lib/components/forms/SelectInput.tsx | 2 +- src/lib/pages/interact-contract/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/forms/SelectInput.tsx b/src/lib/components/forms/SelectInput.tsx index 1c21e5e62..b9e64cf54 100644 --- a/src/lib/components/forms/SelectInput.tsx +++ b/src/lib/components/forms/SelectInput.tsx @@ -81,7 +81,7 @@ export const SelectInput = ({ const selectedOption = options.find((item) => item.label === selected); useEffect(() => { - if (initialSelected) return; + if (!initialSelected) return; setSelected( options.find((item) => !item.disabled && item.value === initialSelected) diff --git a/src/lib/pages/interact-contract/index.tsx b/src/lib/pages/interact-contract/index.tsx index 8a2b9019b..baeb8bd51 100644 --- a/src/lib/pages/interact-contract/index.tsx +++ b/src/lib/pages/interact-contract/index.tsx @@ -1,5 +1,5 @@ import { Flex, Heading } from "@chakra-ui/react"; -import { isUndefined } from "lodash"; +import { capitalize, isUndefined } from "lodash"; import { useRouter } from "next/router"; import { useCallback, useEffect, useState } from "react"; @@ -137,7 +137,7 @@ const InteractContractBody = ({ /> - {selectedType} Message + {capitalize(selectedType)} Message {!isMobile && (