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 useMenu.tsx #47921

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Durgesh4993
Copy link

@Durgesh4993 Durgesh4993 commented Mar 17, 2024

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

This alternative version of the useMenu hook refactors the code by:

  • Consolidating imports from 'antd'.
  • Refactoring the structure and logic within the hook for better readability and maintainability.
  • Using functions like processMenuItem and processGroup to handle the transformation of sidebar items into menu items.
  • Simplifying the conditional logic for manipulating sidebar items based on the current pathname.
  • Correcting the replacement of 'VERSION' with 'version' in the ItemTag component.

These changes aim to make the code cleaner, more organized, and easier to understand. However, the effectiveness of these modifications may depend on the specific requirements and context of your project.

📝 Changelog

Language Changelog
🇺🇸 English +
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Signed-off-by: Durgesh kumar prajapati <98798977+Durgesh4993@users.noreply.github.com>
Copy link

stackblitz bot commented Mar 17, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Mar 17, 2024

Preview is ready

Copy link
Contributor

github-actions bot commented Mar 17, 2024

👁 Visual Regression Report for PR #47921 Passed ✅

🎯 Target branch: master (3e44b46)
📖 View Full Report ↗︎

🎊 Congrats! No visual-regression diff found.

Copy link
Contributor

  • 🚨 Please fill changelog in the PR

    • Write with a developer-oriented perspective and narrative method, without describing the details of the repair
    • Describing the problem and the impact on the developer
    • describing the user-first site problem, not your solution
    • Refer: https://ant.design/changelog#501
  • 🚨 请填写 PR 中的 changelog

    • 请用面向开发者的角度叙述方式撰写,不描述修复细节
    • 描述问题和对开发者的影响
    • 描述用户第一现场的问题,而非你的解决方式
    • 参考:https://ant.design/changelog-cn#501

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3e44b46) to head (9ab89e9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #47921   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          736       736           
  Lines        12664     12664           
  Branches      3325      3325           
=========================================
  Hits         12664     12664           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

1 participant