Files
Users-Wrench/src/views/OffersInterestPage.jsx
T
2024-03-21 16:27:52 +01:00

29 lines
1.0 KiB
React

import React, { useContext, useState, useEffect } from "react";
// import BlogItem from "../components/Blogs";
import { useSelector } from "react-redux";
import OffersInterest from "../components/OffersInterest";
import usersService from "../services/UsersService";
export default function OffersInterestPage() {
const apiCall = new usersService()
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
let [offerInterestList, setOfferInterestList] = useState({loading: true, data: [], imgServer:''})
useEffect(()=>{
apiCall.offersInterestList().then(res => {
setOfferInterestList({loading: false, data: res.data.result_list, imgServer:res.data.session_image_server})
}).catch(err => {
setOfferInterestList({loading: false, data: [], imgServer:''})
console.log('Error: ', err)
})
},[])
return (
<>
<OffersInterest commonHeadData={commonHeadBanner.result_list} offerInterestList={offerInterestList} />
</>
);
}