Skip to content

Commit

Permalink
🔥 Changes Required : work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
roniy68 committed Jun 22, 2023
1 parent 80df007 commit fac2c3a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/javascript/components/fragments/navigation/Cars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const Cars = () => {
const [currentIndex, setCurrentIndex] = React.useState(0);
const location = useLocation();
const [message, setMessage] = React.useState(location?.state?.message || "");
const Navigate = useNavigate();

useEffect(() => {
dispatch(fetchCars());
Expand Down Expand Up @@ -45,7 +44,7 @@ const Cars = () => {
const startIndex = currentIndex;
const endIndex = startIndex + 2;
return cars.slice(startIndex, endIndex + 1).map((car) => (
<li key={car.id} className="w-[400px] h-[400px] mt-10 shadow">
<li key={car.id} className="w-auto h-auto lg:w-[400px] lg:h-[400px] mt-10 shadow">
<Link to={`/detail/${car.id}`}>
<img
src={car.photo}
Expand Down Expand Up @@ -78,7 +77,9 @@ const Cars = () => {
}

return (
<div className="h-screen w-full">

<div className="bg-green-900 h-auto w-auto">

{message && (
<p className="text-center text-green-600 text-2xl">{message}</p>
)}
Expand All @@ -97,7 +98,7 @@ const Cars = () => {
>
<BsCaretLeft size={50} className="text-white" />
</button>
<ul className="bg-red-500 lg:w-[800px] flex-1 flex justify-center items-center m-0">
<ul className=" lg:w-[800px] gap-4 flex-1 flex justify-center items-center">
{renderCars()}
</ul>
<button
Expand All @@ -108,6 +109,8 @@ const Cars = () => {
<BsCaretRight size={50} className="text-white" />
</button>
</div>


</div>
);
};
Expand Down

0 comments on commit fac2c3a

Please sign in to comment.