@bloom-housing/ui-components 4.4.1-alpha.22 → 4.4.1-alpha.23
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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.4.1-alpha.23](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.4.1-alpha.22...@bloom-housing/ui-components@4.4.1-alpha.23) (2022-06-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.4.1-alpha.22](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.4.1-alpha.21...@bloom-housing/ui-components@4.4.1-alpha.22) (2022-06-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @bloom-housing/ui-components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "4.4.1-alpha.
|
|
3
|
+
"version": "4.4.1-alpha.23",
|
|
4
4
|
"author": "Sean Albert <sean.albert@exygy.com>",
|
|
5
5
|
"description": "Shared user interface components for Bloom affordable housing system",
|
|
6
6
|
"homepage": "https://github.com/bloom-housing/bloom/tree/master/shared/ui-components",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"ts-jest": "^26.4.1",
|
|
109
109
|
"typesafe-actions": "^5.1.0"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "1b2400d4c6ddd566fcd5b7bfa6756a6b9490cffd"
|
|
112
112
|
}
|
|
@@ -11,13 +11,17 @@ import {
|
|
|
11
11
|
FormSignInErrorBox,
|
|
12
12
|
} from "@bloom-housing/ui-components"
|
|
13
13
|
import { NetworkStatus, FormSignInControl } from "./FormSignIn"
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
export enum RequestType {
|
|
16
|
+
email = "email",
|
|
17
|
+
sms = "sms",
|
|
18
|
+
}
|
|
15
19
|
|
|
16
20
|
export type FormSignInMFACodeProps = {
|
|
17
21
|
control: FormSignInControl
|
|
18
22
|
onSubmit: (data: FormSignInMFACodeValues) => void
|
|
19
23
|
networkError: NetworkStatus
|
|
20
|
-
mfaType:
|
|
24
|
+
mfaType: RequestType
|
|
21
25
|
allowPhoneNumberEdit: boolean
|
|
22
26
|
phoneNumber: string
|
|
23
27
|
goBackToPhone: () => void
|
|
@@ -63,7 +67,7 @@ const FormSignInMFACode = ({
|
|
|
63
67
|
<Icon size="2xl" symbol="profile" className="form-card__header-icon" />
|
|
64
68
|
<h2 className="form-card__title is-borderless">{t("nav.signInMFA.verifyTitle")}</h2>
|
|
65
69
|
<p className="form-card__sub-title">
|
|
66
|
-
{mfaType ===
|
|
70
|
+
{mfaType === RequestType.sms
|
|
67
71
|
? t("nav.signInMFA.haveSentCodeToPhone")
|
|
68
72
|
: t("nav.signInMFA.haveSentCodeToEmail")}
|
|
69
73
|
</p>
|
|
@@ -12,12 +12,13 @@ import {
|
|
|
12
12
|
} from "@bloom-housing/ui-components"
|
|
13
13
|
import type { UseFormMethods } from "react-hook-form"
|
|
14
14
|
import { NetworkStatus } from "./FormSignIn"
|
|
15
|
-
import { EnumRequestMfaCodeMfaType } from "@bloom-housing/backend-core/types"
|
|
16
15
|
|
|
17
16
|
export type FormSignInMFAProps = {
|
|
18
17
|
control: FormSignInMFAControl
|
|
19
|
-
onSubmit: (data:
|
|
18
|
+
onSubmit: (data: unknown) => void
|
|
20
19
|
networkError: NetworkStatus
|
|
20
|
+
emailOnClick: () => void
|
|
21
|
+
smsOnClick: () => void
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export type FormSignInMFAControl = {
|
|
@@ -27,14 +28,12 @@ export type FormSignInMFAControl = {
|
|
|
27
28
|
setValue: UseFormMethods["setValue"]
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
export type FormSignInMFAValues = {
|
|
31
|
-
mfaType: EnumRequestMfaCodeMfaType
|
|
32
|
-
}
|
|
33
|
-
|
|
34
31
|
const FormSignInMFAType = ({
|
|
35
32
|
onSubmit,
|
|
36
33
|
networkError,
|
|
37
34
|
control: { errors, register, handleSubmit, setValue },
|
|
35
|
+
emailOnClick,
|
|
36
|
+
smsOnClick,
|
|
38
37
|
}: FormSignInMFAProps) => {
|
|
39
38
|
const onError = () => {
|
|
40
39
|
window.scrollTo(0, 0)
|
|
@@ -76,7 +75,7 @@ const FormSignInMFAType = ({
|
|
|
76
75
|
<Button
|
|
77
76
|
styleType={AppearanceStyleType.accentCool}
|
|
78
77
|
data-test-id="verify-by-email"
|
|
79
|
-
onClick={
|
|
78
|
+
onClick={smsOnClick}
|
|
80
79
|
>
|
|
81
80
|
{t("nav.signInMFA.verifyByEmail")}
|
|
82
81
|
</Button>
|
|
@@ -85,7 +84,7 @@ const FormSignInMFAType = ({
|
|
|
85
84
|
<Button
|
|
86
85
|
styleType={AppearanceStyleType.accentCool}
|
|
87
86
|
data-test-id="verify-by-phone"
|
|
88
|
-
onClick={
|
|
87
|
+
onClick={emailOnClick}
|
|
89
88
|
>
|
|
90
89
|
{t("nav.signInMFA.verifyByPhone")}
|
|
91
90
|
</Button>
|