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

Announcement Banner Fixes #725

Merged
merged 11 commits into from
Sep 9, 2020
Merged

Announcement Banner Fixes #725

merged 11 commits into from
Sep 9, 2020

Conversation

zstix
Copy link
Contributor

@zstix zstix commented Sep 8, 2020

Description

This addresses a few issues that are specific to the developer site when it comes to using the Announcement Banner:

  • Fixes an issue where Gatsby would try to create a new page for an announcement MDX file
  • Fixes an issue where the sidebar was appearing under the header when a banner was present

Reviewer Notes

I added a hook called useResizeObserver that uses ResizeObserver under the hood. This may be helpful in other locations. At the moment, it's just set up to work with height, but we can make it more generalized if we want.

Related Issue(s) / Ticket(s)

N/A

Screenshot(s)

With a Banner:
Screen Shot 2020-09-08 at 2 57 05 PM

Without a Banner:
Screen Shot 2020-09-08 at 2 57 15 PM

@jerelmiller
Copy link
Contributor

jerelmiller commented Sep 8, 2020

It looks like we may need to polyfill the ResizeObserver when building.

2020-09-08T22:08:45.576Z [INFO]: 5 |   const [height, setHeight] = useState(0);
                                 6 |
                                 >  7 |   const resizeObserver = new ResizeObserver((entries) => {
                                 |                          ^
                                 8 |     entries.forEach((entry) => {
                                 9 |       setHeight(entry.contentBoxSize.blockSize);
                                 10 |     });
                                 �[0m
                                 �[0m  �[0m�[97m�[41mWebpackError�[0m�[37m�[41m:�[0m�[37m�[41m �[0m�[97m�[41mReferenceError: ResizeObserver is not defined�[0m

@zstix
Copy link
Contributor Author

zstix commented Sep 9, 2020

I fixed the build issue with ResizeObserver but it looks like the build fails on some new functionality that comes from the AnnouncementBanner in the theme. Going to work on a fix there and then bump the version in this branch.

@zstix zstix merged commit e16d41a into main Sep 9, 2020
@zstix zstix deleted the zack/announcement-fixes branch September 9, 2020 20:53
@nr-opensource-bot
Copy link
Contributor

🎉 This PR is included in version 1.20.0 🎉

The release is available on GitHub release

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.

4 participants