11import { Stack , useRouter } from "expo-router" ;
2- import { type ComponentProps , useState } from "react" ;
3- import { Pressable , Text as RNText , View , useColorScheme } from "react-native" ;
4- import { SymbolView } from "expo-symbols" ;
2+ import { useState } from "react" ;
3+ import { Text as RNText , View , useColorScheme } from "react-native" ;
54import { useThemeColor } from "../lib/useThemeColor" ;
65
76import { buildThreadRoutePath } from "../lib/routes" ;
87import { useRemoteCatalog } from "../state/use-remote-catalog" ;
98import { useRemoteEnvironmentState } from "../state/use-remote-environment-registry" ;
109import { HomeScreen } from "../features/home/HomeScreen" ;
11- import type { RemoteCatalogState } from "../state/use-remote-catalog" ;
12-
13- function resolveHeaderStatus ( state : RemoteCatalogState ) : {
14- readonly icon : ComponentProps < typeof SymbolView > [ "name" ] ;
15- readonly color : string ;
16- readonly label : string ;
17- } {
18- if ( state . isLoadingSavedConnections ) {
19- return { icon : "hourglass" , color : "#737373" , label : "Loading environments" } ;
20- }
21- if ( state . connectionError ) {
22- return { icon : "exclamationmark.triangle.fill" , color : "#ef4444" , label : "Environment error" } ;
23- }
24- if ( state . connectionState === "ready" ) {
25- return { icon : "checkmark.circle.fill" , color : "#22c55e" , label : "Environment online" } ;
26- }
27- if ( state . connectionState === "connecting" || state . connectionState === "reconnecting" ) {
28- return {
29- icon : "arrow.triangle.2.circlepath" ,
30- color : "#f59e0b" ,
31- label : "Environment connecting" ,
32- } ;
33- }
34- return { icon : "wifi.slash" , color : "#ef4444" , label : "Environment offline" } ;
35- }
3610
3711/* ─── Route screen ───────────────────────────────────────────────────── */
3812
@@ -44,7 +18,6 @@ export default function HomeRouteScreen() {
4418
4519 const isDark = useColorScheme ( ) === "dark" ;
4620 const iconColor = String ( useThemeColor ( "--color-icon" ) ) ;
47- const status = resolveHeaderStatus ( catalogState ) ;
4821
4922 return (
5023 < >
@@ -105,15 +78,16 @@ export default function HomeRouteScreen() {
10578 </ Stack . Toolbar >
10679
10780 < Stack . Toolbar placement = "right" >
108- < Stack . Toolbar . View hidesSharedBackground >
109- < Pressable
110- accessibilityLabel = { status . label }
111- className = "h-11 w-11 items-center justify-center rounded-full bg-card active:opacity-70 "
81+ < Stack . Toolbar . Menu icon = "ellipsis.circle" separateBackground >
82+ < Stack . Toolbar . Label > More </ Stack . Toolbar . Label >
83+ < Stack . Toolbar . MenuAction
84+ icon = "desktopcomputer "
11285 onPress = { ( ) => router . push ( "/connections" ) }
86+ subtitle = "Manage connected hosts"
11387 >
114- < SymbolView name = { status . icon } size = { 21 } tintColor = { status . color } type = "monochrome" / >
115- </ Pressable >
116- </ Stack . Toolbar . View >
88+ < Stack . Toolbar . Label > Environments </ Stack . Toolbar . Label >
89+ </ Stack . Toolbar . MenuAction >
90+ </ Stack . Toolbar . Menu >
11791 </ Stack . Toolbar >
11892
11993 { /* Bottom toolbar: search + compose, visually split like iMessage */ }
0 commit comments