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

Modal component #35

Merged
merged 14 commits into from
Mar 18, 2024
Merged

Modal component #35

merged 14 commits into from
Mar 18, 2024

Conversation

hetd54
Copy link
Collaborator

@hetd54 hetd54 commented Mar 12, 2024

This PR does not include any file logic -- just the components needed for the visual of the download modal. Pressing "validate email" does nothing and is expected.

Added

Components

Custom Input
Custom Textarea
Download Modal

Tools / Config

Added react compatibility
Added Radix UI Dialog

Changed

The github actions need to enable web frameworks for firebase to deploy properly; see https://docs.astro.build/en/guides/deploy/google-firebase/

Therefore, I added the webframework env variables to both github actions.

Questions for Reviewers

Do we want any color here? Please throw out any design feedback!

What do we think about having the Submit button within the modal be a ghost button until the email is validated? Right now, the button just isn't there.

Copy link

github-actions bot commented Mar 12, 2024

Visit the preview URL for this PR (updated for commit c8ec35e):

https://mmp-site-b1c9b--pr35-inputs-modal-x3vlwrh9.web.app

(expires Tue, 19 Mar 2024 20:39:05 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4eb870c89e876f1812e204af417359065d2a23b1

@hetd54 hetd54 self-assigned this Mar 12, 2024
@hetd54 hetd54 linked an issue Mar 12, 2024 that may be closed by this pull request
@hetd54 hetd54 marked this pull request as ready for review March 12, 2024 18:41
Copy link
Contributor

@galenwinsor galenwinsor left a comment

Choose a reason for hiding this comment

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

Looks good! I hope Radix wasn't too difficult to work with. For the button question, I think having it disabled until the user has filled out the required fields would be good UX.

src/components/DownloadModal.tsx Show resolved Hide resolved
src/components/DownloadModal.tsx Outdated Show resolved Hide resolved
src/components/DownloadModal.tsx Outdated Show resolved Hide resolved
src/components/DownloadModal.tsx Outdated Show resolved Hide resolved
src/components/DownloadModal.tsx Outdated Show resolved Hide resolved
src/components/DownloadModal.tsx Outdated Show resolved Hide resolved
@hetd54 hetd54 requested a review from galenwinsor March 12, 2024 20:22
Copy link

@broarr broarr left a comment

Choose a reason for hiding this comment

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

This looks good to me!

Comment on lines +23 to +24
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
Copy link

Choose a reason for hiding this comment

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

Should these be dev dependencies? Or does astro want this stuff installed as a regular dependency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added these using "astro add" -- "Astro includes an astro add command to automate the setup of official integrations. "

They seem to want them as dependencies, although we could manually install them as dev dep if needed?

The docs: https://docs.astro.build/en/guides/integrations-guide/react/

Copy link

Choose a reason for hiding this comment

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

Let's not fight astro then. I guess if astro is building everything keeping things as dependencies doesn't really matter


return (
<Dialog.Root open={isOpen} onOpenChange={setIsOpen}>
<Dialog.Trigger asChild>
Copy link

Choose a reason for hiding this comment

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

asChild is crazy!

className="fixed top-0 left-0 right-0 bottom-0 bg-gray-500 bg-opacity-75 transition-opacity z-10 w-screen overflow-y-auto"
onClick={() => setIsOpen(false)}
/>
<Dialog.Overlay className="fixed top-0 left-0 right-0 bottom-0 grid place-items-center z-10 w-screen overflow-y-auto">
Copy link

Choose a reason for hiding this comment

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

Do you need the double overlay? Why are there two overlay siblings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In order to have a scrollable overlay, radix recommends moving the modal content within the overlay. I still wanted to be able to click on the overlay to be able to close the modal, which is where the first one on line 19 comes in.

Copy link

Choose a reason for hiding this comment

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

and you can't use the onClick handler on the overlay on 23?

<CustomTextarea label={"description"} placeholder={"Why you need this file"} />
</div>
<div className="flex flex-row gap-2">
<button className="flex items-center gap-2 rounded-lg px-5 py-2.5 bg-black text-white text-sm text-center font-medium hover:bg-gray-500 focus:ring-4 focus:outline-none focus:ring-gray-500">
Copy link
Contributor

Choose a reason for hiding this comment

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

One last thing, and this doesn't matter a lot until we have designs, but global styles like button styles should go in a global stylesheet so you're not repeating styles.

@hetd54 hetd54 requested a review from galenwinsor March 15, 2024 14:31
@hetd54 hetd54 merged commit 97f3699 into main Mar 18, 2024
2 checks passed
@hetd54 hetd54 deleted the inputs-modal branch March 18, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Modal Form
3 participants