Fixed routing issue

This commit is contained in:
Daniel 2017-04-28 11:22:48 -04:00
parent a9aac5bbe7
commit 5f1f148a45
4 changed files with 29 additions and 22 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ node_modules
# Files marked with gitigx # Files marked with gitigx
*gitigx* *gitigx*
.cekey

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@ function App({ children, routes }) {
<Interactive <Interactive
as={Link} as={Link}
{...s.link} {...s.link}
to={'/' + nextPath(route)} to={nextPath(route)}
>{route.mapMenuTitle}</Interactive> >{route.mapMenuTitle}</Interactive>
{(index + 1) < array.length && ' / '} {(index + 1) < array.length && ' / '}
</span> </span>
@ -42,18 +42,19 @@ function App({ children, routes }) {
<img src="http://i35.servimg.com/u/f35/17/08/39/22/chaoti11.png" alt="Chaotic Backup" /> <img src="http://i35.servimg.com/u/f35/17/08/39/22/chaoti11.png" alt="Chaotic Backup" />
</div> </div>
<h1 style={s.title}>Single Page Apps for GitHub Pages</h1> <h1 style={s.title}>Single Page Apps for GitHub Pages</h1>
<Interactive {/*
as="a" <Interactive
href="https://github.com/rafrex/spa-github-pages" as="a"
style={s.repoLink} href="https://github.com/rafrex/spa-github-pages"
{...s.link} style={s.repoLink}
>https://github.com/rafrex/spa-github-pages</Interactive> {...s.link}
>https://github.com/rafrex/spa-github-pages</Interactive>
*/}
<nav style={s.mapMenu}> <nav style={s.mapMenu}>
{generateMapMenu()} {generateMapMenu()}
</nav> </nav>
{children} {children}
{ {/*
/*
<div style={s.creditLine}> <div style={s.creditLine}>
<Interactive <Interactive
as="a" as="a"
@ -66,8 +67,7 @@ function App({ children, routes }) {
Code and concept by <span {...s.childLink}>Rafael Pedicini</span> Code and concept by <span {...s.childLink}>Rafael Pedicini</span>
</Interactive> </Interactive>
</div> </div>
*/ */}
}
</div> </div>
); );
} }

View File

@ -9,14 +9,19 @@ import ExampleComponent from './components/ExampleComponent';
import ExampleTwoDeepComponent from './components/ExampleTwoDeepComponent'; import ExampleTwoDeepComponent from './components/ExampleTwoDeepComponent';
const routes = ( const routes = (
<Route path="/portal/" mapMenuTitle="Home" component={App}> <Route path="/" component={App}>
<IndexRoute component={Home} /> <Route path="portal/" mapMenuTitle="Home">
<IndexRoute component={Home} />
<Route path="example" mapMenuTitle="Example" component={ExampleComponent}>
<Route path="two-deep" mapMenuTitle="Two Deep" component={ExampleTwoDeepComponent} />
</Route>
<Route path="example" mapMenuTitle="Example" component={ExampleComponent}>
<Route path="two-deep" mapMenuTitle="Two Deep" component={ExampleTwoDeepComponent} />
</Route> </Route>
<Route path="*" mapMenuTitle="Page Not Found" component={PageNotFound} /> <Route path="*" mapMenuTitle="Page Not Found" component={PageNotFound} />
</Route> </Route>
); );