Skip to content

Feature/events dashboard#58

Open
pxstachio wants to merge 6 commits into
mainfrom
feature/events-dashboard
Open

Feature/events dashboard#58
pxstachio wants to merge 6 commits into
mainfrom
feature/events-dashboard

Conversation

@pxstachio
Copy link
Copy Markdown
Contributor

events dashboard ordered by time, adding and editing events not implemented yet.

Copy link
Copy Markdown
Collaborator

@RLee64 RLee64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Just got some comments to address (mainly to do with synchronising with changes elsewhere).

export const DEFAULT_USER_ACTION = "SIGN UP";
export const DEFAULT_ADMIN_ACTION = "EDIT EVENT";

interface EventProps {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at #56 to see the new event data structure. Note that pricing isn't needed atm.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an extra footnote, no need to integrate with backend atm, just good to have some changes that makes the integration a bit smoother.

description: string;
memberPrice?: string;
nonMemberPrice?: string;
role?: "admin" | "user";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Role can now be retrieved using changes from #44

}) => {
const navigate = useNavigate();

// Format date: e.g. "2nd April - 6PM"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only relevant part of an event's datetime field field is the date, this means you should ignore any time portion.

<div className="event-image-container">
<ImageBlock
pageKey={imageUrl || DEFAULT_IMAGE}
role="user"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When merging main you'll notice the role="user" is no a valid field for the component

<hr className="event-divider" />

<button className="rsvp-button" onClick={handleActionClick}>
{role === "admin" ? DEFAULT_ADMIN_ACTION : DEFAULT_USER_ACTION}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless if a user is admin or a user, they should still be taken to the event page, so no need to display user-dependent text.


<hr className="event-divider" />

<button className="rsvp-button" onClick={handleActionClick}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSVP isn't the best name for this css class, it's just a redirect button


const Events = () => {
return <div>Events page - not yet implemented</div>;
const isAdmin = true; // Hardcoded admin for now
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to hardcode admin anymore

import eventsData from "../placeholders/events.json";
import { Link } from "react-router-dom";

const PAGE_TITLE_1 = "Upcoming Events";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to declare these headings as constants, they aren't magic numbers/strings so slapping them in is okay 👍

<div className="event-dashboard">
{isAdmin && (
<Link
to="/Events" //add editing at some point
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the //add editing comment isn't needed, editing occurs on the event page itself, not on the events dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants