Skip to content
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

Move DiscussionListPane out of DiscussionPage #176

Open
w-4 opened this issue Oct 26, 2020 · 1 comment
Open

Move DiscussionListPane out of DiscussionPage #176

w-4 opened this issue Oct 26, 2020 · 1 comment
Labels

Comments

@w-4
Copy link

w-4 commented Oct 26, 2020

Feature Request

By doing so we can increase rendering performance, so the DiscussionListPane doesn't need to fully rerender when switching discussions.

Describe the solution you'd like
I suggest we put it inside an AppNavigation component, where we also render the mobile top header conditionally. We could return an ItemList so people can also extend and add custom Navigation components like a mobile bottom navigation.

image

export default class AppNavigation extends Component {
  view() {
    const isMobile = app.screen === 'phone';

    return [
      isMobile && <AppTopNav />,
      <AppSideNav />,
    ];
  }
}

export default class AppTopNav extends Component {
  view() {
    return (
      <div id="app-top-navigation" className="App-top-navigation" style={style}>
        {Navigation.component({ className: 'App-backControl', drawer: true })}
      </div>
    );
  }
}

export default class AppSideNav extends Component {
  view() {
    const isMobile = app.screen === 'phone';
    const isDiscussionPage = app.current.matches(DiscussionPage);

    return (
      <div id="app-side-navigation" className="App-side-navigation">
        {isDiscussionPage && !isMobile && <DiscussionListPane state={app.discussions} />}
      </div>
    );
  }
}
@stale
Copy link

stale bot commented Jan 25, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum.
In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

@stale stale bot added the stale label Jan 25, 2021
@stale stale bot removed the stale label Jan 25, 2021
@askvortsov1 askvortsov1 transferred this issue from flarum/framework Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants