Skip to content

Commit

Permalink
Deleted unused variables and added alt to picture
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianoNeimark committed Nov 1, 2023
1 parent 9913129 commit 171ffb2
Showing 1 changed file with 4 additions and 44 deletions.
48 changes: 4 additions & 44 deletions src/components/sections/upcoming_events.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
import React from "react";
import usePaging from "../../hooks/usePaging";
import useWindowDimensions from "../../hooks/useWindowDimensions";
import { motion } from "framer-motion";

// Translations
import i18n from "../../i18n/index.js";

import upcomingEvents from "../../data/upcoming_events.json";

//Icons
import Icon from "@mdi/react";
import { mdiChevronLeft, mdiChevronRight } from "@mdi/js";

// Components
const Section = React.lazy(() => import("../section"));
const LinkButton = React.lazy(() => import("../link_button"));

// Below screen 800px, this is the width
const baseCardWidth = 335;

function UpcomingEvents() {
// As cards are dynamic in width, the width for the hook needs to adapt
// At 800px cards stop getting smaller, 335px is the limit
const { width } = useWindowDimensions();
// Define the limit using the padding
const cardWidth = width >= 800 ? (width - 100) / 2 : baseCardWidth;
const [page, handleLeftClick, handleRightClick, pageLimit, limitLeft] =
usePaging(cardWidth, upcomingEvents, 1);

return (
<Section
id="upcoming-events"
Expand All @@ -49,7 +35,8 @@ function UpcomingEvents() {

<img
className='h-62 w-46 object-contain'
src="https://www.protocoloimep.com/app/uploads/2018/11/que-es-un-evento.jpg"
src="https://www.protocoloimep.com/app/uploads/2018/11/que-es-un-evento.jpg"
alt="event"
/>


Expand All @@ -68,33 +55,6 @@ function UpcomingEvents() {
);
})}
</div>

{/* <div className="flex flex-row w-full items-center justify-center">
<button
disabled={page === 0}
onClick={handleLeftClick}
className={
"focus:outline-none mr-4 rounded-full bg-light " +
(page === 0
? "opacity-50"
: "transition duration-150 hover:text-brand_primary")
}
>
<Icon path={mdiChevronLeft} size={3} />
</button>
<button
disabled={page >= pageLimit}
onClick={handleRightClick}
className={
"focus:outline-none rounded-full bg-light " +
(page >= pageLimit
? "opacity-50"
: "transition duration-150 hover:text-brand_primary")
}
>
<Icon path={mdiChevronRight} size={3} />
</button>
</div> */}
</Section>
);
}
Expand Down

0 comments on commit 171ffb2

Please sign in to comment.