DEV: Allow overriding sidebar icon for "My Posts"

This sidebar link uses the "user" icon by default. For themes/plugins
that may want to override only this icon, we need to add a unique name
here so it that it can be replaced for this use case specifically.
This commit is contained in:
Penar Musaraj 2024-03-20 14:30:28 -04:00
parent 5098338a96
commit 3ddd099836
No known key found for this signature in database
GPG Key ID: E390435D881FF0F7
2 changed files with 3 additions and 2 deletions

View File

@ -51,6 +51,7 @@ export const REPLACEMENTS = {
"notification.reaction": "bell",
"notification.votes_released": "plus",
"notification.chat_quoted": "quote-right",
"sidebar.my_posts": "user",
};
export function replaceIcon(source, destination) {

View File

@ -98,11 +98,11 @@ export default class MyPostsSectionLink extends BaseSectionLink {
return this.draftCount > 0;
}
get defaultPrefixValue() {
get prefixValue() {
if (this._hasDraft && this.currentUser?.new_new_view_enabled) {
return "pencil-alt";
}
return "user";
return "sidebar.my_posts";
}
get suffixCSSClass() {