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

add SignupPopover to learning resource drawer bookmark button #1565

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

gumaerc
Copy link
Contributor

@gumaerc gumaerc commented Sep 16, 2024

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/5505

Description (What does it do?)

This PR adds some functionality that was missed in #1537. If you are logged out, the bookmark button should still show in the learning resource drawer. When clicking this button, the same "signup popover" that shows when you click the bookmark button on the card show show.

Screenshots (if appropriate):

image
image

How can this be tested?

  • Spin up this branch of mit-learn
  • Make sure you have at least a few learning resources in your database
  • Open an incognito window or log out
  • Visit the search page
  • Click on any result to open the learning resource drawer
  • Within the drawer, click the bookmark button
  • You should see a popover as seen in the screenshots above
  • Click "Sign Up"
  • Log in or create a new account
  • Verify that you are returned to the page with the learning resource drawer open, and you can now click the bookmark button and add the resource to a list

@gumaerc gumaerc added the Needs Review An open Pull Request that is ready for review label Sep 16, 2024
@shanbady shanbady self-requested a review September 17, 2024 13:35
@shanbady shanbady self-assigned this Sep 17, 2024
Copy link
Contributor

@shanbady shanbady left a comment

Choose a reason for hiding this comment

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

works well. left some minor nitpicks. it would be good to resolve the redundant code issue if possible but not a blocker

@@ -124,6 +134,7 @@ const ResourceListCard: React.FC<ResourceListCardProps> = ({
condensed,
...props
}) => {
const loc = useLocation()
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like there is a lot of redundancy between ResourceCard and ResourceListCard that could potentially be abstracted/consolidated.

@@ -86,6 +87,10 @@ const Certificate = styled.div`
height: 16px;
}
`
// The SignupPopover needs to display over the top of the resource drawer
const StyledSignupPopover = styled(SignupPopover)({
zIndex: 9999,
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be good to avoid the hardcoded zIndex if at all possible (realizing this might be the only workaround for now)

@shanbady shanbady assigned gumaerc and unassigned shanbady Sep 17, 2024
@shanbady shanbady added Waiting on author and removed Needs Review An open Pull Request that is ready for review labels Sep 17, 2024
…me to the default mui value for the drawer, then take that value plus one for popover
@gumaerc
Copy link
Contributor Author

gumaerc commented Sep 17, 2024

@shanbady Thanks for the review. I've addressed your two concerns above.

@gumaerc gumaerc merged commit c7ebcf6 into main Sep 17, 2024
11 checks passed
@shanbady shanbady deleted the cg/logged-out-drawer-bookmark-button branch September 17, 2024 15:47
@odlbot odlbot mentioned this pull request Sep 18, 2024
13 tasks
This was referenced Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants