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

Create popover component #123

Merged
merged 14 commits into from
Oct 5, 2020
Merged

Create popover component #123

merged 14 commits into from
Oct 5, 2020

Conversation

bramvanhoutte
Copy link
Contributor

Closes #70

@bramvanhoutte bramvanhoutte self-assigned this Oct 4, 2020
@codecov
Copy link

codecov bot commented Oct 4, 2020

Codecov Report

Merging #123 into master will increase coverage by 0.47%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
+ Coverage   97.51%   97.98%   +0.47%     
==========================================
  Files          18       22       +4     
  Lines         241      298      +57     
  Branches       43       51       +8     
==========================================
+ Hits          235      292      +57     
  Misses          6        6              
Impacted Files Coverage Δ
src/components/Button/Button.tsx 100.00% <100.00%> (ø)
src/components/Menu/Menu.tsx 100.00% <100.00%> (ø)
src/components/Menu/MenuItem/MenuItem.tsx 100.00% <100.00%> (ø)
src/components/Popover/Popover.tsx 100.00% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/utils/hooks/useOutsideClick.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b38f894...737d02b. Read the comment docs.

);
const { asFragment, getByTestId } = render(component);

await waitFor(() => getByTestId('menu-item-default'));
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to write it without await waitFor()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it complains about an update that has to be wrapped in "act"

onClose();
}, menuRef);

const { styles: popperStyles, attributes } = usePopper(divRef.current, menuRef.current, {
Copy link
Member

Choose a reason for hiding this comment

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

wat een ref sletje die usePopper 😀

@@ -0,0 +1,17 @@
import React, { useEffect } from 'react';

export const useOutsideClick = (callback: Function, elementRef: React.RefObject<any>) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nice steal 😀. I also used this a week ago at work

@bramvanhoutte bramvanhoutte merged commit 2e44f60 into master Oct 5, 2020
@bramvanhoutte bramvanhoutte deleted the dropdown-component branch October 5, 2020 17:25
@github-actions
Copy link

github-actions bot commented Oct 5, 2020

🎉 This PR is included in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement dropdown component
2 participants