@homefile/components-v2 2.7.19 → 2.7.20
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.
|
@@ -7,7 +7,7 @@ export interface TwoFactorSettingI {
|
|
|
7
7
|
defaultValue?: string;
|
|
8
8
|
email?: string;
|
|
9
9
|
loading?: boolean;
|
|
10
|
-
onChange?: (value:
|
|
10
|
+
onChange?: (value: 'email' | 'sms') => void;
|
|
11
11
|
onSave: (value: TwoFactorFormI) => void;
|
|
12
12
|
sms?: string;
|
|
13
13
|
twoFactor?: string;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
2
|
import { useRadioGroup } from '@chakra-ui/react'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
4
|
import * as yup from 'yup'
|
|
@@ -15,7 +15,7 @@ export const useTwoFactorSetting = ({
|
|
|
15
15
|
}: Partial<TwoFactorSettingI>) => {
|
|
16
16
|
const altText = getIconAltText(Security)
|
|
17
17
|
|
|
18
|
-
const handleRadioChange = (value:
|
|
18
|
+
const handleRadioChange = (value: 'email' | 'sms') => {
|
|
19
19
|
onChange?.(value)
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -56,7 +56,8 @@ export const useTwoFactorSetting = ({
|
|
|
56
56
|
const isSmsChanged = smsValue !== sms
|
|
57
57
|
const radioChanged = radioValue !== defaultValue && is2faEnabled
|
|
58
58
|
|
|
59
|
-
const showButtons =
|
|
59
|
+
const showButtons =
|
|
60
|
+
isSwitchChanged || isEmailChanged || isSmsChanged || radioChanged
|
|
60
61
|
|
|
61
62
|
const handlePhoneValidation = (value?: string): boolean => {
|
|
62
63
|
if (radioValue === 'sms')
|
|
@@ -8,7 +8,7 @@ export interface TwoFactorSettingI {
|
|
|
8
8
|
defaultValue?: string
|
|
9
9
|
email?: string
|
|
10
10
|
loading?: boolean
|
|
11
|
-
onChange?: (value:
|
|
11
|
+
onChange?: (value: 'email' | 'sms') => void
|
|
12
12
|
onSave: (value: TwoFactorFormI) => void
|
|
13
13
|
sms?: string
|
|
14
14
|
twoFactor?: string
|