@@ -15,21 +15,23 @@ import type {
1515} from '@clerk/types' ;
1616import React from 'react' ;
1717
18- import { useClerkRemixOptions } from './RemixOptionsContext ' ;
18+ import { usePathnameWithoutSplatRouteParams } from './usePathnameWithoutSplatRouteParams ' ;
1919
2020// The assignment of UserProfile with BaseUserProfile props is used
2121// to support the CustomPage functionality (eg UserProfile.Page)
2222// Also the `typeof BaseUserProfile` is used to resolved the following error:
2323// "The inferred type of 'UserProfile' cannot be named without a reference to ..."
2424export const UserProfile : typeof BaseUserProfile = Object . assign (
2525 ( props : UserProfileProps ) => {
26- return < BaseUserProfile { ...useRoutingProps ( 'UserProfile' , props ) } /> ;
26+ const path = usePathnameWithoutSplatRouteParams ( ) ;
27+ return < BaseUserProfile { ...useRoutingProps ( 'UserProfile' , props , { path } ) } /> ;
2728 } ,
2829 { ...BaseUserProfile } ,
2930) ;
3031
3132export const CreateOrganization = ( props : CreateOrganizationProps ) => {
32- return < BaseCreateOrganization { ...useRoutingProps ( 'CreateOrganization' , props ) } /> ;
33+ const path = usePathnameWithoutSplatRouteParams ( ) ;
34+ return < BaseCreateOrganization { ...useRoutingProps ( 'CreateOrganization' , props , { path } ) } /> ;
3335} ;
3436
3537// The assignment of OrganizationProfile with BaseOrganizationProfile props is used
@@ -38,17 +40,18 @@ export const CreateOrganization = (props: CreateOrganizationProps) => {
3840// "The inferred type of 'OrganizationProfile' cannot be named without a reference to ..."
3941export const OrganizationProfile : typeof BaseOrganizationProfile = Object . assign (
4042 ( props : OrganizationProfileProps ) => {
41- return < BaseOrganizationProfile { ...useRoutingProps ( 'OrganizationProfile' , props ) } /> ;
43+ const path = usePathnameWithoutSplatRouteParams ( ) ;
44+ return < BaseOrganizationProfile { ...useRoutingProps ( 'OrganizationProfile' , props , { path } ) } /> ;
4245 } ,
4346 { ...BaseOrganizationProfile } ,
4447) ;
4548
4649export const SignIn = ( props : SignInProps ) => {
47- const { signInUrl } = useClerkRemixOptions ( ) ;
48- return < BaseSignIn { ...useRoutingProps ( 'SignIn' , props , { path : signInUrl } ) } /> ;
50+ const path = usePathnameWithoutSplatRouteParams ( ) ;
51+ return < BaseSignIn { ...useRoutingProps ( 'SignIn' , props , { path } ) } /> ;
4952} ;
5053
5154export const SignUp = ( props : SignUpProps ) => {
52- const { signUpUrl } = useClerkRemixOptions ( ) ;
53- return < BaseSignUp { ...useRoutingProps ( 'SignUp' , props , { path : signUpUrl } ) } /> ;
55+ const path = usePathnameWithoutSplatRouteParams ( ) ;
56+ return < BaseSignUp { ...useRoutingProps ( 'SignUp' , props , { path } ) } /> ;
5457} ;
0 commit comments