-
Notifications
You must be signed in to change notification settings - Fork 2
Event popup #11
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
Open
JCSnap
wants to merge
7
commits into
main
Choose a base branch
from
add-event-popup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Event popup #11
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac22c7c
Added EventPopup under components to display events with a popup window
JCSnap e80515e
removed accidental changed made to Navbar.tsx
JCSnap 35abd40
Update EventPopup.tsx
JCSnap e956010
Edited based on comments
JCSnap 725b5ea
Merge branch 'add-event-popup' of https://github.com/rhdevs/rh-supera…
JCSnap 1f2053b
Merge branch 'main' into add-event-popup
JCSnap a25d825
1. Added border to Popup container
JCSnap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,85 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| import { useState } from 'react' | ||||||||||||||||||||||||||||||||||||||||||||||
| import styled from 'styled-components' | ||||||||||||||||||||||||||||||||||||||||||||||
| import image from 'next/image' | ||||||||||||||||||||||||||||||||||||||||||||||
| import SignUpButton from './SignUpButton' | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const EventPopupContainer = styled.div` | ||||||||||||||||||||||||||||||||||||||||||||||
| position: absolute; | ||||||||||||||||||||||||||||||||||||||||||||||
| background-color: white; | ||||||||||||||||||||||||||||||||||||||||||||||
| padding: 20px; | ||||||||||||||||||||||||||||||||||||||||||||||
| margin: 100px 20% 0px; | ||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 10px; | ||||||||||||||||||||||||||||||||||||||||||||||
| box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75); | ||||||||||||||||||||||||||||||||||||||||||||||
| @media (max-width: 500px) { | ||||||||||||||||||||||||||||||||||||||||||||||
| // left right margin smaller for phone users | ||||||||||||||||||||||||||||||||||||||||||||||
| margin: 100px 10% 0px; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| ` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const CloseButton = styled.button` | ||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 50%; | ||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||
| margin-left: auto; | ||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #595959; | ||||||||||||||||||||||||||||||||||||||||||||||
| color: white; | ||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||||||||||||||||||||||||||||||
| &:hover { | ||||||||||||||||||||||||||||||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| ` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const PopupImage = styled(image)` | ||||||||||||||||||||||||||||||||||||||||||||||
| display: block; | ||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 10px; | ||||||||||||||||||||||||||||||||||||||||||||||
| height: 70%; | ||||||||||||||||||||||||||||||||||||||||||||||
| width: 70%; | ||||||||||||||||||||||||||||||||||||||||||||||
| max-height: 70%; | ||||||||||||||||||||||||||||||||||||||||||||||
| max-width: 70%; | ||||||||||||||||||||||||||||||||||||||||||||||
| margin: 0 auto; | ||||||||||||||||||||||||||||||||||||||||||||||
| padding-top: 30px 0 50px; | ||||||||||||||||||||||||||||||||||||||||||||||
| ` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const PopupTitle = styled.h1` | ||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 24px; | ||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||||||||||||||||||||||||||||||
| color: black; | ||||||||||||||||||||||||||||||||||||||||||||||
| ` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const PopupContent = styled.p`` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| type Props = { | ||||||||||||||||||||||||||||||||||||||||||||||
| image: string | ||||||||||||||||||||||||||||||||||||||||||||||
| title: string | ||||||||||||||||||||||||||||||||||||||||||||||
| content: string | ||||||||||||||||||||||||||||||||||||||||||||||
| isActive: boolean | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||
| * @returns A popup that displays the event details and sign up button | ||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| function EventPopup(props: Props) { | ||||||||||||||||||||||||||||||||||||||||||||||
| const [isActive, setIsActive] = useState(true) | ||||||||||||||||||||||||||||||||||||||||||||||
| const closePopup = () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| setIsActive(false) | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||
| <div> | ||||||||||||||||||||||||||||||||||||||||||||||
| {isActive && ( | ||||||||||||||||||||||||||||||||||||||||||||||
| <EventPopupContainer> | ||||||||||||||||||||||||||||||||||||||||||||||
| <CloseButton onClick={closePopup}>x</CloseButton> | ||||||||||||||||||||||||||||||||||||||||||||||
| <PopupImage src={props.image} alt="Event Image" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <PopupTitle>{props.title}</PopupTitle> | ||||||||||||||||||||||||||||||||||||||||||||||
| <PopupContent>{props.content}</PopupContent> | ||||||||||||||||||||||||||||||||||||||||||||||
| <SignUpButton /> | ||||||||||||||||||||||||||||||||||||||||||||||
| </EventPopupContainer> | ||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+71
to
+81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if outermost div is not styled (i.e. dummy div), then can just use a blank tag |
||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| export default EventPopup | ||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import styled from 'styled-components' | ||
|
|
||
| const StyledButton = styled.button` | ||
| display: flex; | ||
| background-color: #d9d9d9; | ||
| color: black; | ||
| font-weight: 600; | ||
| padding: 10px; | ||
| border-width: 0px; | ||
| margin: 50px 0px 0px auto; | ||
| &:hover { | ||
| cursor: pointer; | ||
| border: 1px solid black; | ||
| background-color: white; | ||
| color: black; | ||
| } | ||
| ` | ||
|
|
||
| function handleSignUp() { | ||
| // TODO: Implement sign up functionality | ||
| } | ||
|
|
||
| function SignUpButton() { | ||
| return <StyledButton onClick={handleSignUp}>Sign Up Here</StyledButton> | ||
| } | ||
|
|
||
| export default SignUpButton |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ok good! but can follow the format here? https://www.notion.so/How-To-Frontend-Documentation-390a6a02b00d4eb59fd7fa9563025885