import React, { useEffect, useRef } from "react"; import { View, Text, StyleSheet, Animated, Easing, } from "react-native"; import { Ionicons } from "@react-native-vector-icons/ionicons"; import colors from "../components/colors"; import CustomModal from "../components/common/CustomModal"; interface ContributionProps { data: any; visible: boolean; onClose: () => void; onConfirm: () => void; } const ContributionDetails: React.FC = ({ data, visible, onClose, onConfirm, }) => { // Animations const fadeAnim = useRef(new Animated.Value(0)).current; const slideAnim = useRef(new Animated.Value(50)).current; const scaleAnim = useRef(new Animated.Value(0.9)).current; useEffect(() => { if (visible) { Animated.parallel([ Animated.timing(fadeAnim, { toValue: 1, duration: 600, useNativeDriver: true, }), Animated.timing(slideAnim, { toValue: 0, duration: 600, easing: Easing.out(Easing.exp), useNativeDriver: true, }), Animated.spring(scaleAnim, { toValue: 1, friction: 6, useNativeDriver: true, }), ]).start(); } else { fadeAnim.setValue(0); slideAnim.setValue(50); scaleAnim.setValue(0.9); } }, [visible]); return ( {/* Header */} Contribution Summary {/* Contribution Info Card */} Base Amount ₹{data?.baseAmount} { data?.alreadyPaid ? Already Paid Amount : Total Payable ₹{data?.totalPayable} } Due Date {data?.dueDate} Cycle End {data?.cycleEnd} {/* Extra Details */} Cycle Number {data?.cycleNumber} Late Fee Mode {data?.lateFeeMode} Late Fee Value ₹{data?.lateFeeValue} Effective Late Fee ₹{data?.effectiveLateFee} ); }; export default ContributionDetails; const styles = StyleSheet.create({ header: { flexDirection: "row", alignItems: "center", marginBottom: 24, }, headerTitle: { fontSize: 22, fontWeight: "700", marginLeft: 10, }, card: { backgroundColor: "#fff", padding: 16, borderRadius: 16, marginBottom: 16, shadowColor: "#000", shadowOpacity: 0.08, shadowOffset: { width: 0, height: 3 }, shadowRadius: 6, elevation: 3, }, label: { fontSize: 13, color: "#6b7280", marginTop: 6, }, value: { fontSize: 15, fontWeight: "500", color: "#374151", marginBottom: 6, }, valueHighlight: { fontSize: 18, fontWeight: "700", color: colors.black, marginBottom: 10, }, });