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

Breadcrumbs appear in the wrong order for only ONE page #14

Closed
tszekely-spotcap opened this issue Jan 24, 2018 · 3 comments
Closed

Breadcrumbs appear in the wrong order for only ONE page #14

tszekely-spotcap opened this issue Jan 24, 2018 · 3 comments

Comments

@tszekely-spotcap
Copy link

Hi, first of all thank you for your hard work with implementing this module.

I have this weird issue where on ONE page the breadcrumb order is messed up, while the rest of the pages are perfectly fine.

Here's some code that might help identify the issue.
The breadcrumbs are declared in the parent component along with 2 base items:

          <BreadcrumbsItem to="/">Home</BreadcrumbsItem>
          <BreadcrumbsItem to="/dashboard">
            <i className="material-icons">chevron_right</i>User
          </BreadcrumbsItem>
          <Breadcrumb />
          <div className="main">
            <Switch>
              <Route path="/dashboard" component={Dashboard} />
              <Route path="/risk-assessment" component={RiskAssessment} />
              <Route path="/bank-accounts" component={BankAccount} />
              <Route path="/scoring-decision" component={ScoringDecision} />
              <Route path="/financial-light" component={FinancialLight} />
              <Route path="/cle" component={CreditLineEstimations} />
            </Switch>
          </div>

All the pages have the BreadcrumbsItem on top of the page as in the examples and they work fine except the CreditLineEstimations page which shows them as:
Home > Credit line estimations > User
instead of
Home > User > Credit line estimations

the page render jsx starts as:

<div>
        <BreadcrumbsItem to="/cle">
          <i className="material-icons">chevron_right</i>Credit line estimations
        </BreadcrumbsItem>
...

PS: don't mind the separator added in the BreadcrumbsItem, it's wrong and it'll be fixed

@oklas
Copy link
Owner

oklas commented Jan 25, 2018

Hi! Thank you for feedback. Any feedback and stars is very significant to know that my creations is on demand. Also followers can receive notifications about new features.

Breadcrumbs is displaying a hierarchy of the current page in relation to the website's structure. This means breadcrumbs is a branch of tree. This mean leaf may not sit on two branch or branch can not contain another non parental branch. This also may confuse user who navigated via breadcrumbs.

In your example /cle does not lie on /dashboard it lie on / (Home). So possible solutions:

  • change route of CreditLineEstimations from/cle to /dashboard/cle
  • move <BreadcrumbsItem to='/dashboard'/> to <Dashboard/> component

Consider more opinions:

  • create additional navigation elements for frequently used pages like dashboard
  • create menu like drop-down elements for breadcrumb item - (<Breadcrumbs item={Menu}/>)
  • consider to use react-through if you want to create some as breadcrumbs but some different.

@oklas
Copy link
Owner

oklas commented Jan 27, 2018

I close the issue. I hope you solved the problem. Feel free to write or reopen or create new if any.

@oklas oklas closed this as completed Jan 27, 2018
@oklas
Copy link
Owner

oklas commented Mar 28, 2018

Orderig of breadcrumbs is customizable now due to #19. Maybe you'll find it useful for your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants