diff --git a/js/src/common/components/LinkButton.tsx b/js/src/common/components/LinkButton.tsx index 659570a60..176c0c320 100644 --- a/js/src/common/components/LinkButton.tsx +++ b/js/src/common/components/LinkButton.tsx @@ -1,7 +1,7 @@ import Button, {ButtonProps} from './Button'; interface LinkButtonProps extends ButtonProps { - active: string; + active: boolean; oncreate: Function; href?: string; } @@ -27,6 +27,7 @@ export default class LinkButton extends Button { const vdom = super.view(); vdom.tag = m.route.Link; + vdom.attrs.active = String(vdom.attrs.active); return vdom; } @@ -34,11 +35,9 @@ export default class LinkButton extends Button { /** * Determine whether a component with the given props is 'active'. */ - static isActive(props: LinkButtonProps): string { - return String( - typeof props.active !== 'undefined' - ? props.active - : m.route.get() === props.href - ); + static isActive(props: LinkButtonProps): boolean { + return typeof props.active !== 'undefined' + ? props.active + : m.route.get() === props.href; } } diff --git a/js/src/common/helpers/listItems.tsx b/js/src/common/helpers/listItems.tsx index e5324af8a..0d3c6e0f1 100644 --- a/js/src/common/helpers/listItems.tsx +++ b/js/src/common/helpers/listItems.tsx @@ -41,10 +41,9 @@ export default function listItems(items) { const node = isListItem ? item - :
  • {item} diff --git a/js/src/forum/components/SessionDropdown.tsx b/js/src/forum/components/SessionDropdown.tsx index c0b0dd169..4717be683 100644 --- a/js/src/forum/components/SessionDropdown.tsx +++ b/js/src/forum/components/SessionDropdown.tsx @@ -51,14 +51,14 @@ export default class SessionDropdown extends Dropdown { 100 ); - // items.add('settings', - // LinkButton.component({ - // icon: 'fas fa-cog', - // children: app.translator.trans('core.forum.header.settings_button'), - // href: app.route('settings') - // }), - // 50 - // ); + items.add('settings', + LinkButton.component({ + icon: 'fas fa-cog', + children: app.translator.trans('core.forum.header.settings_button'), + href: app.route('settings') + }), + 50 + ); if (app.forum.attribute('adminUrl')) { items.add('administration', @@ -67,7 +67,6 @@ export default class SessionDropdown extends Dropdown { children: app.translator.trans('core.forum.header.admin_button'), href: app.forum.attribute('adminUrl'), target: '_blank', - config: () => {} }), 0 );