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

fix:docs router path #4292

Merged
merged 1 commit into from
Nov 13, 2023
Merged

fix:docs router path #4292

merged 1 commit into from
Nov 13, 2023

Conversation

zjy365
Copy link
Contributor

@zjy365 zjy365 commented Nov 13, 2023

🤖 Generated by Copilot at be89da5

Summary

🖱️🌐🛠️

This pull request enhances the HomeHeader component for the website by improving its language switching and home page redirection features, refactoring and simplifying its code, and adding a cursor style to the language switcher icon. It affects the files docs/website/src/pages/components/Header/index.tsx, docs/website/src/pages/self-hosting/header/index.tsx, and docs/website/src/pages/self-hosting/header/index.scss.

HomeHeader changes
Language switcher more clear
Autumn of refactor

Walkthrough

  • Refactor the i18nMap object to use the defaultLocale and currentLocale values from the useDocusaurusContext hook in the HomeHeader component in both components/Header/index.tsx and self-hosting/header/index.tsx files (link, link)
  • Update the onClick handler for the logo image to use the defaultLocale and currentLocale values to construct the URL for redirecting to the home page in the HomeHeader component in both components/Header/index.tsx and self-hosting/header/index.tsx files (link, link)
  • Simplify the onClick handler for the language switcher icon to use the link property from the i18nMap object in the HomeHeader component in both components/Header/index.tsx and self-hosting/header/index.tsx files (link, link)
  • Add the cursor: pointer style to the .i18nIcon class in the header/index.scss file to improve the user experience by indicating that the language switcher icon is clickable (link)
  • Import the useLocation hook from @docusaurus/router to access the current location object in the HomeHeader component in the components/Header/index.tsx file. This is needed to construct the correct URL for switching languages and redirecting to the home page (link)

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Nov 13, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 981
✅ Successful 312
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 668
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Nov 13, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Nov 13, 2023

📘 Preview documentation website

👀 Visit Preview

Signed-off-by: jingyang <3161362058@qq.com>
@yangchuansheng yangchuansheng added this to the v5.0 milestone Nov 13, 2023
@yangchuansheng yangchuansheng merged commit c0492a1 into labring:main Nov 13, 2023
6 checks passed
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