1
1
import { useOrganization } from '@clerk/shared/react' ;
2
- import type { OrganizationProfileModalProps , OrganizationProfileProps } from '@clerk/types' ;
2
+ import type { OrganizationProfileModalProps , OrganizationProfileProps , WithInternalRouting } from '@clerk/types' ;
3
3
import React from 'react' ;
4
+ import type { OrganizationProfileCtx } from 'ui/types' ;
4
5
5
6
import { OrganizationProfileContext , withCoreUserGuard } from '../../contexts' ;
6
7
import { Flow , localizationKeys } from '../../customizables' ;
7
8
import { NavbarMenuButtonRow , ProfileCard , withCardStateProvider } from '../../elements' ;
8
9
import { Route , Switch } from '../../router' ;
9
- import type { OrganizationProfileCtx } from '../../types' ;
10
10
import { OrganizationProfileNavbar } from './OrganizationProfileNavbar' ;
11
11
import { OrganizationProfileRoutes } from './OrganizationProfileRoutes' ;
12
12
13
- const _OrganizationProfile = ( _ : OrganizationProfileProps ) => {
13
+ const _OrganizationProfile = ( ) => {
14
14
const { organization } = useOrganization ( ) ;
15
15
16
16
if ( ! organization ) {
@@ -48,6 +48,9 @@ const AuthenticatedRoutes = withCoreUserGuard(() => {
48
48
49
49
export const OrganizationProfile = withCardStateProvider ( _OrganizationProfile ) ;
50
50
51
+ const InternalOrganizationProfile : React . ComponentType < WithInternalRouting < OrganizationProfileProps > > =
52
+ withCardStateProvider ( _OrganizationProfile ) ;
53
+
51
54
export const OrganizationProfileModal = ( props : OrganizationProfileModalProps ) : JSX . Element => {
52
55
const organizationProfileProps : OrganizationProfileCtx = {
53
56
...props ,
@@ -61,7 +64,7 @@ export const OrganizationProfileModal = (props: OrganizationProfileModalProps):
61
64
< OrganizationProfileContext . Provider value = { organizationProfileProps } >
62
65
{ /*TODO: Used by InvisibleRootBox, can we simplify? */ }
63
66
< div >
64
- < OrganizationProfile { ...organizationProfileProps } />
67
+ < InternalOrganizationProfile { ...organizationProfileProps } />
65
68
</ div >
66
69
</ OrganizationProfileContext . Provider >
67
70
</ Route >
0 commit comments