185 lines
4.4 KiB
JavaScript
185 lines
4.4 KiB
JavaScript
import React from "react";
|
|
import {
|
|
View,
|
|
Text,
|
|
StyleSheet,
|
|
TouchableOpacity,
|
|
Image,
|
|
ScrollView,
|
|
} from "react-native";
|
|
import { Ionicons } from "@expo/vector-icons";
|
|
|
|
const pengaduanData = {
|
|
id: 1,
|
|
judul: "Sampah Menumpuk di Jalan Raya",
|
|
alamat: "Jl. Raya No. 25, Desa Suka Maju, Nganjuk",
|
|
catatan: "Mohon segera dibersihkan, sudah terlalu lama menumpuk.",
|
|
tanggal: "2025-04-28",
|
|
gambar: "https://via.placeholder.com/150", // Ganti dengan gambar yang sesuai
|
|
status: "Sedang Diproses", // Bisa diganti dengan 'Sedang Diverifikasi', 'Ditolak', dll.
|
|
pelapor: {
|
|
nama: "Dina",
|
|
profilGambar: "https://via.placeholder.com/50", // Gambar profil pelapor
|
|
},
|
|
};
|
|
|
|
const PengaduanScreen = ({ navigation }) => {
|
|
return (
|
|
<View style={styles.container}>
|
|
{/* Tombol Kembali */}
|
|
<TouchableOpacity
|
|
style={styles.backButton}
|
|
onPress={() => navigation.goBack()}
|
|
>
|
|
<Ionicons name="arrow-back" size={28} color="#2D572C" />
|
|
</TouchableOpacity>
|
|
|
|
{/* Judul */}
|
|
<Text style={styles.title}>PENGADUAN</Text>
|
|
|
|
{/* Container Pengaduan */}
|
|
<ScrollView style={styles.pengaduanContainer}>
|
|
<View style={styles.pengaduanBox}>
|
|
<Text style={styles.pengaduanJudul}>{pengaduanData.judul}</Text>
|
|
<Text style={styles.pengaduanAlamat}>{pengaduanData.alamat}</Text>
|
|
<Text style={styles.pengaduanCatatan}>{pengaduanData.catatan}</Text>
|
|
<Text style={styles.pengaduanTanggal}>
|
|
Tanggal: {pengaduanData.tanggal}
|
|
</Text>
|
|
|
|
<Image
|
|
source={{ uri: pengaduanData.gambar }}
|
|
style={styles.buktiImage}
|
|
/>
|
|
|
|
{/* Profil Pelapor */}
|
|
<View style={styles.pelaporContainer}>
|
|
<Image
|
|
source={{ uri: pengaduanData.pelapor.profilGambar }}
|
|
style={styles.pelaporImage}
|
|
/>
|
|
<Text style={styles.pelaporNama}>{pengaduanData.pelapor.nama}</Text>
|
|
</View>
|
|
|
|
{/* Status Pengaduan */}
|
|
<View style={styles.statusContainer}>
|
|
<Text style={styles.statusText}>{pengaduanData.status}</Text>
|
|
|
|
{/* Jika Status Sedang Diproses */}
|
|
{pengaduanData.status === "Sedang Diproses" && (
|
|
<TouchableOpacity style={styles.kontribusiButton}>
|
|
<Text style={styles.kontribusiText}>Kontribusi</Text>
|
|
</TouchableOpacity>
|
|
)}
|
|
|
|
{/* Jika Status Sedang Diproses */}
|
|
{pengaduanData.status === "Sedang Diproses" && (
|
|
<Text style={styles.koinText}>Dapatkan Koin 300</Text>
|
|
)}
|
|
</View>
|
|
</View>
|
|
</ScrollView>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
padding: 16,
|
|
backgroundColor: "#fff",
|
|
},
|
|
backButton: {
|
|
marginBottom: 16,
|
|
},
|
|
title: {
|
|
fontSize: 22,
|
|
fontWeight: "bold",
|
|
color: "#2D572C",
|
|
marginBottom: 20,
|
|
textAlign: "center",
|
|
},
|
|
pengaduanContainer: {
|
|
flex: 1,
|
|
},
|
|
pengaduanBox: {
|
|
padding: 16,
|
|
backgroundColor: "#F8F8F8",
|
|
borderRadius: 8,
|
|
marginBottom: 20,
|
|
shadowColor: "#000",
|
|
shadowOpacity: 0.1,
|
|
shadowRadius: 5,
|
|
elevation: 3,
|
|
},
|
|
pengaduanJudul: {
|
|
fontSize: 18,
|
|
fontWeight: "bold",
|
|
color: "#333",
|
|
},
|
|
pengaduanAlamat: {
|
|
marginTop: 8,
|
|
fontSize: 14,
|
|
color: "#555",
|
|
},
|
|
pengaduanCatatan: {
|
|
marginTop: 8,
|
|
fontSize: 14,
|
|
color: "#555",
|
|
},
|
|
pengaduanTanggal: {
|
|
marginTop: 8,
|
|
fontSize: 14,
|
|
color: "#777",
|
|
},
|
|
buktiImage: {
|
|
marginTop: 16,
|
|
width: "100%",
|
|
height: 150,
|
|
borderRadius: 8,
|
|
},
|
|
pelaporContainer: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
marginTop: 16,
|
|
},
|
|
pelaporImage: {
|
|
width: 40,
|
|
height: 40,
|
|
borderRadius: 20,
|
|
},
|
|
pelaporNama: {
|
|
marginLeft: 12,
|
|
fontSize: 14,
|
|
fontWeight: "bold",
|
|
color: "#333",
|
|
},
|
|
statusContainer: {
|
|
marginTop: 16,
|
|
alignItems: "center",
|
|
},
|
|
statusText: {
|
|
fontSize: 16,
|
|
fontWeight: "bold",
|
|
color: "#FF6F61", // Bisa diganti dengan warna yang sesuai status
|
|
},
|
|
kontribusiButton: {
|
|
marginTop: 12,
|
|
backgroundColor: "#2D572C",
|
|
paddingVertical: 10,
|
|
paddingHorizontal: 20,
|
|
borderRadius: 8,
|
|
},
|
|
kontribusiText: {
|
|
color: "#fff",
|
|
fontWeight: "bold",
|
|
},
|
|
koinText: {
|
|
marginTop: 8,
|
|
fontSize: 12,
|
|
color: "#555",
|
|
},
|
|
});
|
|
|
|
export default PengaduanScreen;
|