Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events Details Page #36

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
Prev Previous commit
FIX: Card Render
  • Loading branch information
31adityakumar committed Apr 21, 2023
commit 8192bdfb2ca30811b67d9f215e1338357805befa
19 changes: 17 additions & 2 deletions src/Components/Event/Event.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import styles from "./Event.module.scss";
import EventCard from "../EventCard/EventCard";
import Data from "../../Data/EventCardData.json";
const evCard = Data.cardDataArray;

const Event = ({ data }) => {
const Event = ({ data, selected }) => {
return (
<section className={styles.event}>
<div className={styles.left} key={data.id}>
@@ -129,7 +131,20 @@ const Event = ({ data }) => {
</div>
<div className={styles.right}>
<h3>Other Events</h3>
<EventCard />
{evCard
.slice(0, selected)
.concat(evCard.slice(selected + 1))
.map((item) => (
<EventCard
key={item.id}
size="small"
id={item.id}
content={item.content}
title1={item.title1}
title2={item.title2}
image={item.image}
/>
))}
</div>
</section>
);
2 changes: 1 addition & 1 deletion src/Pages/EventPage/EventPage.jsx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ const EventPage = () => {
const ind = parseInt(eventID.id, 10);

if (ind > 0 && ind <= EventData.length) {
return <Event data={EventData[ind - 1]} />;
return <Event data={EventData[ind - 1]} selected={ind - 1} />;
}
return <div>Error Page</div>;
};