forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a routing system using react-router storybookjs#6
Also rename components to have a jsx extension.
- Loading branch information
lowkay
authored and
lowkay
committed
Apr 8, 2016
1 parent
554dc4f
commit 0c6d6db
Showing
23 changed files
with
871 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
'use strict'; | ||
|
||
var _admin = require('./ui/admin'); | ||
var _reactRouter = require('react-router'); | ||
|
||
var _admin2 = _interopRequireDefault(_admin); | ||
var _react = require('react'); | ||
|
||
var _ = require('./'); | ||
var React = _interopRequireWildcard(_react); | ||
|
||
var _reactDom = require('react-dom'); | ||
|
||
var ReactDOM = _interopRequireWildcard(_reactDom); | ||
|
||
var _app = require('./ui/app'); | ||
|
||
var _app2 = _interopRequireDefault(_app); | ||
|
||
var _storybook_route_handler = require('./ui/storybook_route_handler'); | ||
|
||
var _storybook_route_handler2 = _interopRequireDefault(_storybook_route_handler); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
var syncedStore = (0, _.getSyncedStore)(); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
|
||
var rootEl = document.getElementById('root'); | ||
|
||
var router = React.createElement( | ||
_reactRouter.Router, | ||
{ history: _reactRouter.hashHistory }, | ||
React.createElement( | ||
_reactRouter.Route, | ||
{ path: '/', component: _app2.default }, | ||
React.createElement(_reactRouter.IndexRoute, { component: _storybook_route_handler2.default }), | ||
React.createElement(_reactRouter.Route, { path: '/:kind', component: _storybook_route_handler2.default }), | ||
React.createElement(_reactRouter.Route, { path: '/:kind/:story', component: _storybook_route_handler2.default }) | ||
) | ||
); | ||
|
||
syncedStore.watchData(function (data) { | ||
(0, _admin2.default)(data); | ||
}); | ||
(0, _admin2.default)(syncedStore.getData()); | ||
ReactDOM.render(router, rootEl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.