@homefile/components-v2 2.49.9 → 2.49.10
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.
|
@@ -17,5 +17,5 @@ export const TwoFactorSetting = ({ defaultValue = 'email', email = '', loading,
|
|
|
17
17
|
return (_jsxs(Box, { position: "relative", children: [loading && _jsx(Loading, {}), _jsxs(Stack, { bg: "lightBlue.1", px: "base", py: "4", spacing: "8", children: [_jsxs(Stack, { spacing: "4", children: [_jsxs(Flex, { align: "center", justify: "space-between", children: [_jsxs(Flex, { gap: "base", align: "center", children: [_jsx(Img, { src: Security, alt: altText }), _jsx(Text, { fontSize: "sm", textTransform: "uppercase", children: t('myProfile.details.2FactorTitle') })] }), _jsx(Controller, { name: "2fa", control: control, render: ({ field: { value, onChange, onBlur } }) => {
|
|
18
18
|
const label = value ? 'ON' : 'OFF';
|
|
19
19
|
return (_jsxs(FormControl, { display: "flex", alignItems: "center", w: "fit-content", children: [_jsx(FormLabel, { htmlFor: "2fa", mb: "0", fontSize: "sm", children: label }), _jsx(Switch, { id: "2fa", size: "lg", isChecked: value, onChange: onChange, onBlur: onBlur })] }));
|
|
20
|
-
} })] }), _jsx(Text, { fontFamily: "secondary", lineHeight: "1.2", children: t('myProfile.details.2FactorSubtitle') })] }), _jsxs(Stack, Object.assign({}, group, { spacing: "4", children: [_jsxs(Flex, { gap: "base", align: "center", justify: "space-between", children: [_jsx(RadioButton, Object.assign({}, emailRadio, { isDisabled: !is2faEnabled, children: "Email" })), _jsx(Box, { w: "75%", children: _jsx(Controller, { name: "email", control: control, rules: { validate: handleEmailValidation }, render: ({ field: { value, onBlur, onChange }, fieldState: { invalid }, }) => (_jsx(TextInput, { placeholder: t('myProfile.placeholders.email'), handleChange: onChange, onBlur: onBlur, value: value, hasError: invalid, errorMessage: `${t('forms.invalid')} ${t('forms.email')}`, isDisabled:
|
|
20
|
+
} })] }), _jsx(Text, { fontFamily: "secondary", lineHeight: "1.2", children: t('myProfile.details.2FactorSubtitle') })] }), _jsxs(Stack, Object.assign({}, group, { spacing: "4", children: [_jsxs(Flex, { gap: "base", align: "center", justify: "space-between", children: [_jsx(RadioButton, Object.assign({}, emailRadio, { isDisabled: !is2faEnabled, children: "Email" })), _jsx(Box, { w: "75%", children: _jsx(Controller, { name: "email", control: control, rules: { validate: handleEmailValidation }, render: ({ field: { value, onBlur, onChange }, fieldState: { invalid }, }) => (_jsx(TextInput, { placeholder: t('myProfile.placeholders.email'), handleChange: onChange, onBlur: onBlur, value: value, hasError: invalid, errorMessage: `${t('forms.invalid')} ${t('forms.email')}`, isDisabled: true })) }) })] }), _jsxs(Flex, { gap: "base", align: "center", justify: "space-between", children: [_jsx(RadioButton, Object.assign({}, smsRadio, { isDisabled: !is2faEnabled, children: "SMS" })), _jsx(Box, { w: "75%", children: _jsx(Controller, { name: "sms", control: control, rules: { validate: handlePhoneValidation }, render: ({ field: { value, onBlur, onChange }, fieldState: { invalid }, }) => (_jsx(ControlledInput, { placeholder: t('myProfile.placeholders.sms'), onChange: onChange, onBlur: onBlur, value: value, type: "number", hasError: invalid, errorMessage: `${t('forms.invalid')} ${t('forms.phone')}`, isDisabled: radioValue === 'email' || !is2faEnabled })) }) })] }), _jsx(Box, { w: "75%", alignSelf: "end", children: showButtons && (_jsx(Button, { variant: "secondaryFooter", type: "submit", bg: "neutral.white", fontWeight: "medium", onClick: handleSubmit(onSave), children: t('buttons.save').toUpperCase() })) })] }))] })] }));
|
|
21
21
|
};
|
|
@@ -42,7 +42,7 @@ export const UserDetails = ({ email, firstName, lastName, onSave, bg, }) => {
|
|
|
42
42
|
return (_jsx(TextInput, { handleChange: onChange, placeholder: t('myProfile.placeholders.lastName'), value: value, onBlur: onBlur, hasError: invalid, errorMessage: (_a = errors.lastName) === null || _a === void 0 ? void 0 : _a.message }));
|
|
43
43
|
} }), _jsx(Controller, { name: "email", control: control, render: ({ field: { value, onBlur, onChange }, fieldState: { invalid }, }) => {
|
|
44
44
|
var _a;
|
|
45
|
-
return (_jsx(TextInput, { handleChange: onChange, placeholder: t('myProfile.placeholders.email'), value: value, onBlur: onBlur, hasError: invalid, errorMessage: (_a = errors.email) === null || _a === void 0 ? void 0 : _a.message }));
|
|
45
|
+
return (_jsx(TextInput, { handleChange: onChange, placeholder: t('myProfile.placeholders.email'), value: value, onBlur: onBlur, hasError: invalid, errorMessage: (_a = errors.email) === null || _a === void 0 ? void 0 : _a.message, isDisabled: true }));
|
|
46
46
|
} }), isDirty && (_jsx(ContextButtons, { onCancel: () => {
|
|
47
47
|
reset({
|
|
48
48
|
firstName,
|