diff options
Diffstat (limited to 'client/src/index.js')
| -rw-r--r-- | client/src/index.js | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/client/src/index.js b/client/src/index.js index a30dbf1..0ca8b1c 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -4,6 +4,7 @@ import 'regenerator-runtime/runtime'; import { h, Fragment, Component, render } from 'preact'; import { GraphContainerJSONLD, GraphContainerMastodon } from './graph'; import { Menu, Discussion, Selection } from './ui'; +import { UserContainer } from './user'; class SelectionContainer extends Component { state = { @@ -134,29 +135,24 @@ const search = new URLSearchParams(window.location.search); const graph = search.has('graph') ? search.get('graph') : 'lib/graph.json'; let app; -if (search.has('document')) { - app = ( - <GraphContainerJSONLD - url={search.get('document')} - render={graphRender} - /> - ); -} else if (search.has('note')) { +if (search.has('document') || search.has('note') || search.has('graph')) { + const Container = search.has('document') ? GraphContainerJSONLD : GraphContainerMastodon; + const url = search.get('document') || search.get('note') || search.get('graph'); + app = ( - <GraphContainerMastodon - url={search.get('note')} - render={graphRender} - /> + <UserContainer> + <Container + url={url} + render={graphRender} + /> + </UserContainer> ); -} else if (search.has('graph')) { +} else { app = ( - <GraphContainerMastodon - url={search.get('graph')} - render={graphRender} - /> + <UserContainer> + <Menu /> + </UserContainer> ); -} else { - app = <Menu />; } render(app, document.body); |
