diff --git a/packages/clerk-js/src/ui/common/CustomPageContentContainer.tsx b/packages/clerk-js/src/ui/common/CustomPageContentContainer.tsx new file mode 100644 index 0000000000..e134a08f89 --- /dev/null +++ b/packages/clerk-js/src/ui/common/CustomPageContentContainer.tsx @@ -0,0 +1,28 @@ +import { Col, descriptors } from '../customizables'; +import { CardAlert, NavbarMenuButtonRow, useCardState, withCardStateProvider } from '../elements'; +import type { CustomPageContent } from '../utils'; +import { ExternalElementMounter } from '../utils'; + +export const CustomPageContentContainer = withCardStateProvider( + ({ mount, unmount }: Omit) => { + const card = useCardState(); + return ( + + {card.error} + + + + + + ); + }, +); diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx index 8aacf80ccd..4901728238 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx @@ -1,8 +1,8 @@ +import { CustomPageContentContainer } from '../../common/CustomPageContentContainer'; import { useOrganizationProfileContext } from '../../contexts'; import { ProfileCardContent } from '../../elements'; import { Route, Switch } from '../../router'; import type { PropsOfComponent } from '../../styledSystem'; -import { ExternalElementMounter } from '../../utils'; import { DeleteOrganizationPage, LeaveOrganizationPage } from './ActionConfirmationPage'; import { AddDomainPage } from './AddDomainPage'; import { InviteMembersPage } from './InviteMembersPage'; @@ -29,7 +29,7 @@ export const OrganizationProfileRoutes = (props: PropsOfComponent - diff --git a/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx b/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx index 0d7222f075..f064b6b552 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx @@ -1,8 +1,8 @@ +import { CustomPageContentContainer } from '../../common/CustomPageContentContainer'; import { useUserProfileContext } from '../../contexts'; import { ProfileCardContent } from '../../elements'; import { Route, Switch } from '../../router'; import type { PropsOfComponent } from '../../styledSystem'; -import { ExternalElementMounter } from '../../utils'; import { ConnectedAccountsPage } from './ConnectedAccountsPage'; import { DeletePage } from './DeletePage'; import { EmailPage } from './EmailPage'; @@ -36,7 +36,7 @@ export const UserProfileRoutes = (props: PropsOfComponent -