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

Add support for configurable navbar title links. #1704

Merged
merged 2 commits into from Feb 7, 2018

Conversation

Projects
None yet
4 participants
@baconmania
Contributor

baconmania commented Feb 2, 2018

Looks like
image

This setup defaults to having the nav header title link back to the Dashboard (as is the case today) if no links are configured.

Might have to tweak the CSS class setup slightly, since the Admin dropdown has squared corners, but this one's got rounded corners.

@tpetr

This comment has been minimized.

Member

tpetr commented Feb 4, 2018

yaaaas

@ssalinas

This comment has been minimized.

Member

ssalinas commented Feb 5, 2018

Will let @kwm4385 and the more-UI-inclined take a look at the react bits, but I agree on making this and the admin dropdown match

@kwm4385

Made a few changes to get everything working right and for styling. Highlights below

@@ -35,6 +35,26 @@ function isActive(navbarPath, fragment) {
// put into page wrapper, render children
const Navigation = (props) => {
const fragment = props.location.pathname.split('/')[1];
const navTitle = config.navTitleLinks
? (
<ul className="nav navbar-nav">

This comment has been minimized.

@kwm4385

kwm4385 Feb 5, 2018

Contributor

Wrapping this in the same ul structure will give the consistent menu look you seek.

@@ -35,6 +35,26 @@ function isActive(navbarPath, fragment) {
// put into page wrapper, render children
const Navigation = (props) => {
const fragment = props.location.pathname.split('/')[1];
const navTitle = config.navTitleLinks

This comment has been minimized.

@kwm4385

kwm4385 Feb 5, 2018

Contributor

Needed a null check for the config field itself somewhere, otherwise it would break if it wasn't set.

{config.title} <span className="caret" />
</a>
<ul className="dropdown-menu">
{Object.keys(config.navTitleLinks).map((linkTitle, index) =>

This comment has been minimized.

@kwm4385

kwm4385 Feb 5, 2018

Contributor

These links can be inlined

@kwm4385

This comment has been minimized.

Contributor

kwm4385 commented Feb 5, 2018

image

@ssalinas

This comment has been minimized.

Member

ssalinas commented Feb 5, 2018

🚢

@ssalinas ssalinas merged commit b7cb83c into master Feb 7, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ssalinas ssalinas deleted the nav-title-links branch Feb 7, 2018

@ssalinas ssalinas added this to the 0.19.0 milestone Feb 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment