import React, { useState } from "react";
import {
Modal,
View,
Text,
StyleSheet,
TextInput,
TouchableOpacity,
Image,
Pressable,
FlatList,
ScrollView,
} from "react-native";
import { Ionicons } from "@expo/vector-icons";
import FontAwesome5 from "@expo/vector-icons/FontAwesome5";
const reviews = [
{
id: "1",
name: "Dino",
time: "10:00pm 20/02/2025",
title: "Laptop Gaming Asus ROG 16GB",
content:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
images: [
require("../../../assets/images/small-product-detail.png"),
require("../../../assets/images/small-product-detail.png"),
require("../../../assets/images/small-product-detail.png"),
],
star: 5,
},
{
id: "2",
name: "Dino",
time: "10:00pm 20/02/2025",
title: "Laptop Gaming Asus ROG 16GB",
content:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
images: [
require("../../../assets/images/small-product-detail.png"),
require("../../../assets/images/small-product-detail.png"),
],
star: 4,
},
];
const renderStars = (count: number) => {
return (
{Array.from({ length: 5 }).map((_, index) => (
))}
);
};
type Props = {
visible: boolean;
onClose: () => void;
};
const ListReview = ({ visible, onClose }: Props) => {
return (
{/* Title */}
Đánh giá sản phẩm
(102 đánh giá)
item.id}
renderItem={({ item }) => (
{item.name}
{item.time}
{renderStars(item.star)}
{item.title}
{item.content}
{item.images.map((img, index) => (
))}
Bình luận (23)
Thích (23)
)}
/>
);
};
export default ListReview;
const styles = StyleSheet.create({
overlay: {
flex: 1,
backgroundColor: "#00000080",
justifyContent: "center",
alignItems: "center",
},
container: {
width: "95%",
backgroundColor: "white",
borderRadius: 12,
padding: 15,
maxHeight: "90%",
},
header: {
flexDirection: "row",
justifyContent: "space-between",
borderBottomWidth: 1,
borderColor: "#E4E4E4",
paddingBottom: 15,
},
headerText: {
fontSize: 20,
fontWeight: "bold",
textAlign: "center",
flex: 1,
},
closeBtn: {
fontSize: 22,
color: "#808080",
},
headerNote: {
paddingLeft: 5,
fontWeight: 400,
},
reviewItem: {
marginTop: 10,
paddingTop: 10,
paddingBottom: 10,
marginBottom: 10,
borderBottomWidth: 1,
borderBottomColor: "rgba(228, 228, 228, 1)",
},
avatarBox: {
flexDirection: "row",
alignContent: "center",
width: "100%",
alignItems: "center",
marginRight: 20,
},
avatar: {
width: 30,
height: 30,
borderRadius: 40,
marginRight: 10,
},
name: {
fontWeight: "bold",
marginRight: 10,
},
time: {
fontSize: 12,
textAlign: "center",
},
reviewContent: {
flex: 1,
},
title: {
fontWeight: "600",
marginBottom: 5,
},
contentText: {
marginBottom: 5,
},
imageList: {
flexDirection: "row",
marginBottom: 10,
},
reviewImage: {
width: 80,
height: 80,
marginRight: 10,
},
btnRow: {
flexDirection: "row",
},
btnLink: {
color: "#1877F2",
marginRight: 15,
},
star: {
fontSize: 16,
},
black: {
color: "#000",
},
});