Commit 8a899e20 authored by Fabien Manière's avatar Fabien Manière

corpus children: add tabs and title icons + reduce the spinner width

parent 4a302ff2
......@@ -6699,6 +6699,9 @@ a:hover {
.nav.nav-tabs .nav-link {
cursor: pointer;
}
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #DEE2E6;
}
......
......@@ -6510,6 +6510,9 @@ a:hover {
.nav.nav-tabs .nav-link {
cursor: pointer;
}
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057;
}
......
......@@ -6353,6 +6353,9 @@ a:hover {
.nav.nav-tabs .nav-link {
cursor: pointer;
}
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057;
}
......
......@@ -6574,6 +6574,9 @@ a:hover {
.nav.nav-tabs .nav-link {
cursor: pointer;
}
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057;
}
......
......@@ -6647,6 +6647,9 @@ a:hover {
.nav.nav-tabs .nav-link {
cursor: pointer;
}
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057;
}
......
......@@ -34,7 +34,7 @@ layout :: R2.Leaf Props
layout = R2.leaf layoutCpt
layoutCpt :: R.Component Props
layoutCpt = here.component "layout" cpt where
cpt { nodeId, nodeData: { name } } _ = do
cpt { nodeId, nodeData: { name, type_id } } _ = do
-- | Hooks
-- |
boxes@{
......
......@@ -23,6 +23,6 @@ loadingSpinnerCpt = here.component "LoadingSpinner" cpt where
-- cpt _ _ = H.i {className: "fa fa-circle-o-notch fa-spin fa-3x fa-fw"} [H.text ""]
cpt { additionalClass } _ = do
pure $ H.i { className: "fa fa-spinner fa-pulse fa-3x fa-fw " <> c } [H.text ""]
pure $ H.i { className: "fa fa-spinner fa-pulse fa-fw " <> c } [H.text ""]
where
c = fromMaybe "" additionalClass
......@@ -3,6 +3,8 @@ module Gargantext.Components.Tab where
import Data.FunctorWithIndex (mapWithIndex)
import Data.Tuple (Tuple)
import Data.Tuple.Nested ((/\))
import Gargantext.Components.Bootstrap as B
import Gargantext.Types as GT
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
......@@ -49,10 +51,19 @@ tabsCpt = here.component "tabs" cpt where
(mapWithIndex (item activeTab') tabs')
]
button activeTab selected index (name /\ _) =
H.a { className, on: { click } } [ H.text name ] where
H.a { className, on: { click } }
[
B.icon
{ className: "mx-1"
, name: iconName
}
,
H.span {} [ H.text name ]
] where
eq = index == selected
className = "nav-item nav-link" <> (if eq then " active" else "")
className = "tab-label_" <> name <> " nav-item nav-link" <> (if eq then " active" else "")
click _ = T.write_ index activeTab
iconName = GT.getTabIcon name
item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ]
-- TODO: document what these are (selection, item indices)
......
......@@ -166,11 +166,21 @@ tableHeaderWithRenameBoxedLayoutCpt = here.component "tableHeaderWithRenameBoxed
,
-}
H.div
{ className: "table-header-rename__title" }
{ className: "table-header-rename__title text-primary" }
[
B.div'
{ className: "table-header-rename__title__text" }
name
H.div { className: "table-header-rename__title__text" }
[
B.icon
{ className: "mx-1"
, name: "book"
}
,
H.span {}
[
H.text name
]
]
,
H.hr
{ className: "table-header-rename__title__line" }
......
......@@ -701,6 +701,15 @@ modeFromString "Sources" = Just Sources
modeFromString "Terms" = Just Terms
modeFromString _ = Nothing
getTabIcon :: String -> String
getTabIcon "Authors" = "list"
getTabIcon "Institutes" = "list"
getTabIcon "Sources" = "list"
getTabIcon "Terms" = "list"
getTabIcon "Documents" = "newspaper-o"
getTabIcon "Trash" = "trash"
getTabIcon _ = ""
-- Async tasks
-- corresponds to /add/form/async or /add/query/async
......
......@@ -2,6 +2,11 @@
.nav-link {
cursor: pointer;
.active {
font-weight: 500;
}
}
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link, li a {
......
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