[ngrams] add missing SidePanel.purs, the panel renders ngrams now

parent d05d7b2e
......@@ -102,8 +102,8 @@ listsLayoutWithKeyCpt = here.component "listsLayoutWithKey" cpt where
sessionUpdate $ setCacheState session nodeId cacheState
type SidePanelProps =
( selectedNgrams :: T.Box (Maybe NgramsTerm)
, session :: Session
( session :: Session
, sidePanel :: T.Box (Maybe (Record SidePanel))
, sidePanelState :: T.Box GT.SidePanelState
)
......@@ -113,7 +113,7 @@ sidePanelCpt :: R.Component SidePanelProps
sidePanelCpt = here.component "sidePanel" cpt
where
cpt { session
, selectedNgrams
, sidePanel
, sidePanelState } _ = do
sidePanelState' <- T.useLive T.unequal sidePanelState
......@@ -131,19 +131,20 @@ sidePanelCpt = here.component "sidePanel" cpt
H.span { className: "fa fa-times" } []
]
]
, sidePanelNgramsContextView { selectedNgrams
, session } []
, sidePanelNgramsContextView { session
, sidePanel } []
]
type SidePanelNgramsContextView =
( selectedNgrams :: T.Box (Maybe NgramsTerm)
, session :: Session )
( session :: Session
, sidePanel :: T.Box (Maybe (Record SidePanel)) )
sidePanelNgramsContextView :: R2.Component SidePanelNgramsContextView
sidePanelNgramsContextView = R.createElement sidePanelNgramsContextViewCpt
sidePanelNgramsContextViewCpt :: R.Component SidePanelNgramsContextView
sidePanelNgramsContextViewCpt = here.component "sidePanelNgramsContextView" cpt where
cpt { selectedNgrams
, session } _ = do
-- pure $ H.h4 {} [ H.text txt ]
pure $ H.div {} [ H.text "Hello ngrams" ]
cpt { session
, sidePanel } _ = do
sidePanel' <- T.useLive T.unequal sidePanel
pure $ H.div {} [ H.text $ show sidePanel' ]
module Gargantext.Components.Nodes.Lists.SidePanel where
import Data.Maybe (Maybe(..))
import Gargantext.Core.NgramsTable.Types (NgramsTerm)
-- type SidePanel :: forall k. Row k
type SidePanel = (
mCurrentNgrams :: Maybe NgramsTerm
)
initialSidePanel :: Maybe (Record SidePanel)
initialSidePanel = Nothing
......@@ -365,6 +365,7 @@ openedSidePanelCpt :: R.Component Props
openedSidePanelCpt = here.component "openedSidePanel" cpt where
cpt { boxes:
{ route
, sidePanelLists
, sidePanelState
}
} _ = do
......@@ -380,7 +381,7 @@ openedSidePanelCpt = here.component "openedSidePanel" cpt where
GR.Lists _s _n -> do
pure $ wrapper
[ Lists.sidePanel { session
, selectedNgrams
, sidePanel: sidePanelLists
, sidePanelState } [] ]
GR.NodeTexts _s _n ->
pure $ wrapper [ Texts.textsSidePanel {} ]
......
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