import { Text, View, Image, Pressable } from ‘react-native’;
import React, {useEffect, useState} from ‘react’;
import { gStyle } from ‘…/styles/style’;
import { firebase } from ‘…/Firebase/firebase’;
import ‘firebase/compat/firestore’;

export default function Sale() {
const [salesData, setSalesData]=useState([]);

useEffect(()=>{
const fetchSalesData=async()=>{
try{
const salesCollection = firebase.firestore().collection(‘Sale’);
const snapshot=await salesCollection.get();
const data = snapshot.docs.map((doc)=>({id:doc.id, … doc.data}));
setSalesData(data);
}catch(error){
console.log('Ошибка: ', error);
}
};
fetchSalesData();
},[]);
return (
<View style={gStyle.SalesMain}>
<Text style={gStyle.header}>Скидки</Text>
{salesData.map((sale)=>(
<View key={sale.id} style={gStyle.SalesBanner}>
<Text style={gStyle.SalesInfo}>
{sale.name}
</Text>
<Image
source={{uri:sale.image}}
style={gStyle.SalesImg}
/>
<Pressable style={gStyle.SalesChoose} link>
<Text style={gStyle.SalesBtnChoose}>Выбрать</Text>
</Pressable>
<Text style={gStyle.SalesLine}></Text>
</View>
))}

</View>
);
}

there is no info just a button