openclaw/apps/expo-github-mobile/App.tsx
semihpolat a591c51010 feat(expo): add GitHub integration and WebSocket client
- Add GitHub API service for fetching user repos and branches
- Add settings view for GitHub username and gateway URL
- Update NewSessionSheet to use real GitHub data
- Add Gateway WebSocket client for real-time communication
- Add useGateway hook for agent event streaming
- Prepare for real-time tool call streaming in ChatView

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 14:16:02 -08:00

42 lines
1.2 KiB
TypeScript

import React, { useState } from 'react'
import { StatusBar } from 'expo-status-bar'
import { AppProvider } from './src/contexts/AppContext'
import { Session } from './src/models/types'
import SessionListView from './src/views/SessionListView'
import ChatView from './src/views/ChatView'
import SettingsView from './src/views/SettingsView'
type ViewType = 'list' | 'chat' | 'settings'
export default function App() {
const [currentView, setCurrentView] = useState<ViewType>('list')
const [activeSession, setActiveSession] = useState<Session | null>(null)
const handleSessionPress = (session: Session) => {
setActiveSession(session)
setCurrentView('chat')
}
const handleBackToList = () => {
setCurrentView('list')
setActiveSession(null)
}
const handleSettingsPress = () => {
setCurrentView('settings')
}
return (
<AppProvider>
<StatusBar style="light" />
{currentView === 'list' ? (
<SessionListView onSessionPress={handleSessionPress} onSettingsPress={handleSettingsPress} />
) : currentView === 'settings' ? (
<SettingsView onBack={handleBackToList} />
) : activeSession ? (
<ChatView session={activeSession} onBack={handleBackToList} />
) : null}
</AppProvider>
)
}