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

Add missing mobile icons for new route and default icon #964

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

marc-aurele-besner
Copy link
Collaborator

@marc-aurele-besner marc-aurele-besner commented Nov 18, 2024

User description

Add missing mobile icons for new route and default icon

  • Route had been removed or hidden for current network, and new route did not have any defined mobile icon
  • Now there is a boring link icon as default if routes don't have a define icon

Screenshot

image

PR Type

enhancement


Description

  • Added missing mobile icons for new routes in the SectionHeader component.
  • Introduced a default LinkIcon for routes without a defined icon.
  • Updated the domainIcon function to handle new route cases such as farming, staking, domains, nova, autoid, and testnetRewards.

Changes walkthrough 📝

Relevant files
Enhancement
SectionHeader.tsx
Add and update mobile icons for various routes                     

explorer/src/components/layout/SectionHeader.tsx

  • Added new imports for various icons from @heroicons/react/24/outline.
  • Updated the domainIcon function to include new cases for different
    routes.
  • Added a default icon (LinkIcon) for routes without a defined icon.
  • Reorganized the switch cases to accommodate new route icons.
  • +24/-6   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @marc-aurele-besner marc-aurele-besner linked an issue Nov 18, 2024 that may be closed by this pull request
    Copy link

    netlify bot commented Nov 18, 2024

    Deploy Preview for dev-astral ready!

    Name Link
    🔨 Latest commit a2a0e25
    🔍 Latest deploy log https://app.netlify.com/sites/dev-astral/deploys/673b6a33ad1bc50008b3874e
    😎 Deploy Preview https://deploy-preview-964--dev-astral.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 site configuration.

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Icon Consistency
    Ensure that the newly added icons match the visual and functional consistency of the existing application icons. This includes checking the icon sizes, colors, and styles to maintain a uniform user interface.

    Default Icon Handling
    Review the implementation of the default LinkIcon to ensure it is appropriately used across all undefined route cases, and verify that this does not unintentionally override any existing icons that should be displayed.

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Change the default icon to null or another appropriate icon to avoid confusion

    Ensure that the default case in the switch statement for domainIcon returns a
    meaningful icon or a null value instead of LinkIcon to avoid misleading default
    representations.

    explorer/src/components/layout/SectionHeader.tsx [51]

     default:
    -  return <LinkIcon className={className} />
    +  return null; // or another appropriate default icon
    Suggestion importance[1-10]: 6

    Why: Changing the default icon to null or another appropriate icon can prevent potential confusion when no specific case matches in the switch statement. This ensures that the UI does not misleadingly display an unrelated icon.

    6

    @marc-aurele-besner marc-aurele-besner merged commit 2717625 into main Nov 18, 2024
    12 checks passed
    @marc-aurele-besner marc-aurele-besner deleted the fix/963-main-menu-on-mobile-does-not-work branch November 18, 2024 16:46
    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.

    Main menu on mobile does not work
    3 participants