Skip to content

Rename url to href in navigation items for consistency #17

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

Conversation

oketafred
Copy link
Contributor

@oketafred oketafred commented Feb 24, 2025

This pull request renames the url property to href to align with the NavItem interface definition.

The current NavItem interface is structured as follows, and it does not include a url property, necessitating this change:

export interface NavItem {
    title: string;
    href: string;
    icon?: LucideIcon;
    isActive?: boolean;
}

By updating url to href, we ensure consistency with the existing type definition and avoid potential issues related to property mismatches.

The className attribute was incorrectly used in the Vue template, which caused styling issues. This change replaces className with the correct class attribute to ensure proper styling and alignment with Vue's syntax. No breaking changes are introduced.
This change renames the `url` property to `href` across all navigation-related components (NavFooter, AppHeader, AppSidebar) to maintain consistency in naming conventions. The update ensures uniformity in the codebase and aligns with standard HTML attribute naming practices. No breaking changes are introduced as the functionality remains the same.
@thewebartisan7
Copy link
Contributor

I just saw this one; I'll check yours to see if it's a better approach. I did the opposite by renaming 'NavItem' from 'href' to 'url' in a few places.

@tnylea
Copy link
Contributor

tnylea commented Feb 24, 2025

Thanks @oketafred and @thewebartisan7. I agree that we should keep it consistent. I was researching if url or href is more common and I've seen href used more often when referring to links in a React application.

Let's stick with that. @thewebartisan7 I'm going to close your PR and work on getting this one merged in.

@thewebartisan7
Copy link
Contributor

Thanks @oketafred and @thewebartisan7. I agree that we should keep it consistent. I was researching if url or href is more common and I've seen href used more often when referring to links in a React application.

Let's stick with that. @thewebartisan7 I'm going to close your PR and work on getting this one merged in.

Consistency is key for me as well, and personally, I prefer using href over url in this case. However, I found it a bit quicker to switch to url in the Vue app. I'll test this branch tomorrow.

Copy link
Contributor

@tnylea tnylea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oketafred Looks good. Thanks

@taylorotwell taylorotwell merged commit fe8ce79 into laravel:main Feb 24, 2025
2 checks passed
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.

4 participants