import { Text, TouchableOpacity, View } from "react-native-ui-lib"; import React, { useEffect, useState } from "react"; import { StyleSheet } from "react-native"; import { NavigationProp } from "@react-navigation/native"; import view from "react-native-ui-lib/src/components/view"; interface ViewSwitchProps { navigation: NavigationProp; // Adjust according to your navigation structure } const ViewSwitch: React.FC = ({ navigation }) => { const [pageIndex, setPageIndex] = useState(navigation.getState().index); useEffect(() => { setPageIndex(navigation.getState().index); }, [navigation.getState().index]) return ( { navigation.navigate("calendar"); }} > Calendar { navigation.navigate("todos"); }} > Chores ); }; export default ViewSwitch; const styles = StyleSheet.create({ switchBtnActive: { backgroundColor: "#ea156c", borderRadius: 50, width: 110, }, switchBtn: { backgroundColor: "#ebebeb", borderRadius: 50, width: 110, }, switchTxt: { fontSize: 16, fontFamily: "Manrope_600SemiBold", }, });