@@ -27,7 +27,6 @@ function SelectOrgContent(): React.ReactElement {
2727 // Check if we just returned from org creation and reload to get fresh data
2828 useEffect ( ( ) => {
2929 if ( searchParams . get ( 'org_created' ) === 'true' ) {
30- // Remove the flag from URL and reload to get fresh organization data
3130 const newUrl = new URL ( window . location . href ) ;
3231 newUrl . searchParams . delete ( 'org_created' ) ;
3332 window . location . href = newUrl . toString ( ) ;
@@ -72,20 +71,15 @@ function SelectOrgContent(): React.ReactElement {
7271 try {
7372 await setActive ( { organization : selectedOrgId } ) ;
7473
75- // After setting active org, redirect back to authorize
7674 const authorizeUrl = new URL ( '/authorize' , window . location . origin ) ;
7775
78- // Add all original OAuth parameters
7976 Object . entries ( originalParams ) . forEach ( ( [ key , value ] ) => {
8077 if ( value ) authorizeUrl . searchParams . set ( key , value ) ;
8178 } ) ;
8279
83- // Add the selected orgId as a parameter
8480 authorizeUrl . searchParams . set ( 'org_id' , selectedOrgId ) ;
8581
86- const redirectUri = authorizeUrl . toString ( ) ;
87-
88- router . push ( redirectUri ) ;
82+ router . push ( authorizeUrl . toString ( ) ) ;
8983 } catch ( error ) {
9084 console . error ( 'Failed to set active organization:' , error ) ;
9185 setIsSelecting ( false ) ;
@@ -103,12 +97,11 @@ function SelectOrgContent(): React.ReactElement {
10397 ) ;
10498 }
10599
106- // Check if user has any organizations (only after loaded)
100+ // No organizations — show create flow
107101 if ( isLoaded && ! userMemberships ?. isLoading && ( ! userMemberships ?. data || userMemberships . data . length === 0 ) ) {
108102 return (
109103 < Col className = "min-h-screen items-center justify-center" >
110- { /* User button in top-right corner */ }
111- < div className = "absolute top-4 right-4" >
104+ < div className = "absolute top-6 right-6" >
112105 < UserButton
113106 afterSignOutUrl = { `/select-org?${ searchParams . toString ( ) } ` }
114107 />
@@ -136,8 +129,7 @@ function SelectOrgContent(): React.ReactElement {
136129
137130 return (
138131 < Col className = "min-h-screen items-center justify-center" >
139- { /* User button in top-right corner */ }
140- < div className = "absolute top-4 right-4" >
132+ < div className = "absolute top-6 right-6" >
141133 < UserButton
142134 afterSignOutUrl = { `/select-org?${ searchParams . toString ( ) } ` }
143135 />
@@ -155,11 +147,10 @@ function SelectOrgContent(): React.ReactElement {
155147 < div
156148 ref = { scrollContainerRef }
157149 onScroll = { updateScrollState }
158- className = "flex flex-col gap-2 max-h-60 overflow-y-auto"
150+ className = "flex flex-col gap-0 max-h-64 overflow-y-auto"
159151 >
160152 { ( userMemberships ?. data || user ?. organizationMemberships )
161153 ?. sort ( ( a , b ) => {
162- // Put the currently active org first
163154 if ( a . organization . id === orgId ) return - 1 ;
164155 if ( b . organization . id === orgId ) return 1 ;
165156 return 0 ;
@@ -172,25 +163,25 @@ function SelectOrgContent(): React.ReactElement {
172163 key = { membership . organization . id }
173164 onClick = { ( ) => handleOrgSelect ( membership . organization . id ) }
174165 disabled = { isSelecting }
175- className = { `w-full p-4 text-left rounded-lg transition-all cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${
166+ className = { `w-full p-4 text-left transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border-[0.5px] border-foreground -mt-[0.5px] first:mt-0 ${
176167 isSelected
177- ? 'bg-primary/10 border border-primary/40 '
178- : 'border border-border hover:border-primary/30 hover:bg-primary/5'
168+ ? 'bg-primary/10'
169+ : 'hover:bg-primary/5'
179170 } `}
180171 >
181172 < Row className = "gap-3" >
182173 { membership . organization . imageUrl && (
183174 < img
184175 src = { membership . organization . imageUrl }
185176 alt = { membership . organization . name }
186- className = "w-10 h-10 rounded-lg "
177+ className = "w-10 h-10"
187178 />
188179 ) }
189180 < Col className = "flex-1 gap-1" >
190181 < Row className = "justify-between items-center" >
191182 < span className = "font-normal text-sm text-foreground" > { membership . organization . name } </ span >
192183 { isCurrentlyActive && (
193- < span className = "text-xs bg-primary/15 text-primary px-2 py-0.5 rounded-full " >
184+ < span className = "text-[10px] uppercase tracking-wide border-[0.5px] border-foreground px-2 py-0.5" >
194185 active
195186 </ span >
196187 ) }
@@ -203,23 +194,22 @@ function SelectOrgContent(): React.ReactElement {
203194 } ) }
204195 </ div >
205196
206- { /* Fade overlays to indicate scrollability */ }
207197 { canScrollUp && (
208- < div className = "absolute top-0 left-0 right-0 h-4 bg-gradient-to-b from-background to-transparent pointer-events-none" />
198+ < div className = "absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background to-transparent pointer-events-none" />
209199 ) }
210200 { canScrollDown && (
211- < div className = "absolute bottom-0 left-0 right-0 h-4 bg-gradient-to-t from-background to-transparent pointer-events-none" />
201+ < div className = "absolute bottom-0 left-0 right-0 h-6 bg-gradient-to-t from-background to-transparent pointer-events-none" />
212202 ) }
213203 </ div >
214204
215205 < button
216206 onClick = { handleConfirm }
217207 disabled = { isSelecting || ! selectedOrgId }
218- className = "w-full bg-primary text-primary-foreground py-3 px-4 rounded-lg font-normal text-sm hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-opacity"
208+ className = "w-full bg-foreground text-background py-3 px-4 font-light text-sm hover:underline hover:decoration-[0.5px] hover:underline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-opacity"
219209 >
220210 { isSelecting ? (
221211 < Row className = "items-center justify-center gap-2" >
222- < div className = "animate-spin rounded-full h-4 w-4 border-b-2 border-primary-foreground " > </ div >
212+ < div className = "animate-spin rounded-full h-4 w-4 border-b-2 border-background " > </ div >
223213 authorizing...
224214 </ Row >
225215 ) : 'continue' }
0 commit comments