currect edit profile button

This commit is contained in:
Jaanu423
2025-09-18 16:40:04 +05:30
parent c040840040
commit f7b9cb9190
5 changed files with 124 additions and 85 deletions
+7 -2
View File
@@ -2,6 +2,7 @@ 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;
@@ -24,6 +25,10 @@ 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,8 +45,8 @@ const SwitchNavigator: React.FC<SwitchNavigatorProps> = ({ role, status }) => {
: `Request Organizer Role ${status}`}
</Text>
<Switch
trackColor={{ false: "#767577", true: "#81b0ff" }}
thumbColor={isEnabled ? "#007AFF" : "#f4f3f4"}
trackColor={{ false: "#767577", true: colors.textLight }}
thumbColor={isEnabled ? colors.pastelBlue : "#f4f3f4"}
ios_backgroundColor="#3e3e3e"
onValueChange={toggleSwitch}
value={isEnabled}