-
-
Notifications
You must be signed in to change notification settings - Fork 200
feat(theme): add Banner Component #2654
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
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new Banner component to the theme system, replacing the previous Announcement component with a more flexible and integrated solution. The Banner component includes persistent dismissal via storage, customizable content, and proper height integration with the navigation system.
Key Changes:
- Adds a new
Bannercomponent with storage-based dismissal functionality and dynamic height calculation - Updates all layout styles to account for banner height using CSS custom properties
- Replaces the external
Announcementcomponent with the newBannerin the website theme
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/theme-default/src/components/Banner/index.tsx | Implements new Banner component with forwardRef, storage management, and dynamic height tracking |
| packages/theme-default/src/components/Banner/index.scss | Adds styling for banner with gradient background and close button |
| packages/theme-default/src/logic/mergeRefs.ts | Utility function to merge multiple React refs |
| packages/theme-default/src/index.ts | Exports new Banner component and mergeRefs utility |
| website/theme/index.tsx | Replaces Announcement component with Banner and removes NoSSR wrapper |
| packages/theme-default/src/layout/DocLayout/index.scss | Updates layout calculations to include banner height |
| packages/theme-default/src/components/Nav/index.scss | Adjusts nav positioning to account for banner |
| packages/theme-default/src/components/NavScreen/index.scss | Updates screen positioning for banner height |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
feat(theme): add Banner Component
Related Issue
Checklist