navItems() {
    const items = new ItemList();
    const user = this.user;

    items.add('posts',
      LinkButton.component({
        href: app.route('user.posts', {username: user.username()}),
        children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentCount()}</span>],
        icon: 'far fa-comment'
      }),
      100
    );

    items.add('discussions',
      LinkButton.component({
        href: app.route('user.discussions', {username: user.username()}),
        children: [app.translator.trans('core.forum.user.discussions_link'), <span className="Button-badge">{user.discussionCount()}</span>],
        icon: 'fas fa-bars'
      }),
      90
    );

    if (app.session.user === user) {
      items.add('separator', Separator.component(), -90);
      items.add('settings',
        LinkButton.component({
          href: app.route('settings'),
          children: app.translator.trans('core.forum.user.settings_link'),
          icon: 'fas fa-cog'
        }),
        -100
      );
    }

    return items;
  }
/**
   * Build an item list for the navigation in the sidebar.
   *
   * @return {ItemList}
   */
Build an item list for the navigation in the sidebar.
Build an item list for the navigation in the sidebar .
navItems() {
    const items = new ItemList();
    const user = this.user;
    items.add('posts',
      LinkButton.component({
        href: app.route('user.posts', {username: user.username()}),
        children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentCount()}</span>],
        icon: 'far fa-comment'
      }),
      100
    );
    items.add('discussions',
      LinkButton.component({
        href: app.route('user.discussions', {username: user.username()}),
        children: [app.translator.trans('core.forum.user.discussions_link'), <span className="Button-badge">{user.discussionCount()}</span>],
        icon: 'fas fa-bars'
      }),
      90
    );
    if (app.session.user === user) {
      items.add('separator', Separator.component(), -90);
      items.add('settings',
        LinkButton.component({
          href: app.route('settings'),
          children: app.translator.trans('core.forum.user.settings_link'),
          icon: 'fas fa-cog'
        }),
        -100
      );
    }
    return items;
  }
navItems ( ) { const items = new ItemList ( ) ; const user = this . user ; items . add ( 'posts' , LinkButton . component ( { href : app . route ( 'user.posts' , { username : user . username ( ) } ) , children : [ app . translator . trans ( 'core.forum.user.posts_link' ) , < span className = "Button-badge" > { user . commentCount ( ) } < / span > ] , icon : 'far fa-comment' } ) , 100 ) ; items . add ( 'discussions' , LinkButton . component ( { href : app . route ( 'user.discussions' , { username : user . username ( ) } ) , children : [ app . translator . trans ( 'core.forum.user.discussions_link' ) , < span className = "Button-badge" > { user . discussionCount ( ) } < / span > ] , icon : 'fas fa-bars' } ) , 90 ) ; if ( app . session . user === user ) { items . add ( 'separator' , Separator . component ( ) , - 90 ) ; items . add ( 'settings' , LinkButton . component ( { href : app . route ( 'settings' ) , children : app . translator . trans ( 'core.forum.user.settings_link' ) , icon : 'fas fa-cog' } ) , - 100 ) ; } return items ; }
Build an item list for the navigation in the sidebar.
Build an item list for the navigation in the sidebar .