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

Fix::Submit Feedback Button On Event Page #154

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions src/components/EventPageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EventPageClient = ({ eventsId }: { eventsId: string }) => {

setIsRegistrationOpen(
currentDate >= registrationStartDate &&
currentDate <= registrationEndDate
currentDate <= registrationEndDate
);
}
}, [eventData]);
Expand Down Expand Up @@ -160,7 +160,7 @@ const EventPageClient = ({ eventsId }: { eventsId: string }) => {

const img =
eventData[0]?.event_images?.[0]?.url &&
typeof eventData[0].event_images[0].url === "string"
typeof eventData[0].event_images[0].url === "string"
? JSON.parse(eventData[0].event_images[0].url)
: []; // Default to an empty array if no valid URL

Expand Down Expand Up @@ -329,13 +329,12 @@ const EventPageClient = ({ eventsId }: { eventsId: string }) => {
<div>
<Button
variant="outline"
className={`w-full transition-transform duration-300 ease-in-out transform ${
registrationClosed ||
className={`w-full transition-transform duration-300 ease-in-out transform ${registrationClosed ||
isRegistered ||
!isRegistrationOpen
? "opacity-50 cursor-not-allowed"
: "hover:scale-105"
}`}
? "opacity-50 cursor-not-allowed"
: "hover:scale-105"
}`}
disabled={
registrationClosed ||
isRegistered ||
Expand All @@ -353,10 +352,10 @@ const EventPageClient = ({ eventsId }: { eventsId: string }) => {
</Button>
</div>
<div>
{isRegistered ? (
<Link href={`${event.event_formlink}`}>
{isRegistered && eventEnded ? (
<Link href={eventFeedbackLink}>
<Button variant="outline" className="w-full">
Actual Form Link
Submit Feedback
</Button>
</Link>
) : null}
Expand All @@ -367,10 +366,10 @@ const EventPageClient = ({ eventsId }: { eventsId: string }) => {
onClick={
isRegistered
? () =>
window.open(
createGoogleCalendarLink(event),
"_blank"
)
window.open(
createGoogleCalendarLink(event),
"_blank"
)
: undefined
}
disabled={!isRegistered}
Expand Down