Commit bbb3350a authored by James Laver's avatar James Laver

more twiddling

parent 21533aa5
...@@ -50,7 +50,7 @@ type LayoutProps = ( ...@@ -50,7 +50,7 @@ type LayoutProps = (
, graphId :: GET.GraphId , graphId :: GET.GraphId
, handed :: T.Cursor Types.Handed , handed :: T.Cursor Types.Handed
, route :: T.Cursor AppRoute , route :: T.Cursor AppRoute
, session :: Session , session :: R.Context Session
, sessions :: T.Cursor Sessions , sessions :: T.Cursor Sessions
, showLogin :: T.Cursor Boolean , showLogin :: T.Cursor Boolean
, tasks :: T.Cursor (Maybe GAT.Reductor) , tasks :: T.Cursor (Maybe GAT.Reductor)
...@@ -69,24 +69,23 @@ explorerLayout :: Record LayoutProps -> R.Element ...@@ -69,24 +69,23 @@ explorerLayout :: Record LayoutProps -> R.Element
explorerLayout props = R.createElement explorerLayoutCpt props [] explorerLayout props = R.createElement explorerLayoutCpt props []
explorerLayoutCpt :: R.Component LayoutProps explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutCpt = here.component "explorerLayout" cpt explorerLayoutCpt = here.component "explorerLayout" cpt where
where cpt props _ = do
cpt props _ = do graphVersion <- GUR.new
graphVersion <- GUR.new session <- R.useContext props.session -- todo: ugh, props fiddling
pure $ explorerLayoutView graphVersion props pure $ explorerLayoutView graphVersion props
explorerLayoutView :: GUR.ReloadS -> Record LayoutProps -> R.Element explorerLayoutView :: GUR.ReloadS -> Record LayoutProps -> R.Element
explorerLayoutView graphVersion p = R.createElement el p [] explorerLayoutView graphVersion p = R.createElement el p [] where
where el = here.component "explorerLayoutView" cpt
el = here.component "explorerLayoutView" cpt cpt props@{ graphId, session } _ = do
cpt props@{ graphId, session } _ = do useLoader graphId (getNodes session graphVersion) handler
useLoader graphId (getNodes session graphVersion) handler where
where handler loaded =
handler loaded = explorer (Record.merge props { graph, graphVersion, hyperdataGraph: loaded, mMetaData })
explorer (Record.merge props { graph, graphVersion, hyperdataGraph: loaded, mMetaData }) where
where GET.HyperdataGraph { graph: hyperdataGraph } = loaded
GET.HyperdataGraph { graph: hyperdataGraph } = loaded Tuple mMetaData graph = convert hyperdataGraph
Tuple mMetaData graph = convert hyperdataGraph
-------------------------------------------------------------- --------------------------------------------------------------
explorer :: Record Props -> R.Element explorer :: Record Props -> R.Element
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment