From 10a7db706680a031b5e62aa2bd9e1f416c3bc46c Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Tue, 1 Dec 2020 03:17:59 -1000 Subject: [PATCH] Fix error overlap and translation (#557) * fix error overlap and translation * translation Co-authored-by: Github Actions --- packages/extension-ui/src/components/InputWithLabel.tsx | 6 ++++-- packages/extension/public/locales/en/translation.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/extension-ui/src/components/InputWithLabel.tsx b/packages/extension-ui/src/components/InputWithLabel.tsx index ae8801dd..854b8cb6 100644 --- a/packages/extension-ui/src/components/InputWithLabel.tsx +++ b/packages/extension-ui/src/components/InputWithLabel.tsx @@ -4,6 +4,7 @@ import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; +import useTranslation from '../hooks/useTranslation'; import Label from './Label'; import { Input } from './TextInputs'; import Warning from './Warning'; @@ -27,6 +28,7 @@ interface Props { function InputWithLabel ({ className, defaultValue, disabled, isError, isFocused, isReadOnly, label = '', onBlur, onChange, onEnter, placeholder, type = 'text', value, withoutMargin }: Props): React.ReactElement { const [isCapsLock, setIsCapsLock] = useState(false); + const { t } = useTranslation(); const _checkKey = useCallback( (event: React.KeyboardEvent): void => { @@ -72,7 +74,7 @@ function InputWithLabel ({ className, defaultValue, disabled, isError, isFocused withError={isError} /> { isCapsLock && ( - Warning: Caps lock is on + {t('Warning: Caps lock is on')} )} ); @@ -84,7 +86,7 @@ export default styled(InputWithLabel)` &.withoutMargin { margin-bottom: 0px; - + .error { + + .danger { margin-top: 6px; } } diff --git a/packages/extension/public/locales/en/translation.json b/packages/extension/public/locales/en/translation.json index 2ebd0e46..50af0ebf 100644 --- a/packages/extension/public/locales/en/translation.json +++ b/packages/extension/public/locales/en/translation.json @@ -113,5 +113,6 @@ "account visibility": "", "Wrong password": "", "Incorrect derivation path": "", - "lifetime": "" + "lifetime": "", + "Warning: Caps lock is on": "" }