diff --git a/dist/styles/Tree.css b/dist/styles/Tree.css index 790e317f94a5d09b2e79d93319b6e4686e9b5450..1a5e505e81ab92e7ec69e66a018937eb7d5b147e 100644 --- a/dist/styles/Tree.css +++ b/dist/styles/Tree.css @@ -13,6 +13,9 @@ .tree .node-actions .update-button.disabled { cursor: wait; } +.tree .lefthanded ul { + margin-right: 19px; +} .tree .lefthanded li .leaf { justify-content: flex-end; } diff --git a/dist/styles/Tree.sass b/dist/styles/Tree.sass index 58e0159479665e0008ab82c5d6a5cae79560d0c1..8a18333ab40ce29c18d06d3b08521d376f15b2f6 100644 --- a/dist/styles/Tree.sass +++ b/dist/styles/Tree.sass @@ -10,8 +10,10 @@ &.disabled cursor: wait .lefthanded - li - .leaf + ul + margin-right : 19px + li + .leaf justify-content : flex-end .righthanded diff --git a/src/Gargantext/Components/Forest.purs b/src/Gargantext/Components/Forest.purs index 8740f14de83a3cff61990519182ba04a2899b630..d4460f0cff8682b4ddd01342413a0c03dc8e0899 100644 --- a/src/Gargantext/Components/Forest.purs +++ b/src/Gargantext/Components/Forest.purs @@ -15,7 +15,7 @@ import Gargantext.Components.Forest.Tree (treeView) import Gargantext.Ends (Frontends) import Gargantext.Routes (AppRoute) import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions) -import Gargantext.Types (Reload, Handed) +import Gargantext.Types (Reload, Handed(..)) import Gargantext.Utils.Reactix as R2 type Props = @@ -49,7 +49,8 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where ) (cpt' openNodes asyncTasks reload showLogin) cpt' openNodes asyncTasks reload showLogin (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do - pure $ R.fragment $ A.cons (plus showLogin) trees + --pure $ R.fragment $ A.cons (plus showLogin) trees + pure $ R2.row $ [plus handed showLogin] <> trees where trees = tree <$> unSessions sessions tree s@(Session {treeId}) = @@ -63,8 +64,11 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where , session: s } -plus :: R2.Setter Boolean -> R.Element -plus showLogin = +plus :: Handed -> R2.Setter Boolean -> R.Element +plus handed showLogin = H.div {className: if handed == RightHanded + then "flex-start" + else "flex-end" + } [ H.button { on: {click} , className: "btn btn-default" } @@ -75,6 +79,7 @@ plus showLogin = --, H.div { "type": "", className: "fa fa-plus-circle fa-lg"} [] --, H.div { "type": "", className: "fa fa-minus-circle fa-lg"} [] ] + ] -- TODO same as the one in the Login Modal (same CSS) -- [ H.i { className: "material-icons md-36"} [] ] where diff --git a/src/Gargantext/Components/Forest/Tree.purs b/src/Gargantext/Components/Forest/Tree.purs index 658e8c16813be945f8357405b1835c5a8986270a..20e3019a63da0d62a40de41c163bf8b849f65f99 100644 --- a/src/Gargantext/Components/Forest/Tree.purs +++ b/src/Gargantext/Components/Forest/Tree.purs @@ -133,7 +133,8 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] , session , tasks , tree - } _ = pure $ H.ul { className: "tree"} + } _ = pure $ H.ul { className: "tree" + } [ H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" diff --git a/src/Gargantext/Components/Forest/Tree/Node.purs b/src/Gargantext/Components/Forest/Tree/Node.purs index f4799c93cd5fc95fd7cf3fff4b1906b9c717b1bd..91e781a4db4038484aa34f4de4f178663be0af97 100644 --- a/src/Gargantext/Components/Forest/Tree/Node.purs +++ b/src/Gargantext/Components/Forest/Tree/Node.purs @@ -142,7 +142,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl { className: "leaf " <> (dropClass droppedFile isDragOver) , on: { drop: dropHandler droppedFile , dragOver: onDragOverHandler isDragOver - , dragLeave: onDragLeave isDragOver } } + , dragLeave: onDragLeave isDragOver } + } where dropClass (Just _ /\ _) _ = "file-dropped" dropClass _ (true /\ _) = "file-dropped"