added fetch contact from real device icon
This commit is contained in:
@@ -23,6 +23,7 @@ import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
||||
import { ApiResponse } from "../home/UserProfileStatus";
|
||||
import { BASE_URL } from "../../utils/ApiUrls";
|
||||
import AppView from "../../components/AppView";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +48,7 @@ type UserProfile = {
|
||||
|
||||
const Profile = () => {
|
||||
const navigation = useNavigation<any>();
|
||||
const user1 = useSelector((state: any) => state.user);
|
||||
const [user, setUser] = useState<UserProfile | null>(null);
|
||||
const [fetching, setFetching] = useState(true);
|
||||
const [editing, setEditing] = useState(false);
|
||||
@@ -222,7 +224,7 @@ const Profile = () => {
|
||||
const response = await fetch(`${BASE_URL}user/profile/status`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
Accept: "/",
|
||||
Accept: "*/*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
@@ -232,6 +234,7 @@ const Profile = () => {
|
||||
console.log("👤 Profile Status Response:", json);
|
||||
if (json.status === "success") {
|
||||
setStatusData(json.data);
|
||||
console.log("statusData response :", json);
|
||||
|
||||
} else {
|
||||
setError(json.message || "Failed to fetch status");
|
||||
@@ -273,6 +276,8 @@ const Profile = () => {
|
||||
);
|
||||
};
|
||||
|
||||
console.log("statusData?.role :", statusData?.role);
|
||||
console.log("statusData?.organizerStatus :", statusData?.organizerStatus);
|
||||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
@@ -327,15 +332,11 @@ const Profile = () => {
|
||||
{/* Profile Card */}
|
||||
<View style={styles.profileCard}>
|
||||
{/* Profile Image Section */}
|
||||
{user?.role !== "USER"
|
||||
&&
|
||||
(user?.role === "ORGANIZER" &&
|
||||
(user?.organizerStatus === "NOT_APPLIED" || user?.organizerStatus !== "PENDING")) ? (
|
||||
<Text style={{ color: "#64748b", marginBottom: 16, textAlign: 'center', fontSize: 18 }}>Your Role: {user.role} | Organizer Status: {user.organizerStatus}</Text>
|
||||
) : (
|
||||
<SwitchNavigator role={user?.role || ''} status={user?.organizerStatus === "NOT_APPLIED" ? '' : user?.organizerStatus || ''} />
|
||||
|
||||
)}
|
||||
{
|
||||
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 || ''} />}
|
||||
<View style={styles.profileImageSection}>
|
||||
<View style={styles.avatarContainer}>
|
||||
<Image
|
||||
|
||||
Reference in New Issue
Block a user