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

Peter/feat modal component #319

Merged
merged 15 commits into from
Jun 14, 2022
Merged

Peter/feat modal component #319

merged 15 commits into from
Jun 14, 2022

Conversation

peterslany
Copy link
Contributor

@peterslany peterslany commented Jun 6, 2022

Adds the Modal component to the component library:

  • when open prop passed to it is true modal opens, when set to false modal closes
  • onClose callback is called when there is click outside the modal, close button is clicked or Escape key is pressed
  • 100ms animation on open and close
  • added Icon component that is used for close button - this allows easy change of the close icon to another icon

This PR also adds Portal component and custom hook to delay unmounting of the component in order to animate the closing of the modal.

image

@vercel
Copy link

vercel bot commented Jun 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
interbtc-ui-interlay ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 0:31AM (UTC)
interbtc-ui-interlay-testnet ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 0:31AM (UTC)
interbtc-ui-kintsugi ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 0:31AM (UTC)
interbtc-ui-kintsugi-testnet ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 0:31AM (UTC)
interbtc-ui-testnet ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 0:31AM (UTC)

@github-actions
Copy link

github-actions bot commented Jun 9, 2022

Running Lighthouse audit...

Copy link
Collaborator

@tomjeatt tomjeatt left a comment

Choose a reason for hiding this comment

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

Hi Peter - overall looks really good :) nice solution. A few comments, let me know if you want to talk anything through.

src/componentLibrary/Icon/Icon.tsx Outdated Show resolved Hide resolved
src/componentLibrary/Icon/Icon.stories.tsx Outdated Show resolved Hide resolved
src/componentLibrary/theme/theme.ts Outdated Show resolved Hide resolved
src/parts/Portal/index.tsx Outdated Show resolved Hide resolved
src/parts/Portal/index.tsx Outdated Show resolved Hide resolved
src/parts/Portal/index.tsx Outdated Show resolved Hide resolved
src/utils/hooks/use-mount-transition.ts Outdated Show resolved Hide resolved
src/utils/hooks/use-mount-transition.ts Show resolved Hide resolved
src/utils/hooks/use-mount-transition.ts Show resolved Hide resolved
src/utils/hooks/use-mount-transition.ts Outdated Show resolved Hide resolved
@peterslany
Copy link
Contributor Author

Hi Peter - overall looks really good :) nice solution. A few comments, let me know if you want to talk anything through.

Hello @tomjeatt. Thanks for the thorough review :) I handled your comments, so feel free to re-review 👍

Copy link
Collaborator

@tomjeatt tomjeatt left a comment

Choose a reason for hiding this comment

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

Look great :) thanks Peter

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.

None yet

2 participants