Merge branch 'feature_redux' of https://git.zeptic.in/abintoppo_lincpay/CircleCollect into feature_profile

This commit is contained in:
Abin Toppo
2025-09-18 17:24:21 +05:30
2 changed files with 16 additions and 11 deletions
+6 -2
View File
@@ -327,10 +327,14 @@ const Profile = () => {
{/* Profile Card */} {/* Profile Card */}
<View style={styles.profileCard}> <View style={styles.profileCard}>
{/* Profile Image Section */} {/* 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> <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.profileImageSection}>
<View style={styles.avatarContainer}> <View style={styles.avatarContainer}>
+9 -8
View File
@@ -26,7 +26,7 @@ const SwitchNavigator: React.FC<SwitchNavigatorProps> = ({ role, status }) => {
if (newValue) { if (newValue) {
navigation.navigate("BecomeOrg"); // Navigate when ON navigation.navigate("BecomeOrg"); // Navigate when ON
setTimeout(() => { setTimeout(() => {
setIsEnabled(false); setIsEnabled(false);
}, 2000); }, 2000);
// Reset switch to OFF after navigation // Reset switch to OFF after navigation
} else { } else {
@@ -44,13 +44,14 @@ const SwitchNavigator: React.FC<SwitchNavigatorProps> = ({ role, status }) => {
? "Become an Organizer" ? "Become an Organizer"
: `Request Organizer Role ${status}`} : `Request Organizer Role ${status}`}
</Text> </Text>
<Switch {role !== "USER" ? (
trackColor={{ false: "#767577", true: colors.textLight }} <Switch
thumbColor={isEnabled ? colors.pastelBlue : "#f4f3f4"} trackColor={{ false: "#767577", true: colors.textLight }}
ios_backgroundColor="#3e3e3e" thumbColor={isEnabled ? colors.pastelBlue : "#f4f3f4"}
onValueChange={toggleSwitch} ios_backgroundColor="#3e3e3e"
value={isEnabled} onValueChange={toggleSwitch}
/> value={isEnabled}
/>) : <View> <Text> </Text></View>}
</View> </View>
); );
}; };