11import { createDeferredPromise } from '@clerk/shared' ;
22import { useSafeLayoutEffect } from '@clerk/shared/react' ;
33import type {
4+ __experimental_UserVerificationProps ,
45 Appearance ,
56 Clerk ,
67 ClerkOptions ,
@@ -28,6 +29,7 @@ import {
2829 SignInModal ,
2930 SignUpModal ,
3031 UserProfileModal ,
32+ UserVerificationModal ,
3133} from './lazyModules/components' ;
3234import {
3335 LazyComponentRenderer ,
@@ -55,13 +57,33 @@ export type ComponentControls = {
5557 props ?: unknown ;
5658 } ) => void ;
5759 openModal : <
58- T extends 'googleOneTap' | 'signIn' | 'signUp' | 'userProfile' | 'organizationProfile' | 'createOrganization' ,
60+ T extends
61+ | 'googleOneTap'
62+ | 'signIn'
63+ | 'signUp'
64+ | 'userProfile'
65+ | 'organizationProfile'
66+ | 'createOrganization'
67+ | 'userVerification' ,
5968 > (
6069 modal : T ,
61- props : T extends 'signIn' ? SignInProps : T extends 'signUp' ? SignUpProps : UserProfileProps ,
70+ props : T extends 'signIn'
71+ ? SignInProps
72+ : T extends 'signUp'
73+ ? SignUpProps
74+ : T extends 'userVerification'
75+ ? __experimental_UserVerificationProps
76+ : UserProfileProps ,
6277 ) => void ;
6378 closeModal : (
64- modal : 'googleOneTap' | 'signIn' | 'signUp' | 'userProfile' | 'organizationProfile' | 'createOrganization' ,
79+ modal :
80+ | 'googleOneTap'
81+ | 'signIn'
82+ | 'signUp'
83+ | 'userProfile'
84+ | 'organizationProfile'
85+ | 'createOrganization'
86+ | 'userVerification' ,
6587 ) => void ;
6688 // Special case, as the impersonation fab mounts automatically
6789 mountImpersonationFab : ( ) => void ;
@@ -88,6 +110,7 @@ interface ComponentsState {
88110 signInModal : null | SignInProps ;
89111 signUpModal : null | SignUpProps ;
90112 userProfileModal : null | UserProfileProps ;
113+ userVerificationModal : null | __experimental_UserVerificationProps ;
91114 organizationProfileModal : null | OrganizationProfileProps ;
92115 createOrganizationModal : null | CreateOrganizationProps ;
93116 nodes : Map < HTMLDivElement , HtmlNodeOptions > ;
@@ -164,6 +187,7 @@ const Components = (props: ComponentsProps) => {
164187 signInModal : null ,
165188 signUpModal : null ,
166189 userProfileModal : null ,
190+ userVerificationModal : null ,
167191 organizationProfileModal : null ,
168192 createOrganizationModal : null ,
169193 nodes : new Map ( ) ,
@@ -175,6 +199,7 @@ const Components = (props: ComponentsProps) => {
175199 signInModal,
176200 signUpModal,
177201 userProfileModal,
202+ userVerificationModal,
178203 organizationProfileModal,
179204 createOrganizationModal,
180205 nodes,
@@ -297,6 +322,23 @@ const Components = (props: ComponentsProps) => {
297322 </ LazyModalRenderer >
298323 ) ;
299324
325+ const mountedUserVerificationModal = (
326+ < LazyModalRenderer
327+ globalAppearance = { state . appearance }
328+ appearanceKey = { 'userVerification' }
329+ componentAppearance = { userVerificationModal ?. appearance }
330+ flowName = { 'userVerification' }
331+ onClose = { ( ) => componentsControls . closeModal ( 'userVerification' ) }
332+ onExternalNavigate = { ( ) => componentsControls . closeModal ( 'userVerification' ) }
333+ startPath = { buildVirtualRouterUrl ( { base : '/user-verification' , path : urlStateParam ?. path } ) }
334+ componentName = { 'UserVerificationModal' }
335+ modalContainerSx = { { alignItems : 'center' } }
336+ modalContentSx = { t => ( { height : `min(${ t . sizes . $176 } , calc(100% - ${ t . sizes . $12 } ))` , margin : 0 } ) }
337+ >
338+ < UserVerificationModal { ...userVerificationModal } />
339+ </ LazyModalRenderer >
340+ ) ;
341+
300342 const mountedOrganizationProfileModal = (
301343 < LazyModalRenderer
302344 globalAppearance = { state . appearance }
@@ -359,6 +401,7 @@ const Components = (props: ComponentsProps) => {
359401 { signInModal && mountedSignInModal }
360402 { signUpModal && mountedSignUpModal }
361403 { userProfileModal && mountedUserProfileModal }
404+ { userVerificationModal && mountedUserVerificationModal }
362405 { organizationProfileModal && mountedOrganizationProfileModal }
363406 { createOrganizationModal && mountedCreateOrganizationModal }
364407 { state . impersonationFab && (
0 commit comments