added fetch contact from real device icon
This commit is contained in:
@@ -332,11 +332,28 @@ const Profile = () => {
|
||||
{/* Profile Card */}
|
||||
<View style={styles.profileCard}>
|
||||
{/* Profile Image Section */}
|
||||
{
|
||||
statusData?.role && statusData?.organizerStatus ?
|
||||
<Text style={{ color: "#64748b", marginBottom: 16, textAlign: 'center', fontSize: 18 }}>Your Role: {statusData.role} | Organizer Status: {statusData.organizerStatus}</Text>
|
||||
:
|
||||
<SwitchNavigator role={statusData?.role || ''} status={statusData?.organizerStatus || ''} />}
|
||||
{
|
||||
statusData?.role === "USER" && statusData?.organizerStatus !== "NOT_APPLIED" ? (
|
||||
<Text
|
||||
style={{
|
||||
color: "#64748b",
|
||||
marginBottom: 16,
|
||||
textAlign: "center",
|
||||
fontSize: 18,
|
||||
}}
|
||||
>
|
||||
Your Role: {statusData.role} | Organizer Status: {statusData.organizerStatus}
|
||||
</Text>
|
||||
) : (
|
||||
statusData?.role !== "ORGANIZER" && (
|
||||
<SwitchNavigator
|
||||
role={statusData?.role || ""}
|
||||
status={statusData?.organizerStatus || ""}
|
||||
/>
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
<View style={styles.profileImageSection}>
|
||||
<View style={styles.avatarContainer}>
|
||||
<Image
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user