- Archive dormant apps (daemon, desktop, native, tui) and superseded packages/server into repos/ for reference - Archive 21 dead web components (chat page shell, work-os cluster, strays) into repos/web/; keep reused message-rendering primitives in components/chat - Merge @code/work-os into @code/primitives; work.ts absorbed via ./work subpath and barrel export; update all four importers - Add docs/futures.md tracking audio/video (blocked at Flue + provider), web layout cleanup, and message rendering quality - Repoint dev:zopu script to @code/agents (the live Flue server) - Note repos/ reference-code convention in AGENTS.md
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { Ionicons } from "@expo/vector-icons";
|
|
import * as Haptics from "expo-haptics";
|
|
import { Platform, Pressable } from "react-native";
|
|
import Animated, { FadeOut, ZoomIn } from "react-native-reanimated";
|
|
import { withUniwind } from "uniwind";
|
|
|
|
import { useAppTheme } from "@/contexts/app-theme-context";
|
|
|
|
const StyledIonicons = withUniwind(Ionicons);
|
|
|
|
export function ThemeToggle() {
|
|
const { toggleTheme, isLight } = useAppTheme();
|
|
|
|
return (
|
|
<Pressable
|
|
onPress={() => {
|
|
if (Platform.OS === "ios") {
|
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
}
|
|
toggleTheme();
|
|
}}
|
|
className="px-2.5"
|
|
>
|
|
{isLight ? (
|
|
<Animated.View key="moon" entering={ZoomIn} exiting={FadeOut}>
|
|
<StyledIonicons name="moon" size={20} className="text-foreground" />
|
|
</Animated.View>
|
|
) : (
|
|
<Animated.View key="sun" entering={ZoomIn} exiting={FadeOut}>
|
|
<StyledIonicons name="sunny" size={20} className="text-foreground" />
|
|
</Animated.View>
|
|
)}
|
|
</Pressable>
|
|
);
|
|
}
|