Skip to content

Commit 6c14e65

Browse files
queervioletqueerviolet
queerviolet
authored and
queerviolet
committed
Move the demonstration components into their own router to avoid merge conflicts downstream.
1 parent da394d4 commit 6c14e65

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

app/main.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const App = ({children}) =>
5454
render(
5555
<Router history={browserHistory}>
5656
<Route path="/" component={App}>
57-
<IndexRedirect to="demos/scratchpad/welcome"/>
58-
{Demos}
57+
<IndexRedirect to="demos"/>
58+
{Demos /* Put all the demos and a description page at /demos */}
5959
</Route>
6060
<Route path='*' component={NotFound}/>
6161
</Router>,

demos/index.jsx

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1+
'use strict'
12
import React from 'react'
2-
import {Route} from 'react-router'
3+
import {Route, IndexRedirect, IndexRoute, Link} from 'react-router'
34

45
import Scratchpad from './scratchpad'
56
import Whiteboard from './whiteboard'
67

8+
const Index = ({children}) => <div>
9+
<h1>Demos!</h1>
10+
<h2><Link to='demos/scratchpad/welcome'>Scratchpad</Link></h2>
11+
<p>
12+
The scratchpad is the very simplest React/Firebase demo—a text area
13+
whose content is synced with Firebase.
14+
</p>
15+
16+
<h2><Link to='demos/whiteboard/welcome'>Whiteboard</Link></h2>
17+
<p>
18+
The whiteboard demonstrates the <i>journal</i> pattern, a way to use Firebase
19+
to synchronize the state of Redux stores on all collaborators machines.
20+
</p>
21+
</div>
22+
723
export default <Route path="/demos" component={({children}) => children}>
8-
<IndexRedirect to="scratchpad/welcome"/>
9-
<Route path="scratchpad/:title" component={Scratchpad}/>
10-
<Route path="whiteboard/:title" component={Whiteboard}/>
24+
<IndexRoute component={Index}/>
25+
<Route path='scratchpad/:title' component={Scratchpad}/>
26+
<Route path='whiteboard/:title' component={Whiteboard}/>
1127
</Route>
12-

0 commit comments

Comments
 (0)