@@ -18,6 +18,8 @@ import { useLocation } from "react-router-dom";
18
18
import { UserConnectionSource } from "@lowcoder-ee/constants/userConstants" ;
19
19
import { trans } from "i18n" ;
20
20
import { AuthContext , checkPassWithMsg , useAuthSubmit } from "pages/userAuth/authUtils" ;
21
+ import { Divider } from "antd" ;
22
+ import { ThirdPartyAuth } from "pages/userAuth/thirdParty/thirdPartyAuth" ;
21
23
22
24
const StyledFormInput = styled ( FormInput ) `
23
25
margin-bottom: 16px;
@@ -30,16 +32,10 @@ const StyledPasswordInput = styled(PasswordInput)`
30
32
const RegisterContent = styled ( FormWrapperMobile ) `
31
33
display: flex;
32
34
flex-direction: column;
35
+ margin-bottom: 106px;
33
36
34
37
button {
35
- margin: 20px 0 16px 0;
36
- }
37
- ` ;
38
-
39
- const TermsAndPrivacyInfoWrapper = styled . div `
40
- margin-bottom: 80px;
41
- @media screen and (max-width: 640px) {
42
- margin: 10px 0 64px 0;
38
+ margin-bottom: 16px;
43
39
}
44
40
` ;
45
41
@@ -50,14 +46,16 @@ function UserRegister() {
50
46
const redirectUrl = useRedirectUrl ( ) ;
51
47
const location = useLocation ( ) ;
52
48
const { systemConfig, inviteInfo } = useContext ( AuthContext ) ;
49
+ const invitationId = inviteInfo ?. invitationId ;
50
+ const invitedOrganizationId = inviteInfo ?. invitedOrganizationId ;
53
51
const authId = systemConfig . form . id ;
54
52
const { loading, onSubmit } = useAuthSubmit (
55
53
( ) =>
56
54
UserApi . formLogin ( {
57
55
register : true ,
58
56
loginId : account ,
59
57
password : password ,
60
- invitationId : inviteInfo ?. invitationId ,
58
+ invitationId,
61
59
source : UserConnectionSource . email ,
62
60
authId,
63
61
} ) ,
@@ -95,13 +93,21 @@ function UserRegister() {
95
93
>
96
94
{ trans ( "userAuth.register" ) }
97
95
</ ConfirmButton >
98
- < TermsAndPrivacyInfoWrapper >
99
- < TermsAndPrivacyInfo onCheckChange = { ( e ) => setSubmitBtnDisable ( ! e . target . checked ) } />
100
- </ TermsAndPrivacyInfoWrapper >
101
- < StyledRouteLinkLogin to = { { pathname : AUTH_LOGIN_URL , state : location . state } } >
102
- { trans ( "userAuth.userLogin" ) }
103
- </ StyledRouteLinkLogin >
96
+ < TermsAndPrivacyInfo onCheckChange = { ( e ) => setSubmitBtnDisable ( ! e . target . checked ) } />
97
+ { Boolean ( invitationId ) && (
98
+ < >
99
+ < Divider />
100
+ < ThirdPartyAuth
101
+ invitationId = { invitationId }
102
+ invitedOrganizationId = { invitedOrganizationId }
103
+ authGoal = "register"
104
+ />
105
+ </ >
106
+ ) }
104
107
</ RegisterContent >
108
+ < StyledRouteLinkLogin to = { { pathname : AUTH_LOGIN_URL , state : location . state } } >
109
+ { trans ( "userAuth.userLogin" ) }
110
+ </ StyledRouteLinkLogin >
105
111
</ AuthContainer >
106
112
) ;
107
113
}
0 commit comments