-
Notifications
You must be signed in to change notification settings - Fork 27
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
feature/share-event-page #149
feature/share-event-page #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good! I have a single question but otherwise ready for merge.
src/pages/EventPage/EventPage.tsx
Outdated
return [s, t].map((el) => { | ||
if (el !== null && typeof el === "string") { | ||
const n = parseFloat(el); | ||
return isNaN(n) ? 0 : n; | ||
} else { | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only question for the whole pull request is "what happens if someone shares url?s=1
will that route to session 1 and default to 0 seconds? AND vice-versa, if someone only shares the seconds url?t=100
will that default to session=0?
I think this is the code block that does that but just want to make sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shares url?s=1 will that route to session 1 and default to 0 seconds?
Yes, but s=1 will route to the second session (s starts at 0).
shares the seconds url?t=100 will that default to session=0?
Yes
This only happens if the user alters the shareable URL though. The generated shareable URL will contain s
and t
(if start at checkbox is checked and t>0)
Link to Relevant Issue
This pull request resolves #95
Description of Changes
Add a share button to generate a shareable URL for an event, with optional query parameters for the current session and user-selected timepoint.
This is mostly a copy of the original functionality with some changes to make it type-safe and add the current session to the shareable URL.
Screenshots
(share button)
(modal)