added fetch contact from real device icon

This commit is contained in:
Jaanu423
2025-09-19 13:22:30 +05:30
parent 3b1dc58405
commit 660d14260a
4 changed files with 281 additions and 225 deletions
+8 -14
View File
@@ -2,7 +2,6 @@ import React, { useState } from "react";
import { View, Text, StyleSheet, Switch } from "react-native";
import { useNavigation } from "@react-navigation/native";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
import colors from "../../components/colors";
type RootStackParamList = {
BecomeOrg: undefined;
@@ -25,10 +24,6 @@ const SwitchNavigator: React.FC<SwitchNavigatorProps> = ({ role, status }) => {
if (newValue) {
navigation.navigate("BecomeOrg"); // Navigate when ON
setTimeout(() => {
setIsEnabled(false);
}, 2000);
// Reset switch to OFF after navigation
} else {
navigation.navigate("Profile"); // Navigate when OFF
}
@@ -40,18 +35,17 @@ const SwitchNavigator: React.FC<SwitchNavigatorProps> = ({ role, status }) => {
return (
<View style={styles.container}>
<Text style={styles.text}>
{!isEnabled && role !== "USER"
{!isEnabled && role !== "USER"
? "Become an Organizer"
: `Request Organizer Role ${status}`}
</Text>
{role !== "USER" ? (
<Switch
trackColor={{ false: "#767577", true: colors.textLight }}
thumbColor={isEnabled ? colors.pastelBlue : "#f4f3f4"}
ios_backgroundColor="#3e3e3e"
onValueChange={toggleSwitch}
value={isEnabled}
/>) : <View> <Text> </Text></View>}
<Switch
trackColor={{ false: "#767577", true: "#81b0ff" }}
thumbColor={isEnabled ? "#007AFF" : "#f4f3f4"}
ios_backgroundColor="#3e3e3e"
onValueChange={toggleSwitch}
value={isEnabled}
/>
</View>
);
};