From 8e2dd45e23ea0fdfca60aeed729a5684a933a7ae Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 24 Jun 2024 12:53:59 +0200 Subject: [PATCH] Support help, optional, hint in wallet fields --- pages/settings/wallets/[wallet].js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pages/settings/wallets/[wallet].js b/pages/settings/wallets/[wallet].js index 5007ae57..e466c818 100644 --- a/pages/settings/wallets/[wallet].js +++ b/pages/settings/wallets/[wallet].js @@ -7,6 +7,8 @@ import { WalletLogs } from '@/components/wallet-logger' import { useToast } from '@/components/toast' import { useRouter } from 'next/router' import { useWallet, Status } from '@/components/wallet' +import Info from '@/components/info' +import Text from '@/components/text' export const getServerSideProps = getGetServerSideProps({ authRequired: true }) @@ -76,13 +78,24 @@ export default function WalletSettings () { } function WalletFields ({ wallet: { config, fields } }) { - return fields.map(({ name, label, type }, i) => { + return fields.map(({ name, label, type, help, optional, hint }, i) => { const props = { initialValue: config?.[name], - label, + label: ( +
+ {label} + {help && ( + + {help} + + )} + {optional && optional} +
+ ), name, - required: true, - autoFocus: i === 0 + required: !optional, + autoFocus: i === 0, + hint } if (type === 'text') { return