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
*gitigx*
.cekey

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@ function App({ children, routes }) {
<Interactive
as={Link}
{...s.link}
to={'/' + nextPath(route)}
to={nextPath(route)}
>{route.mapMenuTitle}</Interactive>
{(index + 1) < array.length && ' / '}
</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" />
</div>
<h1 style={s.title}>Single Page Apps for GitHub Pages</h1>
<Interactive
as="a"
href="https://github.com/rafrex/spa-github-pages"
style={s.repoLink}
{...s.link}
>https://github.com/rafrex/spa-github-pages</Interactive>
{/*
<Interactive
as="a"
href="https://github.com/rafrex/spa-github-pages"
style={s.repoLink}
{...s.link}
>https://github.com/rafrex/spa-github-pages</Interactive>
*/}
<nav style={s.mapMenu}>
{generateMapMenu()}
</nav>
{children}
{
/*
{/*
<div style={s.creditLine}>
<Interactive
as="a"
@ -66,8 +67,7 @@ function App({ children, routes }) {
Code and concept by <span {...s.childLink}>Rafael Pedicini</span>
</Interactive>
</div>
*/
}
*/}
</div>
);
}

View File

@ -9,14 +9,19 @@ import ExampleComponent from './components/ExampleComponent';
import ExampleTwoDeepComponent from './components/ExampleTwoDeepComponent';
const routes = (
<Route path="/portal/" mapMenuTitle="Home" component={App}>
<IndexRoute component={Home} />
<Route path="/" component={App}>
<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 path="*" mapMenuTitle="Page Not Found" component={PageNotFound} />
</Route>
);