Commit 6dc93d93 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DESIGN] increasing box if not many actions

parent ab4c05a4
...@@ -72,7 +72,7 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p [] ...@@ -72,7 +72,7 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
-> R.Element -> R.Element
panelBody (_ /\ setNodeName) (nt /\ setNodeType) = panelBody (_ /\ setNodeName) (nt /\ setNodeType) =
H.div {className: "panel-body"} H.div {className: "panel-body"}
[ H.div {className: "row"} [ H.div {className: "row", style: {"margin":"10px"}}
[ H.div {className: "col-md-10"} [ H.div {className: "col-md-10"}
[ H.form {className: "form-horizontal"} $ maybeChoose <> maybeEdit ] [ H.form {className: "form-horizontal"} $ maybeChoose <> maybeEdit ]
] ]
......
module Gargantext.Components.Forest.Tree.Node.Box where module Gargantext.Components.Forest.Tree.Node.Box where
import Data.Array (length)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Nullable (null) import Data.Nullable (null)
import Data.String as S import Data.String as S
...@@ -22,7 +23,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (actionUpload) ...@@ -22,7 +23,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (actionUpload)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS) import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox) import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT) import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Prelude (Unit, bind, const, map, pure, show, ($), (<>), (==)) import Gargantext.Prelude (Unit, bind, const, map, pure, show, ($), (<>), (==), (<))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID) import Gargantext.Types (Name, ID)
import Gargantext.Types as GT import Gargantext.Types as GT
...@@ -138,18 +139,22 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -138,18 +139,22 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
-> R.Element -> R.Element
panelBody nodePopupState {dispatch: d, nodeType} = panelBody nodePopupState {dispatch: d, nodeType} =
H.div {className: "panel-body flex-space-between"} H.div {className: "panel-body flex-space-between"}
[ H.p { "style": {"margin":"10px"}} [] $ [ H.p { "style": {"margin":"10px"}} []
, H.div { className: "flex-center"} , H.div { className: "flex-center"}
[ buttonClick { action: doc [ buttonClick { action: doc
, state: nodePopupState , state: nodePopupState
} }
] ]
, H.div {className: "flex-center"} , H.div {className: "flex-center"}
$ map (\t -> buttonClick { action: t $ map (\t -> buttonClick { action: t
, state : nodePopupState , state : nodePopupState
} }
) buttons ) buttons
] ]
-- FIXME trick to increase the size of the box
<> if length buttons < 2
then [H.div {className: "col-md-4"} []]
else []
where where
SettingsBox {edit, doc, buttons} = settingsBox nodeType SettingsBox {edit, doc, buttons} = settingsBox nodeType
......
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