import React from "react"; import { View, Text, TouchableOpacity, ScrollView, StyleSheet, } from "react-native"; import { Ionicons } from "@expo/vector-icons"; // Import Ionicons untuk icon kembali import { useNavigation } from "@react-navigation/native"; const transactions = [ { id: 1, type: "Penukaran Koin", amount: -250, date: "2025-04-25 10:30", description: "Tukar dengan Tas Belanja", }, { id: 2, type: "Penukaran Koin", amount: -150, date: "2025-04-26 14:00", description: "Tukar dengan Botol Minum", }, { id: 3, type: "Penukaran Koin", amount: -350, date: "2025-04-27 08:15", description: "Tukar dengan Peralatan Makan", }, ]; export default function RiwayatCoinScreen() { const navigation = useNavigation(); return ( {/* Tombol Kembali */} navigation.goBack()} // Kembali ke halaman sebelumnya > {/* Judul */} RIWAYAT KOIN {/* Kolom Riwayat Transaksi */} {transactions.map((transaction) => ( {/* Deskripsi Transaksi */} {transaction.type} {transaction.description} {transaction.date} {/* Jumlah Koin */} {transaction.amount} Koin ))} ); } const styles = StyleSheet.create({ container: { padding: 20, flex: 1, backgroundColor: "#fff", }, backButton: { position: "absolute", top: 20, left: 10, zIndex: 1, marginTop: 30, // Menempatkan tombol di atas komponen lainnya }, title: { fontSize: 22, fontWeight: "bold", color: "#000", marginBottom: 5, textAlign: "center", marginRight: 200, marginTop: 30, }, historyBox: { marginTop: 10, paddingBottom: 5, }, transactionView: { backgroundColor: "#fff", // Warna latar belakang kotak borderRadius: 20, marginVertical: 10, padding: 15, flexDirection: "row", // Menyusun elemen secara horizontal justifyContent: "space-between", // Membuat kedua kolom terpisah alignItems: "center", borderWidth: 1, borderColor: "#000", }, transactionContent: { flexDirection: "row", justifyContent: "space-between", width: "100%", }, leftColumn: { flex: 1, }, rightColumn: { alignItems: "flex-end", // Memposisikan kanan flexDirection: "column", justifyContent: "center", }, transactionType: { fontSize: 16, fontWeight: "bold", color: "#333", }, transactionDescription: { fontSize: 14, color: "#555", marginBottom: 5, }, transactionDate: { fontSize: 12, color: "#888", }, transactionAmount: { fontSize: 24, fontWeight: "bold", color: "#4F772D", // Warna merah untuk pengurangan koin }, });