1+ import { useOrganization } from '@clerk/shared/react/index' ;
12import type { __experimental_ConfigureSSOProps } from '@clerk/shared/types' ;
23import React from 'react' ;
34
45import { useEnvironment , withCoreUserGuard } from '@/contexts' ;
5- import { Col , Flex , Flow , localizationKeys , Text } from '@/customizables' ;
6+ import { Box , Col , Flex , Flow , Icon , localizationKeys , Text , useAppearance } from '@/customizables' ;
67import { ApplicationLogo } from '@/elements/ApplicationLogo' ;
78import { withCardStateProvider } from '@/elements/contexts' ;
89import { NavBar , NavbarContextProvider } from '@/elements/Navbar' ;
910import { ProfileCard } from '@/elements/ProfileCard' ;
11+ import { BoxIcon } from '@/icons' ;
1012import { Route , Switch } from '@/router' ;
11- import { useOrganization } from '@clerk/shared/react/index' ;
1213
1314const ConfigureSSOInternal = ( ) => {
1415 return (
@@ -26,8 +27,10 @@ const ConfigureSSOInternal = () => {
2627
2728const AuthenticatedContent = withCoreUserGuard ( ( ) => {
2829 const contentRef = React . useRef < HTMLDivElement > ( null ) ;
29- const { applicationName } = useEnvironment ( ) . displayConfig ;
30+ const { applicationName, logoImageUrl } = useEnvironment ( ) . displayConfig ;
3031 const { organizationSettings } = useEnvironment ( ) ;
32+ const { parsedOptions } = useAppearance ( ) ;
33+ const hasLogo = Boolean ( parsedOptions . logoImageUrl || logoImageUrl ) ;
3134
3235 return (
3336 < ProfileCard . Root
@@ -37,17 +40,40 @@ const AuthenticatedContent = withCoreUserGuard(() => {
3740 < NavBar
3841 header = {
3942 < Flex
43+ align = 'center'
4044 sx = { t => ( {
4145 gap : t . space . $2 ,
4246 padding : `${ t . space . $none } ${ t . space . $3 } ` ,
4347 maxWidth : '100%' ,
4448 } ) }
4549 >
46- < ApplicationLogo
47- sx = { t => ( { width : t . space . $9 , height : t . space . $9 , borderRadius : t . radii . $md , overflow : 'hidden' } ) }
48- />
50+ { hasLogo ? (
51+ < ApplicationLogo
52+ sx = { t => ( { width : t . space . $9 , height : t . space . $9 , borderRadius : t . radii . $md , overflow : 'hidden' } ) }
53+ />
54+ ) : (
55+ < Box
56+ sx = { t => ( {
57+ width : t . space . $9 ,
58+ height : t . space . $9 ,
59+ flexShrink : 0 ,
60+ borderRadius : t . radii . $md ,
61+ backgroundColor : t . colors . $primary500 ,
62+ color : t . colors . $colorPrimaryForeground ,
63+ display : 'flex' ,
64+ alignItems : 'center' ,
65+ justifyContent : 'center' ,
66+ } ) }
67+ aria-hidden
68+ >
69+ < Icon
70+ icon = { BoxIcon }
71+ sx = { t => ( { width : t . sizes . $4 , height : t . sizes . $4 } ) }
72+ />
73+ </ Box >
74+ ) }
4975
50- < Col sx = { t => ( { gap : t . space . $0x5 , minWidth : 0 } ) } >
76+ < Col sx = { { minWidth : 0 } } >
5177 < Text
5278 as = 'p'
5379 truncate
@@ -71,6 +97,11 @@ const AuthenticatedContent = withCoreUserGuard(() => {
7197
7298const OrganizationSubtitle = ( ) => {
7399 const { organization } = useOrganization ( ) ;
100+
101+ if ( ! organization ) {
102+ return null ;
103+ }
104+
74105 return (
75106 < Text
76107 as = 'span'
0 commit comments