@@ -18,6 +18,8 @@ import { useLocation } from "react-router-dom";
1818import { UserConnectionSource } from "@lowcoder-ee/constants/userConstants" ;
1919import { trans } from "i18n" ;
2020import { AuthContext , checkPassWithMsg , useAuthSubmit } from "pages/userAuth/authUtils" ;
21+ import { Divider } from "antd" ;
22+ import { ThirdPartyAuth } from "pages/userAuth/thirdParty/thirdPartyAuth" ;
2123
2224const StyledFormInput = styled ( FormInput ) `
2325 margin-bottom: 16px;
@@ -30,16 +32,10 @@ const StyledPasswordInput = styled(PasswordInput)`
3032const RegisterContent = styled ( FormWrapperMobile ) `
3133 display: flex;
3234 flex-direction: column;
35+ margin-bottom: 106px;
3336
3437 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;
4339 }
4440` ;
4541
@@ -50,14 +46,16 @@ function UserRegister() {
5046 const redirectUrl = useRedirectUrl ( ) ;
5147 const location = useLocation ( ) ;
5248 const { systemConfig, inviteInfo } = useContext ( AuthContext ) ;
49+ const invitationId = inviteInfo ?. invitationId ;
50+ const invitedOrganizationId = inviteInfo ?. invitedOrganizationId ;
5351 const authId = systemConfig . form . id ;
5452 const { loading, onSubmit } = useAuthSubmit (
5553 ( ) =>
5654 UserApi . formLogin ( {
5755 register : true ,
5856 loginId : account ,
5957 password : password ,
60- invitationId : inviteInfo ?. invitationId ,
58+ invitationId,
6159 source : UserConnectionSource . email ,
6260 authId,
6361 } ) ,
@@ -95,13 +93,21 @@ function UserRegister() {
9593 >
9694 { trans ( "userAuth.register" ) }
9795 </ 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+ ) }
104107 </ RegisterContent >
108+ < StyledRouteLinkLogin to = { { pathname : AUTH_LOGIN_URL , state : location . state } } >
109+ { trans ( "userAuth.userLogin" ) }
110+ </ StyledRouteLinkLogin >
105111 </ AuthContainer >
106112 ) ;
107113}
0 commit comments