|
@ -35,14 +35,12 @@ const SectionGridFeaturePlaces: FC<SectionGridFeaturePlacesProps> = ({ |
|
|
const { countries, tours } = useContext(Context); |
|
|
const { countries, tours } = useContext(Context); |
|
|
const [countryTours, setCountryTours] = useState(); |
|
|
const [countryTours, setCountryTours] = useState(); |
|
|
|
|
|
|
|
|
console.log(tours); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(()=>{ |
|
|
useEffect(()=>{ |
|
|
handleChange("All") |
|
|
handleChange("All") |
|
|
} , [tours , countries]) |
|
|
} , [tours , countries]) |
|
|
|
|
|
|
|
|
const handleChange = async (item) => { |
|
|
const handleChange = async (item) => { |
|
|
console.log(item , countries , tours); |
|
|
|
|
|
if (item ==="All"){ |
|
|
if (item ==="All"){ |
|
|
setCountryTours(tours.results); |
|
|
setCountryTours(tours.results); |
|
|
|
|
|
|
|
@ -52,11 +50,8 @@ const SectionGridFeaturePlaces: FC<SectionGridFeaturePlacesProps> = ({ |
|
|
(tour) => tour.destination_country === selected?.code |
|
|
(tour) => tour.destination_country === selected?.code |
|
|
); |
|
|
); |
|
|
setCountryTours(selectedTours); |
|
|
setCountryTours(selectedTours); |
|
|
console.log(selected); |
|
|
|
|
|
|
|
|
|
|
|
console.log(selectedTours);} |
|
|
|
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
console.log(countries); |
|
|
|
|
|
// const renderCard = (stay: StayDataType) => {
|
|
|
// const renderCard = (stay: StayDataType) => {
|
|
|
// let CardName = StayCard;
|
|
|
// let CardName = StayCard;
|
|
|
// switch (cardType) {
|
|
|
// switch (cardType) {
|
|
|