11import { debug } from 'common/logger'
2+ import { useEffect , useState } from 'react'
23import { LoggedOutHome } from 'web/components/home/home'
34import { Col } from 'web/components/layout/col'
45import { PageBase } from 'web/components/page-base'
56import { ProfilesHome } from 'web/components/profiles/profiles-home'
7+ import { CompassLoadingIndicator } from 'web/components/widgets/loading-indicator'
68import { useUser } from 'web/hooks/use-user'
79import { useT } from 'web/lib/locale'
810
@@ -15,20 +17,29 @@ import {useT} from 'web/lib/locale'
1517export default function ProfilesPage ( ) {
1618 const user = useUser ( )
1719 const t = useT ( )
20+ const [ slowLoad , setSlowLoad ] = useState ( false )
21+
22+ useEffect ( ( ) => {
23+ if ( user !== undefined ) return
24+ const timer = setTimeout ( ( ) => setSlowLoad ( true ) , 5000 )
25+ return ( ) => clearTimeout ( timer )
26+ } , [ user ] )
1827
1928 if ( user === undefined ) {
2029 return (
2130 < PageBase trackPageView = { 'loading' } >
22- < Col className = "items-center justify-center min-h-[60vh] gap-6 text-center " >
23- < div className = "animate-spin rounded-full h-14 w-14 border-4 border-primary-500 border-t-transparent" / >
24- < div className = "flex flex-col gap-2" >
31+ < Col className = "items-center gap-8 px-4 py-8 " >
32+ < Col className = "items-center gap-3 text-center pt-8" >
33+ < CompassLoadingIndicator / >
2534 < h2 className = "text-2xl font-semibold" >
2635 { t ( 'profiles.loading_dashboard' , 'Loading dashboard…' ) }
2736 </ h2 >
28- { /*<p className="text-ink-500 max-w-sm">*/ }
29- { /* {t('profiles.loading_dashboard_desc', 'Hang tight while we set things up for you.')}*/ }
30- { /*</p>*/ }
31- </ div >
37+ < p className = "text-ink-500 max-w-sm text-sm" >
38+ { slowLoad
39+ ? t ( 'profiles.loading_slow' , 'Still starting up — almost there…' )
40+ : t ( 'profiles.loading_dashboard_desc' , 'The server is waking up, hang tight.' ) }
41+ </ p >
42+ </ Col >
3243 </ Col >
3344 </ PageBase >
3445 )
0 commit comments