11import { useUser } from '@clerk/shared/react' ;
2+ import type { ComponentProps } from 'react' ;
23import { useState } from 'react' ;
34
45import { useEnvironment , useOAuthConsentContext } from '@/ui/contexts' ;
56import { Box , Button , Flex , Flow , Grid , Icon , Text } from '@/ui/customizables' ;
67import { ApplicationLogo } from '@/ui/elements/ApplicationLogo' ;
7- import { Avatar } from '@/ui/elements/Avatar' ;
88import { Card } from '@/ui/elements/Card' ;
99import { withCardStateProvider } from '@/ui/elements/contexts' ;
1010import { Header } from '@/ui/elements/Header' ;
@@ -42,13 +42,16 @@ export function OAuthConsentInternal() {
4242 { /* both have avatars */ }
4343 { oAuthApplicationLogoUrl && logoImageUrl && (
4444 < ConnectionHeader >
45- < Avatar
46- imageUrl = { oAuthApplicationLogoUrl }
47- size = { t => t . space . $12 }
48- rounded = { false }
49- />
45+ < ConnectionItem justify = 'end' >
46+ < ApplicationLogo
47+ src = { oAuthApplicationLogoUrl }
48+ alt = { oAuthApplicationName }
49+ />
50+ </ ConnectionItem >
5051 < ConnectionSeparator />
51- < ApplicationLogo />
52+ < ConnectionItem justify = 'start' >
53+ < ApplicationLogo />
54+ </ ConnectionItem >
5255 </ ConnectionHeader >
5356 ) }
5457 { /* only OAuth app has an avatar */ }
@@ -59,10 +62,9 @@ export function OAuthConsentInternal() {
5962 position : 'relative' ,
6063 } }
6164 >
62- < Avatar
63- imageUrl = { oAuthApplicationLogoUrl }
64- size = { t => t . space . $12 }
65- rounded = { false }
65+ < ApplicationLogo
66+ src = { oAuthApplicationLogoUrl }
67+ alt = { oAuthApplicationName }
6668 />
6769 < ConnectionIcon
6870 size = 'sm'
@@ -77,31 +79,21 @@ export function OAuthConsentInternal() {
7779 ) }
7880 { /* only Clerk application has an avatar */ }
7981 { ! oAuthApplicationLogoUrl && logoImageUrl && (
80- < Flex
81- justify = 'center'
82- align = 'center'
83- gap = { 4 }
84- sx = { t => ( {
85- marginBlockEnd : t . space . $6 ,
86- } ) }
87- >
88- < ConnectionIcon />
82+ < ConnectionHeader >
83+ < ConnectionItem justify = 'end' >
84+ < ConnectionIcon />
85+ </ ConnectionItem >
8986 < ConnectionSeparator />
90- < ApplicationLogo />
91- </ Flex >
87+ < ConnectionItem justify = 'start' >
88+ < ApplicationLogo />
89+ </ ConnectionItem >
90+ </ ConnectionHeader >
9291 ) }
9392 { /* no avatars */ }
9493 { ! oAuthApplicationLogoUrl && ! logoImageUrl && (
95- < Flex
96- justify = 'center'
97- align = 'center'
98- gap = { 4 }
99- sx = { t => ( {
100- marginBlockEnd : t . space . $6 ,
101- } ) }
102- >
94+ < ConnectionHeader >
10395 < ConnectionIcon />
104- </ Flex >
96+ </ ConnectionHeader >
10597 ) }
10698 < Header . Title localizationKey = { oAuthApplicationName } />
10799 < Header . Subtitle
@@ -320,6 +312,17 @@ function ConnectionHeader({ children }: { children: React.ReactNode }) {
320312 ) ;
321313}
322314
315+ function ConnectionItem ( { children, sx, ...props } : ComponentProps < typeof Flex > ) {
316+ return (
317+ < Flex
318+ { ...props }
319+ sx = { [ { flex : 1 } , sx ] }
320+ >
321+ { children }
322+ </ Flex >
323+ ) ;
324+ }
325+
323326function ConnectionIcon ( { size = 'md' , sx } : { size ?: 'sm' | 'md' ; sx ?: ThemableCssProp } ) {
324327 const scale : ThemableCssProp = t => {
325328 const value = size === 'sm' ? t . space . $6 : t . space . $12 ;
0 commit comments