From ae0335d537fda8d6f0cc4b4d9cc21e7d37199247 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Wed, 26 Jun 2024 14:01:54 +0200 Subject: [PATCH] Don't require destructuring to pass props to input --- pages/settings/wallets/[wallet].js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/settings/wallets/[wallet].js b/pages/settings/wallets/[wallet].js index e466c818..23a4adc7 100644 --- a/pages/settings/wallets/[wallet].js +++ b/pages/settings/wallets/[wallet].js @@ -78,8 +78,10 @@ export default function WalletSettings () { } function WalletFields ({ wallet: { config, fields } }) { - return fields.map(({ name, label, type, help, optional, hint }, i) => { - const props = { + return fields.map(({ name, label, type, help, optional, hint, ...props }, i) => { + const rawProps = { + ...props, + name, initialValue: config?.[name], label: (
@@ -92,16 +94,14 @@ function WalletFields ({ wallet: { config, fields } }) { {optional && optional}
), - name, required: !optional, - autoFocus: i === 0, - hint + autoFocus: i === 0 } if (type === 'text') { - return + return } if (type === 'password') { - return + return } return null })