Skip to content

Conversation

@SoonIter
Copy link
Member

Summary

feat(theme): add Banner Component

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 14, 2025 07:37
@netlify
Copy link

netlify bot commented Oct 14, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 33147b5
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/68ee04352aee1e000854df66
😎 Deploy Preview https://deploy-preview-2654--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a 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 Banner component 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 Announcement component with the new Banner in 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.

@SoonIter SoonIter requested a review from Timeless0911 October 14, 2025 10:45
@Timeless0911 Timeless0911 merged commit 167ea07 into main Oct 14, 2025
8 checks passed
@Timeless0911 Timeless0911 deleted the syt/feat-announcement branch October 14, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants