Merge branch 'feature_redux' of https://git.zeptic.in/abintoppo_lincpay/CircleCollect into feature_profile
This commit is contained in:
@@ -327,10 +327,14 @@ const Profile = () => {
|
||||
{/* Profile Card */}
|
||||
<View style={styles.profileCard}>
|
||||
{/* Profile Image Section */}
|
||||
{ user?.role === "ORGANIZER" && user?.organizerStatus === "NOT_APPLIED" || "PENDING" ? (
|
||||
{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 || ''} />
|
||||
<SwitchNavigator role={user?.role || ''} status={user?.organizerStatus === "NOT_APPLIED" ? '' : user?.organizerStatus || ''} />
|
||||
|
||||
)}
|
||||
<View style={styles.profileImageSection}>
|
||||
<View style={styles.avatarContainer}>
|
||||
|
||||
@@ -26,7 +26,7 @@ const SwitchNavigator: React.FC<SwitchNavigatorProps> = ({ role, status }) => {
|
||||
if (newValue) {
|
||||
navigation.navigate("BecomeOrg"); // Navigate when ON
|
||||
setTimeout(() => {
|
||||
setIsEnabled(false);
|
||||
setIsEnabled(false);
|
||||
}, 2000);
|
||||
// Reset switch to OFF after navigation
|
||||
} else {
|
||||
@@ -40,17 +40,18 @@ 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>
|
||||
<Switch
|
||||
trackColor={{ false: "#767577", true: colors.textLight }}
|
||||
thumbColor={isEnabled ? colors.pastelBlue : "#f4f3f4"}
|
||||
ios_backgroundColor="#3e3e3e"
|
||||
onValueChange={toggleSwitch}
|
||||
value={isEnabled}
|
||||
/>
|
||||
{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>}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user