Commit 81ccb3fa authored by Karen Konou's avatar Karen Konou

[Corpus fields] basic UI

parent bfa9c156
...@@ -58,9 +58,9 @@ renameableTextCpt = here.component "renameableText" cpt ...@@ -58,9 +58,9 @@ renameableTextCpt = here.component "renameableText" cpt
isEditing' <- T.useLive T.unequal isEditing isEditing' <- T.useLive T.unequal isEditing
pure $ if isEditing' then pure $ if isEditing' then
notEditing props []
else
editing props [] editing props []
else
notEditing props []
notEditing :: R2.Component RenameableTextProps notEditing :: R2.Component RenameableTextProps
...@@ -103,7 +103,7 @@ editingCpt = here.component "editing" cpt ...@@ -103,7 +103,7 @@ editingCpt = here.component "editing" cpt
, type: "text" , type: "text"
} }
, H.div { className: "btn input-group-append" , H.div { className: "btn input-group-append"
, on: { click: submit } } , on: { click: submit state' } }
[ H.span { className: "fa fa-floppy-o" } [] [ H.span { className: "fa fa-floppy-o" } []
] ]
] ]
......
module Gargantext.Components.Table where module Gargantext.Components.Table where
import Gargantext.Prelude
import Data.Array as A import Data.Array as A
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Sequence as Seq import Data.Sequence as Seq
import Effect (Effect) import Effect (Effect)
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Components.FolderView as FV import Gargantext.Components.FolderView as FV
import Gargantext.Components.Table.Types (ColumnName, OrderBy, OrderByDirection(..), Params, Props, TableContainerProps, columnName)
import Gargantext.Components.Nodes.Lists.Types as NT import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Renameable (renameable)
import Gargantext.Components.Search (SearchType(..)) import Gargantext.Components.Search (SearchType(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Components.Table.Types (ColumnName, OrderBy, OrderByDirection(..), Params, Props, TableContainerProps, columnName)
import Gargantext.Utils.Reactix (effectLink) import Gargantext.Utils.Reactix (effectLink)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Table" here = R2.here "Gargantext.Components.Table"
...@@ -55,6 +55,10 @@ initialParams :: Params ...@@ -55,6 +55,10 @@ initialParams :: Params
initialParams = stateParams {page: 1, pageSize: PS10, orderBy: Nothing, searchType: SearchDoc} initialParams = stateParams {page: 1, pageSize: PS10, orderBy: Nothing, searchType: SearchDoc}
-- TODO: Not sure this is the right place for this -- TODO: Not sure this is the right place for this
onRenameDummy :: String -> Effect Unit
onRenameDummy _ = do
pure unit
tableHeaderLayout :: R2.Component TableHeaderLayoutProps tableHeaderLayout :: R2.Component TableHeaderLayoutProps
tableHeaderLayout = R.createElement tableHeaderLayoutCpt tableHeaderLayout = R.createElement tableHeaderLayoutCpt
tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps
...@@ -67,7 +71,7 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt ...@@ -67,7 +71,7 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt
[ R2.row [FV.backButton {} []] [ R2.row [FV.backButton {} []]
, ,
R2.row R2.row
[ H.div {className: "col-md-3"} [ H.h3 {} [H.text title] ] [ H.div {className: "col-md-3"} [ H.h3 {} [renameable {text: title, onRename: onRenameDummy} []] ]
, H.div {className: "col-md-9"} , H.div {className: "col-md-9"}
[ H.hr {style: {height: "2px", backgroundColor: "black"}} ] [ H.hr {style: {height: "2px", backgroundColor: "black"}} ]
] ]
...@@ -75,11 +79,11 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt ...@@ -75,11 +79,11 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt
[ H.div {className: "col-md-8 content"} [ H.div {className: "col-md-8 content"}
[ H.p {} [ H.p {}
[ H.span {className: "fa fa-globe"} [] [ H.span {className: "fa fa-globe"} []
, H.text $ " " <> desc , renameable {text: " " <> desc, onRename: onRenameDummy} []
] ]
, H.p {} , H.p {}
[ H.span {className: "fa fa-search-plus"} [] [ H.span {className: "fa fa-search-plus"} []
, H.text $ " " <> query , renameable {text: " " <> query, onRename: onRenameDummy} []
] ]
, H.p { className: "cache-toggle" , H.p { className: "cache-toggle"
, on: { click: cacheClick cacheState } } , on: { click: cacheClick cacheState } }
...@@ -90,11 +94,11 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt ...@@ -90,11 +94,11 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt
, H.div {className: "col-md-4 content"} , H.div {className: "col-md-4 content"}
[ H.p {} [ H.p {}
[ H.span {className: "fa fa-calendar"} [] [ H.span {className: "fa fa-calendar"} []
, H.text $ " " <> date , renameable {text: " " <> date, onRename: onRenameDummy} []
] ]
, H.p {} , H.p {}
[ H.span {className: "fa fa-user"} [] [ H.span {className: "fa fa-user"} []
, H.text $ " " <> user , renameable {text: " " <> user, onRename: onRenameDummy} []
] ]
] ]
] ]
......
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