Skip to content

Commit 5cef09c

Browse files
queervioletqueerviolet
queerviolet
authored and
queerviolet
committed
Merge branch 'demos'
2 parents ad75061 + 6c14e65 commit 5cef09c

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

app/main.jsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import NotFound from './components/NotFound'
88

99
import firebase from 'APP/fire'
1010

11-
// -- // Demo components // -- //
12-
import Scratchpad from 'APP/demos/scratchpad'
13-
import Whiteboard from 'APP/demos/whiteboard'
11+
import Demos from 'APP/demos'
1412

1513
// Get the auth API from Firebase.
1614
const auth = firebase.auth()
@@ -56,9 +54,8 @@ const App = ({children}) =>
5654
render(
5755
<Router history={browserHistory}>
5856
<Route path="/" component={App}>
59-
<IndexRedirect to="scratchpad/welcome"/>
60-
<Route path="scratchpad/:title" component={Scratchpad}/>
61-
<Route path="whiteboard/:title" component={Whiteboard}/>
57+
<IndexRedirect to="demos"/>
58+
{Demos /* Put all the demos and a description page at /demos */}
6259
</Route>
6360
<Route path='*' component={NotFound}/>
6461
</Router>,

demos/index.jsx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use strict'
2+
import React from 'react'
3+
import {Route, IndexRedirect, IndexRoute, Link} from 'react-router'
4+
5+
import Scratchpad from './scratchpad'
6+
import Whiteboard from './whiteboard'
7+
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+
23+
export default <Route path="/demos" component={({children}) => children}>
24+
<IndexRoute component={Index}/>
25+
<Route path='scratchpad/:title' component={Scratchpad}/>
26+
<Route path='whiteboard/:title' component={Whiteboard}/>
27+
</Route>

0 commit comments

Comments
 (0)