web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.36k stars 120 forks source link

feat(theme-default): sync tab choices #1018

Closed shulaoda closed 5 months ago

shulaoda commented 5 months ago

Summary

[Feature]: Syncing PackageManagerTabs and Tabs Choices

Related Issue

closes: #937

Checklist

netlify[bot] commented 5 months ago

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
Latest commit 195db705724d827b9812ce5a8f00c50c4b3ce6dc
Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/662b21023af9d60008fa7fc0
Deploy Preview https://deploy-preview-1018--aquamarine-blini-95325f.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 84 (🔴 down 8 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

Timeless0911 commented 5 months ago

We have a useStorageValue hook, can you reuse it for your browser judgement and localStorage get/set logic?

https://github.com/web-infra-dev/rspress/blob/89e1c212d47c5a7c3c18987e5c47a9b672d0c119/packages/theme-default/src/logic/useStorageValue.ts#L6-L42

And also the item key rspress.tabs can be stored as a CONST and use this const as prefix in code logic, thus reducing maintenance costs~

Timeless0911 commented 5 months ago

LGTM