Commit 37e53658 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DESIGN]

parent c4ee2272
......@@ -323,7 +323,6 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
where
setParams f = setPath $ \p@{params: ps} -> p {params = f ps}
params = (fst path).params /\ setParams
-- colNames = T.ColumnName <$> [ "", "Date", "Title", "Source", "Authors", "Delete" ]
colNames = case rowsLoaded of
Docs _ -> T.ColumnName <$> [ "", "Date", "Title", "Journal", "", "" ]
Contacts _ -> T.ColumnName <$> [ "", "Contact", "Organization", "", "", "" ]
......
......@@ -133,36 +133,44 @@ sideTab _ _ = H.div {} []
-------------------------------------------
-- TODO
-- selectedNodes :: Record Props -> Map.Map String Nodes -> R.Element
selectedNodes props nodesMap = R2.row [ R2.col 12
[ RH.ul { id: "myTab", className: "nav nav-tabs", role: "tablist"}
[ RH.div { className: "tab-content" }
[ RH.div { className: "", role: "tabpanel" }
( Seq.toUnfoldable
$ ( Seq.map (badge props.selectedNodeIds)
(badges props.graph props.selectedNodeIds)
)
)
]
, RH.div { className: "tab-content flex-space-between" }
[ removeButton "Move as candidate" CandidateTerm props nodesMap
, removeButton "Move as stop" StopTerm props nodesMap
]
]
]
]
selectedNodes props nodesMap =
R2.row [ R2.col 12
[ RH.ul { id: "myTab", className: "nav nav-tabs", role: "tablist"}
[ RH.div { className: "tab-content" }
[ RH.div { className: ""
, role: "tabpanel" }
( Seq.toUnfoldable
$ ( Seq.map (badge props.selectedNodeIds)
(badges props.graph props.selectedNodeIds)
)
)
, H.br {}
]
]
, RH.div { className: "tab-content flex-space-between" }
[ removeButton "primary" "Move as candidate" CandidateTerm props nodesMap
, H.br {}
, removeButton "danger" "Move as stop" StopTerm props nodesMap
]
]
]
neighborhood props = RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { className: "", id: "home", role: "tabpanel" }
[ RH.div { -- className: "flex-space-around d-flex justify-content-center"
className: "flex-space-around d-flex"
, id: "home"
, role: "tabpanel"
}
(Seq.toUnfoldable $ Seq.map (badge props.selectedNodeIds)
$ neighbourBadges props.graph props.selectedNodeIds
)
]
removeButton text rType props' nodesMap' =
removeButton btnType text rType props' nodesMap' =
if Set.isEmpty $ fst props'.selectedNodeIds then
RH.div {} []
else
RH.button { className: "btn btn-info"
RH.button { className: "btn btn-" <> btnType
, on: { click: onClickRemove rType props' nodesMap' }
}
[ RH.text text ]
......
......@@ -14,7 +14,7 @@ thisModule = "Gargantext.Components.Tab"
type TabsProps = (
selected :: Int
, tabs :: Array (Tuple String R.Element)
, tabs :: Array (Tuple String R.Element)
)
tabs :: Record TabsProps -> R.Element
......@@ -29,17 +29,23 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
pure $
H.div {}
[ H.nav {}
[ H.div { className: "nav nav-tabs"
, title : "Tab for ngrams"
}
(mapWithIndex (button setActiveTab activeTab) props.tabs) ]
, H.div { className: "tab-content" } $ mapWithIndex (item activeTab) props.tabs ]
[ H.br {}
, H.div { className: "nav nav-tabs"
, title : "Search result"
} [H.text "" ]
-- (mapWithIndex (button setActiveTab activeTab) props.tabs)
]
, H.div { className: "tab-content" }
$ mapWithIndex (item activeTab) props.tabs
]
{-
button setActiveTab selected index (name /\ _) =
H.a { className, on: { click } } [ H.text name ]
where
eq = index == selected
className = "nav-item nav-link" <> (if eq then " active" else "")
click e = setActiveTab (const index)
-}
item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ]
-- TODO: document what these are (selection, item indices)
......
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