-
Notifications
You must be signed in to change notification settings - Fork 97
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
Make ProductArea badges interactive #272
Conversation
<Person | ||
@ignoreUnknown={{true}} | ||
@imgURL={{@avatar}} | ||
@email="{{@owner}}" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make this clickable in another PR.
{{! | ||
We create a click area that extends beyond the edges of its relative container. | ||
This makes the parent div clickable without having to wrap itself in a link, | ||
and lets us nest interactive elements (e.g., ProductBadgeLink) in a way that improves the mouse experience without sacrificing accessibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
protected get route() { | ||
const { currentRouteName } = this.router; | ||
|
||
if (!currentRouteName) { | ||
return "authenticated.all"; | ||
} | ||
|
||
if (currentRouteName.includes("drafts")) { | ||
return "authenticated.drafts"; | ||
} | ||
|
||
if (currentRouteName.includes("my")) { | ||
return "authenticated.my"; | ||
} | ||
|
||
return "authenticated.all"; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't immediately tell why we needed this logic - maybe a comment would help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I probably overcomplicated it anyway 😅
Updated
Makes ProductArea badges clickable to initiate a product filter. Badges on the
/my
and/drafts
are scoped to keep you on that route. All other users point to/all
.