@homefile/components-v2 2.6.5 → 2.6.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.
|
@@ -15,13 +15,13 @@ import { isEmptyField } from '../../../utils';
|
|
|
15
15
|
import { useSignIn } from '../../../hooks';
|
|
16
16
|
export const SignIn = ({ isLoading, handleForgotPassword, handleSignIn, handleSignUp, loginErrorMessage, values = { email: '', password: '' }, }) => {
|
|
17
17
|
const { inputs, handleInputChange, isValidated, setIsValidated } = useSignIn(values);
|
|
18
|
-
return (_jsxs(BasePageWrapper, { 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", autoComplete: "username", errorMessage: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.email), id: "email", placeholder: t('forms.email'), value: values.email || inputs.email, handleChange: (event) => {
|
|
18
|
+
return (_jsxs(BasePageWrapper, { 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: [Boolean(loginErrorMessage) && (_jsx(Text, { variant: "error", children: loginErrorMessage })), _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", autoComplete: "username", errorMessage: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.email), id: "email", placeholder: t('forms.email'), value: values.email || inputs.email, handleChange: (event) => {
|
|
19
19
|
values.email = event.target.value;
|
|
20
20
|
handleInputChange(event);
|
|
21
21
|
} }), _jsx(PasswordInput, { autoComplete: "current-password", errorMessage: t('forms.password') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.password), id: "password", placeholder: t('forms.password'), value: values.password || inputs.password, handleChange: (event) => {
|
|
22
22
|
values.password = event.target.value;
|
|
23
23
|
handleInputChange(event);
|
|
24
|
-
} })
|
|
24
|
+
} })] }), _jsxs(Stack, { spacing: 4, children: [_jsx(Button, { isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
25
|
setIsValidated(true);
|
|
26
26
|
if (!isEmptyField(inputs.email) &&
|
|
27
27
|
!isEmptyField(inputs.password)) {
|
|
@@ -17,10 +17,10 @@ export const SignUp = ({ isLoading, handleCreateAccount, handleSignIn, showPromo
|
|
|
17
17
|
handleCreateAccount,
|
|
18
18
|
values,
|
|
19
19
|
});
|
|
20
|
-
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signup.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: "base", as: "form", children: [_jsx(TextInput, { errorMessage: t('forms.firstName') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.firstName), id: "firstName", placeholder: t('forms.firstName'), value: inputs.firstName, handleChange: handleInputChange, autoComplete: "given-name" }), _jsx(TextInput, { errorMessage: t('forms.lastName') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.lastName), id: "lastName", placeholder: t('forms.lastName'), value: inputs.lastName, handleChange: handleInputChange, autoComplete: "family-name" }), _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated &&
|
|
20
|
+
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signup.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: "base", as: "form", children: [Boolean(signupErrorMessage) && (_jsx(Text, { variant: "error", children: signupErrorMessage })), _jsx(TextInput, { errorMessage: t('forms.firstName') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.firstName), id: "firstName", placeholder: t('forms.firstName'), value: inputs.firstName, handleChange: handleInputChange, autoComplete: "given-name" }), _jsx(TextInput, { errorMessage: t('forms.lastName') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.lastName), id: "lastName", placeholder: t('forms.lastName'), value: inputs.lastName, handleChange: handleInputChange, autoComplete: "family-name" }), _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated &&
|
|
21
21
|
(isEmptyField(inputs.email) || !isValidEmail(inputs.email)), id: "email", placeholder: t('forms.email'), value: inputs.email, handleChange: handleInputChange, autoComplete: "email" }), showPromoCode && (_jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", id: "partnerCode", placeholder: t('forms.promoCode'), value: (_a = inputs.partnerCode) !== null && _a !== void 0 ? _a : '', handleChange: handleInputChange, autoComplete: "off" })), _jsx(Text, { textAlign: "center", variant: "caption", children: t('signup.subtitle') }), _jsx(PasswordInput, { errorMessage: passwordErrorMessage(values.password), hasError: isValidated &&
|
|
22
22
|
(!isValidPassword(inputs.password) ||
|
|
23
23
|
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "password", placeholder: t('forms.password'), value: (_b = inputs.password) !== null && _b !== void 0 ? _b : '', handleChange: (event) => handleInputChange(event), autoComplete: "new-password" }), _jsx(PasswordInput, { errorMessage: passwordErrorMessage(inputs.confirmPassword), hasError: isValidated &&
|
|
24
24
|
(!isValidPassword(inputs.confirmPassword) ||
|
|
25
|
-
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "confirmPassword", placeholder: t('forms.passwordConfirm'), value: (_c = inputs.confirmPassword) !== null && _c !== void 0 ? _c : '', handleChange: (event) => handleInputChange(event), autoComplete: "new-password" }), _jsx(Center, { px: ['container.sm', 'container.md', 'container.lg'], h: "4rem", children: _jsxs(Text, { textAlign: "center", variant: "info", w: "100%", children: [t('signup.terms'), _jsx("a", { target: "_blank", href: t('footer.termsUrl'), children: t('footer.termsLink') })] }) }), _jsx(Button, { isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), onClick: handleSubmit, children: t('signup.signupBt') })
|
|
25
|
+
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "confirmPassword", placeholder: t('forms.passwordConfirm'), value: (_c = inputs.confirmPassword) !== null && _c !== void 0 ? _c : '', handleChange: (event) => handleInputChange(event), autoComplete: "new-password" }), _jsx(Center, { px: ['container.sm', 'container.md', 'container.lg'], h: "4rem", children: _jsxs(Text, { textAlign: "center", variant: "info", w: "100%", children: [t('signup.terms'), _jsx("a", { target: "_blank", href: t('footer.termsUrl'), children: t('footer.termsLink') })] }) }), _jsx(Button, { isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), onClick: handleSubmit, children: t('signup.signupBt') })] }) }), _jsx(CardFooter, { title: t('signup.signin'), buttonLabel: t('signup.signinBt'), handleButtonClick: handleSignIn })] }), _jsx(Footer, {})] }));
|
|
26
26
|
};
|
package/package.json
CHANGED
|
@@ -34,6 +34,9 @@ export const SignIn = ({
|
|
|
34
34
|
<Box px={['container.sm', 'container.md', 'container.lg']} mb={6}>
|
|
35
35
|
<Stack spacing={8}>
|
|
36
36
|
<Stack spacing="base" as="form">
|
|
37
|
+
{Boolean(loginErrorMessage) && (
|
|
38
|
+
<Text variant="error">{loginErrorMessage}</Text>
|
|
39
|
+
)}
|
|
37
40
|
<TextInput
|
|
38
41
|
autoCapitalize="none"
|
|
39
42
|
autoCorrect="off"
|
|
@@ -60,9 +63,6 @@ export const SignIn = ({
|
|
|
60
63
|
handleInputChange(event)
|
|
61
64
|
}}
|
|
62
65
|
/>
|
|
63
|
-
{Boolean(loginErrorMessage) && (
|
|
64
|
-
<Text variant="error">{loginErrorMessage}</Text>
|
|
65
|
-
)}
|
|
66
66
|
</Stack>
|
|
67
67
|
<Stack spacing={4}>
|
|
68
68
|
<Button
|
|
@@ -52,6 +52,9 @@ export const SignUp = ({
|
|
|
52
52
|
<PageTitle title={t('signup.title')} />
|
|
53
53
|
<Box px={['container.sm', 'container.md', 'container.lg']} mb={6}>
|
|
54
54
|
<Stack spacing="base" as="form">
|
|
55
|
+
{Boolean(signupErrorMessage) && (
|
|
56
|
+
<Text variant="error">{signupErrorMessage}</Text>
|
|
57
|
+
)}
|
|
55
58
|
<TextInput
|
|
56
59
|
errorMessage={t('forms.firstName') + ' ' + t('forms.required')}
|
|
57
60
|
hasError={isValidated && isEmptyField(inputs.firstName)}
|
|
@@ -95,6 +98,7 @@ export const SignUp = ({
|
|
|
95
98
|
autoComplete="off"
|
|
96
99
|
/>
|
|
97
100
|
)}
|
|
101
|
+
|
|
98
102
|
<Text textAlign="center" variant="caption">
|
|
99
103
|
{t('signup.subtitle')}
|
|
100
104
|
</Text>
|
|
@@ -142,9 +146,6 @@ export const SignUp = ({
|
|
|
142
146
|
>
|
|
143
147
|
{t('signup.signupBt')}
|
|
144
148
|
</Button>
|
|
145
|
-
{Boolean(signupErrorMessage) && (
|
|
146
|
-
<Text variant="error">{signupErrorMessage}</Text>
|
|
147
|
-
)}
|
|
148
149
|
</Stack>
|
|
149
150
|
</Box>
|
|
150
151
|
<CardFooter
|