Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions framework/core/js/src/admin/components/AdminNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ export default class AdminNav extends Component {
const query = this.query().toUpperCase();
const title = extension.extra['flarum-extension'].title || '';
const description = extension.description || '';
const isAbandoned = extension.abandoned;
const hasReplacement = typeof isAbandoned === 'string';

if (!query || title.toUpperCase().includes(query) || description.toUpperCase().includes(query)) {
items.add(
Expand All @@ -169,7 +167,6 @@ export default class AdminNav extends Component {
title={description}
>
{title}
{isAbandoned && <span className={`Badge Badge--${hasReplacement ? 'danger' : 'warning'}`}>!</span>}
</ExtensionLinkButton>,
categories[category]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export default class ExtensionLinkButton extends LinkButton {
statusItems(name) {
const items = new ItemList();

const extension = app.data.extensions[name];
const isAbandoned = extension?.abandoned;

if (isAbandoned) {
const hasReplacement = typeof isAbandoned === 'string';
items.add('abandoned', <span className={`Badge Badge--${hasReplacement ? 'danger' : 'warning'}`}>!</span>, 10);
}

items.add('enabled', <span className={'ExtensionListItem-Dot ' + (isExtensionEnabled(name) ? 'enabled' : 'disabled')} />);

return items;
Expand Down
4 changes: 3 additions & 1 deletion framework/core/less/admin/AdminNav.less
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@

.ExtensionNavButton {
.Badge {
margin-left: 5px;
.Badge--size(16px);
font-size: 10px;
font-weight: bold;
position: absolute;
right: 33px;
margin: 3px 0;

&.Badge--danger {
--badge-bg: @error-color;
Expand Down
Loading