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