working payment

This commit is contained in:
Abin Toppo
2025-10-22 13:02:17 +05:30
parent e5f4cb280d
commit 81cb9cff66
2 changed files with 652 additions and 456 deletions
+90 -50
View File
@@ -1,10 +1,10 @@
// src/components/RequestCard.tsx // src/components/RequestCard.tsx
import React, { FC } from 'react'; import React, { FC } from 'react';
import { View, Text, Image, TouchableOpacity, StyleSheet } from 'react-native'; import { View, Text, Image, TouchableOpacity, StyleSheet, Platform } from 'react-native';
import { Ionicons } from "@react-native-vector-icons/ionicons"; import { Ionicons } from "@react-native-vector-icons/ionicons"; // Assuming Expo for icons
import colors from './colors'; // Assuming your colors are defined here import colors from './colors'; // Your color palette
import { JoinRequest } from '../types'; import { JoinRequest } from '../types'; // Your type definition
interface RequestCardProps { interface RequestCardProps {
item: JoinRequest; item: JoinRequest;
@@ -15,94 +15,124 @@ interface RequestCardProps {
export const RequestCard: FC<RequestCardProps> = ({ item, onApprove, onDecline }) => { export const RequestCard: FC<RequestCardProps> = ({ item, onApprove, onDecline }) => {
return ( return (
<View style={styles.card}> <View style={styles.card}>
{/* Top section with user avatar and info */} {/* User Information Section */}
<View style={styles.userInfoSection}> <View style={styles.userInfoSection}>
<Image <Image
source={{ uri: item.userAvatar || `https://i.pravatar.cc/150?u=${item.userId}` }} source={require('../assets/images/placeholder.png')}
style={styles.avatar} style={styles.avatar}
/> />
<View style={styles.userInfo}> <View style={styles.userInfo}>
<Text style={styles.userName} numberOfLines={1}>{item.userName}</Text> <Text style={styles.userName} numberOfLines={1}>{item.userName}</Text>
<Text style={styles.userMeta}><Ionicons name="call-outline" size={14} color={colors.textLight} /> {item.mobile}</Text> <View style={styles.userMetaContainer}>
<Ionicons name="call-outline" size={14} color={colors.textLight} />
<Text style={styles.userMeta}>{item.mobile}</Text>
</View>
</View> </View>
</View> </View>
{/* Middle section for the group name */} {/* Group Information Section */}
<View style={styles.groupInfoSection}> <View style={styles.groupInfoSection}>
<Text style={styles.requestText}> <Text style={styles.requestText}>Wants to join group</Text>
Wants to join the group: <Text style={styles.groupName}>{item.groupName}</Text> <Text style={styles.groupName} numberOfLines={2}>{item.groupName}</Text>
</Text>
</View> </View>
{/* Bottom section with action buttons */} {/* Action Buttons Section */}
<View style={styles.actionsSection}> <View style={styles.actionsSection}>
<TouchableOpacity style={[styles.actionButton, styles.declineButton]} onPress={() => onDecline(item)}> <TouchableOpacity
<Ionicons name="close-outline" size={20} color={colors.black} /> style={[styles.actionButton, styles.declineButton]}
<Text style={[styles.actionButtonText,]}>Decline</Text> onPress={() => onDecline(item)}
activeOpacity={0.7}
>
<Ionicons name="close" size={20} color={colors.textDark} />
<Text style={styles.actionButtonText}>Decline</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.actionButton, styles.approveButton]} onPress={() => onApprove(item)}> <TouchableOpacity
{/* Corrected icon color and updated text color for better contrast */} style={[styles.actionButton, styles.approveButton]}
<Ionicons name="checkmark-outline" size={20} color={colors.textDark} /> onPress={() => onApprove(item)}
<Text style={[styles.actionButtonText, { color: colors.textDark }]}>Approve</Text> activeOpacity={0.8}
>
<Ionicons name="checkmark" size={20} color={colors.black} />
<Text style={[styles.actionButtonText, { color: colors.black }]}>Approve</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
); );
}; };
const styles = StyleSheet.create({ const styles = StyleSheet.create({
card: { card: {
marginHorizontal: 12, marginHorizontal: 16,
marginVertical: 12,
backgroundColor: colors.white, backgroundColor: colors.white,
borderRadius: 16, borderRadius: 24,
marginVertical: 8, padding: 20,
elevation: 5, ...Platform.select({
shadowColor: '#000', ios: {
shadowOpacity: 0.1, shadowColor: '#000',
shadowRadius: 10, shadowOffset: { width: 0, height: 4 },
shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.08,
padding: 8, shadowRadius: 12,
},
android: {
elevation: 8,
shadowColor: '#00000020', // Softer shadow color for Android
},
}),
borderWidth: 1,
borderColor: '#f0f0f0',
}, },
userInfoSection: { userInfoSection: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
paddingBottom: 6,
}, },
avatar: { avatar: {
width: 50, width: 60,
height: 50, height: 60,
borderRadius: 25, borderRadius: 30,
marginRight: 12, marginRight: 16,
borderWidth: 2,
borderColor: colors.pastelOrange,
}, },
userInfo: { userInfo: {
flex: 1, flex: 1,
}, },
userName: { userName: {
fontSize: 17, fontSize: 19,
fontWeight: 'bold', fontWeight: 'bold',
color: colors.textDark, color: colors.textDark,
}, },
userMetaContainer: {
flexDirection: 'row',
alignItems: 'center',
marginTop: 5,
},
userMeta: { userMeta: {
fontSize: 14, fontSize: 14,
color: colors.textLight, color: colors.textLight,
marginTop: 4, marginLeft: 8,
}, },
groupInfoSection: { groupInfoSection: {
marginTop: 18,
paddingVertical: 16, paddingVertical: 16,
paddingHorizontal: 16,
backgroundColor: '#F7F8FA',
borderRadius: 16,
alignItems: 'center',
}, },
requestText: { requestText: {
fontSize: 15, fontSize: 14,
color: colors.textDark, color: colors.textLight,
}, },
groupName: { groupName: {
fontWeight: 'bold', fontSize: 17,
fontWeight: '600',
color: colors.textDark, color: colors.textDark,
marginTop: 6,
textAlign: 'center',
}, },
actionsSection: { actionsSection: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', marginTop: 20,
gap: 12, gap: 12,
}, },
actionButton: { actionButton: {
@@ -110,21 +140,31 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
paddingVertical: 12, paddingVertical: 16,
borderRadius: 12, borderRadius: 16,
}, },
declineButton: { declineButton: {
elevation:5, backgroundColor: '#F1F3F6',
backgroundColor:colors.white
}, },
approveButton: { approveButton: {
// Set background color as requested
backgroundColor: colors.pastelOrange, backgroundColor: colors.pastelOrange,
elevation:5, ...Platform.select({
ios: {
shadowColor: colors.pastelOrange,
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.3,
shadowRadius: 8,
},
android: {
elevation: 6,
shadowColor: colors.pastelOrange,
},
}),
}, },
actionButtonText: { actionButtonText: {
fontSize: 16, fontSize: 16,
fontWeight: '600', fontWeight: 'bold',
marginLeft: 8, marginLeft: 8,
color: colors.textDark,
}, },
}); });
File diff suppressed because it is too large Load Diff