@homefile/components-v2 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ export const PasswordInput = ({ errorMessage, id, handleChange, hasError, placeh
|
|
|
6
6
|
const [show, setShow] = useState(false);
|
|
7
7
|
const handleClick = () => setShow(!show);
|
|
8
8
|
const ViewIcon = show ? _jsx(Eye, { size: 20 }) : _jsx(EyeOff, { size: 20 });
|
|
9
|
-
return (_jsxs(FormControl, { isInvalid: hasError, children: [_jsxs(InputGroup, { children: [_jsx(Input, { autoCapitalize: "none", autoCorrect: "off", id: id, placeholder: placeholder, type: show ? 'text' : 'password', value: value, onChange: handleChange }), _jsx(InputRightElement, { width: "3rem", children: _jsx(IconButton, { variant: "icon", "aria-label": "Enter password", icon: ViewIcon, onClick: handleClick, _hover: {
|
|
9
|
+
return (_jsxs(FormControl, { isInvalid: hasError, children: [_jsxs(InputGroup, { children: [_jsx(Input, { autoComplete: "current-password", autoCapitalize: "none", autoCorrect: "off", id: id, placeholder: placeholder, type: show ? 'text' : 'password', value: value, onChange: handleChange }), _jsx(InputRightElement, { width: "3rem", children: _jsx(IconButton, { variant: "icon", "aria-label": "Enter password", icon: ViewIcon, onClick: handleClick, _hover: {
|
|
10
10
|
svg: {
|
|
11
11
|
fill: 'blue.3',
|
|
12
12
|
},
|
|
@@ -15,17 +15,17 @@ import { isEmptyField } from '../../../utils';
|
|
|
15
15
|
import { useSignIn } from '../../../hooks';
|
|
16
16
|
export const SignIn = ({ isLoading, handleForgotPassword, handleSignIn, handleSignUp, loginError, values = { email: '', password: '' }, }) => {
|
|
17
17
|
const { inputs, handleInputChange, isValidated, setIsValidated } = useSignIn(values);
|
|
18
|
-
return (_jsxs(Box, { w: "container.full", mt: "onboarding.top", zIndex: "2", position: "relative", children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signin.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: 8, children: [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
return (_jsxs(Box, { w: "container.full", mt: "onboarding.top", zIndex: "2", position: "relative", children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signin.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: 8, children: [_jsxs(Stack, { spacing: "base", as: "form", children: [_jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: loginError
|
|
19
|
+
? t('forms.errorLogin')
|
|
20
|
+
: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated && (loginError || isEmptyField(inputs.email)), id: "email", placeholder: t('forms.email'), value: values.email || inputs.email, handleChange: (event) => {
|
|
21
|
+
values.email = event.target.value;
|
|
22
|
+
handleInputChange(event);
|
|
23
|
+
} }), _jsx(PasswordInput, { errorMessage: loginError
|
|
24
|
+
? t('forms.errorLogin')
|
|
25
|
+
: t('forms.password') + ' ' + t('forms.required'), hasError: isValidated && (loginError || isEmptyField(inputs.password)), id: "password", placeholder: t('forms.password'), value: values.password || inputs.password, handleChange: (event) => {
|
|
26
|
+
values.password = event.target.value;
|
|
27
|
+
handleInputChange(event);
|
|
28
|
+
} })] }), _jsxs(Stack, { spacing: 4, children: [_jsx(Button, { isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
setIsValidated(true);
|
|
30
30
|
if (!isEmptyField(inputs.email) &&
|
|
31
31
|
!isEmptyField(inputs.password)) {
|
package/package.json
CHANGED
|
@@ -31,8 +31,8 @@ export const SignIn = ({
|
|
|
31
31
|
<PageTitle title={t('signin.title')} />
|
|
32
32
|
<Box px={['container.sm', 'container.md', 'container.lg']} mb={6}>
|
|
33
33
|
<Stack spacing={8}>
|
|
34
|
-
<Stack spacing="
|
|
35
|
-
|
|
34
|
+
<Stack spacing="base" as="form">
|
|
35
|
+
|
|
36
36
|
<TextInput
|
|
37
37
|
autoCapitalize="none"
|
|
38
38
|
autoCorrect="off"
|
|
@@ -69,7 +69,7 @@ export const SignIn = ({
|
|
|
69
69
|
handleInputChange(event)
|
|
70
70
|
}}
|
|
71
71
|
/>
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
</Stack>
|
|
74
74
|
<Stack spacing={4}>
|
|
75
75
|
<Button
|