Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
828 B
TypeScript
32 lines
828 B
TypeScript
import { User as FirebaseUser } from '@firebase/auth'
|
|
import { AuthPage } from 'components/auth-page'
|
|
import { Splash } from 'components/splash'
|
|
import React, { useEffect } from 'react'
|
|
import WebView from 'react-native-webview'
|
|
|
|
export const SplashAuth = (props: {
|
|
webview: React.RefObject<WebView | undefined>
|
|
hasLoadedWebView: boolean
|
|
fbUser: FirebaseUser | null
|
|
isConnected: boolean
|
|
}) => {
|
|
const { isConnected, hasLoadedWebView, fbUser, webview } = props
|
|
|
|
useEffect(() => {
|
|
if (!isConnected) {
|
|
alert("You're offline. Please reconnect to the internet to use Predikt.")
|
|
}
|
|
}, [isConnected])
|
|
|
|
if (!isConnected || !hasLoadedWebView) {
|
|
return <Splash />
|
|
}
|
|
|
|
if (!fbUser) {
|
|
return <AuthPage webview={webview} />
|
|
}
|
|
|
|
// This shouldn't happen as App.tsx handles this case
|
|
return null
|
|
}
|