From 95f98016ded2453d181fb5237533b5fe40689ece Mon Sep 17 00:00:00 2001 From: Gala Date: Wed, 2 Nov 2022 13:49:29 +0100 Subject: [PATCH] make label always shrink --- .../src/components/Accounts/modals/AddAccountModal.tsx | 1 + .../src/components/Accounts/modals/EditAccountModal.tsx | 1 + .../src/components/Bonding/forms/BondGatewayForm.tsx | 7 +++++++ .../src/components/Bonding/forms/BondMixnodeForm.tsx | 7 +++++++ .../src/components/Bonding/modals/BondMoreModal.tsx | 8 +++++++- .../src/components/Bonding/modals/NodeSettingsModal.tsx | 8 +++++++- nym-wallet/src/components/Mnemonic.tsx | 1 + nym-wallet/src/components/Send/SendInputModal.tsx | 1 + nym-wallet/src/components/textfields.tsx | 2 ++ nym-wallet/src/pages/Admin/index.tsx | 2 ++ .../node-settings/settings-pages/NodeUnbondPage.tsx | 7 ++++++- .../settings-pages/general-settings/InfoSettings.tsx | 5 +++++ .../general-settings/ParametersSettings.tsx | 1 + nym-wallet/src/pages/internal-docs/DocEntry.tsx | 1 + nym-wallet/src/pages/settings/profile.tsx | 6 +++--- nym-wallet/src/pages/settings/system-variables.tsx | 1 + .../src/components/currency/CurrencyFormField.tsx | 1 + .../src/components/mixnodes/IdentityKeyFormField.tsx | 1 + 18 files changed, 55 insertions(+), 6 deletions(-) diff --git a/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx index 8a76dba709..61d6f7b9e5 100644 --- a/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/AddAccountModal.tsx @@ -122,6 +122,7 @@ const NameAccount = ({ onNext, onBack }: { onNext: (value: string) => void; onBa setError(undefined); }} fullWidth + InputLabelProps={{ shrink: true }} /> diff --git a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx index 8ddbb207b3..e5dbd0464e 100644 --- a/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx +++ b/nym-wallet/src/components/Accounts/modals/EditAccountModal.tsx @@ -55,6 +55,7 @@ export const EditAccountModal = () => { value={accountName} onChange={(e) => setAccountName(e.target.value)} autoFocus + InputLabelProps={{ shrink: true }} /> diff --git a/nym-wallet/src/components/Bonding/forms/BondGatewayForm.tsx b/nym-wallet/src/components/Bonding/forms/BondGatewayForm.tsx index 12403f5e98..bf0511d51a 100644 --- a/nym-wallet/src/components/Bonding/forms/BondGatewayForm.tsx +++ b/nym-wallet/src/components/Bonding/forms/BondGatewayForm.tsx @@ -47,6 +47,7 @@ const NodeFormData = ({ gatewayData, onNext }: { gatewayData: GatewayData; onNex label="Sphinx key" error={Boolean(errors.sphinxKey)} helperText={errors.sphinxKey?.message} + InputLabelProps={{ shrink: true }} /> @@ -72,6 +75,7 @@ const NodeFormData = ({ gatewayData, onNext }: { gatewayData: GatewayData; onNex error={Boolean(errors.host)} helperText={errors.host?.message} required + InputLabelProps={{ shrink: true }} sx={{ flexBasis: '50%' }} /> @@ -97,6 +102,7 @@ const NodeFormData = ({ gatewayData, onNext }: { gatewayData: GatewayData; onNex error={Boolean(errors.mixPort)} helperText={errors.mixPort?.message} fullWidth + InputLabelProps={{ shrink: true }} /> )} diff --git a/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx b/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx index 79cd8617e0..721d114961 100644 --- a/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx +++ b/nym-wallet/src/components/Bonding/forms/BondMixnodeForm.tsx @@ -47,6 +47,7 @@ const NodeFormData = ({ mixnodeData, onNext }: { mixnodeData: MixnodeData; onNex label="Sphinx key" error={Boolean(errors.sphinxKey)} helperText={errors.sphinxKey?.message} + InputLabelProps={{ shrink: true }} /> @@ -88,6 +92,7 @@ const NodeFormData = ({ mixnodeData, onNext }: { mixnodeData: MixnodeData; onNex error={Boolean(errors.mixPort)} helperText={errors.mixPort?.message} fullWidth + InputLabelProps={{ shrink: true }} /> )} diff --git a/nym-wallet/src/components/Bonding/modals/BondMoreModal.tsx b/nym-wallet/src/components/Bonding/modals/BondMoreModal.tsx index 39aeb6443c..88518abc28 100644 --- a/nym-wallet/src/components/Bonding/modals/BondMoreModal.tsx +++ b/nym-wallet/src/components/Bonding/modals/BondMoreModal.tsx @@ -100,7 +100,13 @@ export const BondMoreModal = ({ - setSignature(e.target.value)} /> + setSignature(e.target.value)} + InputLabelProps={{ shrink: true }} + /> {errorSignature && Invalid signature} diff --git a/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx b/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx index 34b35e7a3f..3a8dca5576 100644 --- a/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx +++ b/nym-wallet/src/components/Bonding/modals/NodeSettingsModal.tsx @@ -114,7 +114,13 @@ export const NodeSettings = ({ Set profit margin - setPm(e.target.value)} fullWidth /> + setPm(e.target.value)} + fullWidth + InputLabelProps={{ shrink: true }} + /> {error && ( Profit margin should be a number between 0 and 100 diff --git a/nym-wallet/src/components/Mnemonic.tsx b/nym-wallet/src/components/Mnemonic.tsx index c41fde3d86..d445172e9a 100644 --- a/nym-wallet/src/components/Mnemonic.tsx +++ b/nym-wallet/src/components/Mnemonic.tsx @@ -30,6 +30,7 @@ export const Mnemonic = ({ height: '160px', }, }} + InputLabelProps={{ shrink: true }} sx={{ 'input::-webkit-textfield-decoration-container': { alignItems: 'start', diff --git a/nym-wallet/src/components/Send/SendInputModal.tsx b/nym-wallet/src/components/Send/SendInputModal.tsx index c27eb58781..a54541d040 100644 --- a/nym-wallet/src/components/Send/SendInputModal.tsx +++ b/nym-wallet/src/components/Send/SendInputModal.tsx @@ -62,6 +62,7 @@ export const SendInputModal = ({ fullWidth onChange={(e) => onAddressChange(e.target.value)} value={toAddress} + InputLabelProps={{ shrink: true }} /> ), }} + InputLabelProps={{ shrink: true }} /> {error && } diff --git a/nym-wallet/src/pages/Admin/index.tsx b/nym-wallet/src/pages/Admin/index.tsx index 1642570db9..b3a8c157c5 100644 --- a/nym-wallet/src/pages/Admin/index.tsx +++ b/nym-wallet/src/pages/Admin/index.tsx @@ -35,6 +35,7 @@ const AdminForm: React.FC<{ fullWidth error={!!errors.minimum_mixnode_pledge} helperText={`${errors?.minimum_mixnode_pledge?.amount?.message} ${errors?.minimum_mixnode_pledge?.denom?.message}`} + InputLabelProps={{ shrink: true }} /> @@ -48,6 +49,7 @@ const AdminForm: React.FC<{ fullWidth error={!!errors.minimum_gateway_pledge} helperText={`${errors?.minimum_gateway_pledge?.amount?.message} ${errors?.minimum_gateway_pledge?.denom?.message}`} + InputLabelProps={{ shrink: true }} /> diff --git a/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeUnbondPage.tsx b/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeUnbondPage.tsx index 89efefb0a8..4a6097b8da 100644 --- a/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeUnbondPage.tsx +++ b/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeUnbondPage.tsx @@ -49,7 +49,12 @@ export const NodeUnbondPage = ({ bondedNode, onConfirm, onError }: Props) => { - setConfirmField(e.target.value)} /> + setConfirmField(e.target.value)} + InputLabelProps={{ shrink: true }} + />