Skip to content

Commit

Permalink
refactor(app): rewrite root component in reason
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Jan 20, 2018
1 parent 7a90cef commit 6cc547d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
25 changes: 25 additions & 0 deletions packages/web-app/src/components/root/Root.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
open ReasonReactRouterDom;

let component = ReasonReact.statelessComponent("Root");

let make = _children => {
...component,
render: _self =>
<BrowserRouter>
<Switch>
<Route
exact=true
path="/auth/callback/silent"
component=AuthorizeCallbackSilent.default
/>
<Route
exact=true
path="/auth/callback"
component=AuthorizeCallback.default
/>
<Route component=Application.default />
</Switch>
</BrowserRouter>
};

let default = ReasonReact.wrapReasonForJs(~component, _jsProps => make([||]));
5 changes: 0 additions & 5 deletions packages/web-app/src/components/root/WRoot.re

This file was deleted.

2 changes: 1 addition & 1 deletion packages/web-app/src/components/root/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './root';
export { default } from './Root.bs';
21 changes: 0 additions & 21 deletions packages/web-app/src/components/root/root.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/web-app/src/index.re
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* [@bs.module "./registerServiceWorker"] external register_service_worker : unit => unit = "default"; */
ReactDOMRe.renderToElementWithId(<WRoot />, "root");
ReactDOMRe.renderToElementWithId(<Root />, "root");
/* register_service_worker(); */

0 comments on commit 6cc547d

Please sign in to comment.