hangforever / hangzone-frontend

An app that enables hangers all over the world to discover and share zones in which to hang ;)
GNU Affero General Public License v3.0
1 stars 0 forks source link

Reusable modal component #42

Closed scootyboots closed 3 years ago

scootyboots commented 4 years ago

Description

A component which is just a modal that received the content of the modal as props. That way we can reuse it throughout the app. Should be able to extract the modal functionality from the NewZone component.

Functionality to anchor the modal to the bottom, middle, or top

What issue does this address? (if any)

closes #38

scootyboots commented 4 years ago

This doesn't work at all yet, but wanted to get the PR made

aburd commented 4 years ago

@scootyboots Did you check the PR I made? It may be better to branch off of there.

scootyboots commented 4 years ago

@aburd I changed the default behavior of the modal to center vertically in the middle of the screen and allow for the hight to expand to fit its content until 90vh.

I added modifier classes --top and --bottom which will anchor the content of the modal if passed as a prop.

maxHeight prop can also be passed if you want to prevent the modal from taking up too much screen real estate.

I think this is pretty good for now. There's definitely more functionality we could have for it, but I figure we can make new modal components or change this one in the future if we find it's not flexible enough.

scootyboots commented 4 years ago

@aburd I realized it seems silly to have a max height prop and not also a max width prop. It's the only thing I've added, but would you wanna take another look before I merge this guy?