Skip to content

Commit

Permalink
Merge pull request #150 from shivamk-21/main
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
sac-iiitnr authored Apr 15, 2024
2 parents 3df6c96 + 8d17284 commit 01d86ae
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions features/gallery/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import layerIcon from "../../assets/icon/icon_layer.svg";
import Button from "@mui/material/Button";
import Select, { SelectChangeEvent } from "@mui/material/Select";
import { ClubEvents } from "../../data/EventsAndGallery/GalleryData";
import { StaticImageData } from "next/image";

const StyledButton = styled(Button)({
fontFamily: "Rubik",
Expand Down Expand Up @@ -57,7 +58,13 @@ const Gallery = () => {
const [year, setYear] = useState("2023");
const [name, setName] = useState<Name>("major");
const [event, setEvent] = useState(
ClubEvents[name].filter((event: { year: string }) => event.year === year)[0]
(ClubEvents[name] as { name: string;
date?: string;
image: StaticImageData[];
club: string;
year: string; }[]).filter(
(event) => event.year === year
)[0]
);

const handleClickName = (name: Name) => {
Expand All @@ -66,7 +73,13 @@ const Gallery = () => {

const handleClickEvent = (index: number) => {
setEvent(
ClubEvents[name].filter((event: { year: string }) => event.year === year)[
(ClubEvents[name] as { name: string;
date?: string;
image: StaticImageData[];
club: string;
year: string; }[]).filter(
(event) => event.year === year
)[
index
]
);
Expand Down

0 comments on commit 01d86ae

Please sign in to comment.