notifi
This commit is contained in:
@@ -164,7 +164,7 @@ const CycleDashboard = ({ data }: { data: CycleDashboardData }) => {
|
||||
</View>
|
||||
<View style={styles.summaryBox}>
|
||||
<Text style={styles.summaryLabel}>Cycles</Text>
|
||||
<Text style={styles.summaryValue}>{data.currentCycle}/{data.totalCycles}</Text>
|
||||
<Text style={styles.summaryValue}>{data.currentCycle}/{data.totalParticipants}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -86,6 +86,7 @@ const GroupDetails = () => {
|
||||
const getCycleDashboard = async () => {
|
||||
try {
|
||||
const response = await apiCall(`${BASE_URL}payments/groups/${group.id}/cycle-dashboard`, "GET") as any;
|
||||
console.log("Cycle Dashboard Response: ", response);
|
||||
const responseData = response.data;
|
||||
setCycleDashboardData(responseData);
|
||||
|
||||
@@ -117,6 +118,7 @@ const GroupDetails = () => {
|
||||
const handleContribution = async () => {
|
||||
try {
|
||||
const res = await apiCall(`${CONTRIBUTE}${group.id}/calculate-contribution`, 'GET') as any;
|
||||
console.log("Contribution Calculation Response: ", res);
|
||||
setPayable(res.data);
|
||||
} catch (error) {
|
||||
console.log("Error in handleContribution: ", error);
|
||||
@@ -169,20 +171,20 @@ const GroupDetails = () => {
|
||||
}
|
||||
contentContainerStyle={styles.scrollContent}
|
||||
>
|
||||
<Header title={group.name} />
|
||||
<Header title={cycleDashboardData?.groupName || group?.name} />
|
||||
<Text style={styles.description}>{group.description}</Text>
|
||||
|
||||
<View style={styles.statsRow}>
|
||||
<View style={styles.statBox}>
|
||||
<Text style={styles.statValue}>{group.members.length ?? 0}</Text>
|
||||
<Text style={styles.statValue}>{memberData.length ?? 0}</Text>
|
||||
<Text style={styles.statLabel}>Members</Text>
|
||||
</View>
|
||||
<View style={styles.statBox}>
|
||||
<Text style={styles.statValue}>₹{group.collected}</Text>
|
||||
<Text style={styles.statValue}>₹{cycleDashboardData?.contributionAmount|| group.collected}</Text>
|
||||
<Text style={styles.statLabel}>Contribution</Text>
|
||||
</View>
|
||||
<View style={styles.statBox}>
|
||||
<Text style={styles.statValue}>₹{group.goal}</Text>
|
||||
<Text style={styles.statValue}>₹{cycleDashboardData?.contributionAmount*memberData.length|| group.goal}</Text>
|
||||
<Text style={styles.statLabel}>Total Amount</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -203,7 +205,7 @@ const GroupDetails = () => {
|
||||
<View style={styles.membersHeader}>
|
||||
<Text style={styles.sectionTitle}>Members</Text>
|
||||
<View style={styles.statusBadge}>
|
||||
<Text style={styles.statusText}>{group.status}</Text>
|
||||
<Text style={styles.statusText}>{cycleDashboardData?.status || group?.status}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -219,7 +221,7 @@ const GroupDetails = () => {
|
||||
))}
|
||||
|
||||
{/* Button at the bottom inside scroll (no absolute positioning) */}
|
||||
{group.status === 'ACTIVE' && !payable?.hasPaid && (
|
||||
{cycleDashboardData?.status === 'ACTIVE' && !payable?.hasPaid && (
|
||||
<TouchableOpacity onPress={() => setOpenModal(true)} style={styles.button}>
|
||||
<Text style={styles.buttonText}>Contribute</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
Reference in New Issue
Block a user