@@ -12,7 +12,7 @@ export function AppShell() {
1212 ( state ) => state . recommendAndFetchTerrainForCurrentArea ,
1313 ) ;
1414 const [ isMapExpanded , setIsMapExpanded ] = useState ( false ) ;
15- const [ accessState , setAccessState ] = useState < "checking" | "granted" | "pending" > ( "checking" ) ;
15+ const [ accessState , setAccessState ] = useState < "checking" | "granted" | "pending" | "locked" > ( "checking" ) ;
1616
1717 useEffect ( ( ) => {
1818 if ( srtmTilesCount > 0 ) return ;
@@ -25,11 +25,21 @@ export function AppShell() {
2525 const me = await fetchMe ( ) ;
2626 setAccessState ( me . isAdmin || me . isApproved ? "granted" : "pending" ) ;
2727 } catch {
28- setAccessState ( "granted " ) ;
28+ setAccessState ( "locked " ) ;
2929 }
3030 } ) ( ) ;
3131 } , [ ] ) ;
3232
33+ if ( accessState === "checking" ) {
34+ return (
35+ < main className = "app-shell access-locked-shell" >
36+ < section className = "panel-section access-locked-panel" >
37+ < h2 > Checking access…</ h2 >
38+ </ section >
39+ </ main >
40+ ) ;
41+ }
42+
3343 if ( accessState === "pending" ) {
3444 return (
3545 < main className = "app-shell access-locked-shell" >
@@ -51,6 +61,27 @@ export function AppShell() {
5161 ) ;
5262 }
5363
64+ if ( accessState === "locked" ) {
65+ return (
66+ < main className = "app-shell access-locked-shell" >
67+ < section className = "panel-section access-locked-panel" >
68+ < h2 > Access unavailable</ h2 >
69+ < p className = "field-help" >
70+ Your account session is valid, but this account is not available in LinkSim right now.
71+ </ p >
72+ < p className = "field-help" >
73+ If your user was removed by an admin, ask for re-approval. Then sign out and sign in again.
74+ </ p >
75+ < div className = "chip-group" >
76+ < button className = "inline-action" onClick = { ( ) => ( window . location . href = "/cdn-cgi/access/logout" ) } type = "button" >
77+ Sign Out
78+ </ button >
79+ </ div >
80+ </ section >
81+ </ main >
82+ ) ;
83+ }
84+
5485 return (
5586 < main className = { `app-shell ${ isMapExpanded ? "is-map-expanded" : "" } ` } >
5687 { ! isMapExpanded ? < Sidebar /> : null }
0 commit comments