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

Update query parameters handling and fix theme application on share page #30

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

zryyyy
Copy link
Contributor

@zryyyy zryyyy commented Mar 3, 2025

  1. Theme Validation Improvement

    • Refactored the theme validation logic in SharePage.tsx by replacing the findIndex check with a more concise Array.some check.
    • This change ensures that if the query parameter for the theme does not match any of the valid themes (from THEME_PRESETS), the default theme is correctly applied.
  2. New Query Parameters

    • Added support for two new query parameters: showSafariHeader and showAttribution.
    • These parameters control the visibility of the Safari header and attribution on the share page.
    • They default to true unless explicitly set to 'false' in the URL query string.
    • Updated the ShareButton.tsx component to include these parameters in the generated share URL when their corresponding settings are false.
  3. Styling Fixes

    • Addressed previous issues where the theme parameter was not applied correctly, which led to styling inconsistencies on the share page.
  4. Chores
    Closes Bump next from 14.1.0 to 14.1.1 #26 Bump braces from 3.0.2 to 3.0.3 #27 (had been fixed in pr Add Safari header toggle, update dependencies, and improve styles #29)

- Fixed the issue where the theme parameter passed to the share page wasn't being applied.
- Addressed styling inconsistencies related to theme display on the share page.
- Use `some` instead of `findIndex` to check for a valid theme
- Add `showSafariHeader` and `showAttribution` query parameters
- Default values for `showSafariHeader` and `showAttribution` are set to true unless explicitly specified as 'false'
Copy link

netlify bot commented Mar 3, 2025

👷 Deploy request for green-wall-x pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6beecfc

@zryyyy
Copy link
Contributor Author

zryyyy commented Mar 3, 2025

这个 pr 改动还是比较小的,我觉得可以直接合,剩下的 bug 我应该在下一个 pr 里修

@Codennnn Codennnn merged commit cc6e293 into Codennnn:main Mar 3, 2025
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.

2 participants