Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
650d443f
Commit
650d443f
authored
Nov 12, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[app] footer, simple layout refactoring
parent
5c7de476
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
39 deletions
+67
-39
App.purs
src/Gargantext/Components/App.purs
+7
-39
Footer.purs
src/Gargantext/Components/Footer.purs
+30
-0
SimpleLayout.purs
src/Gargantext/Components/SimpleLayout.purs
+30
-0
No files found.
src/Gargantext/Components/App.purs
View file @
650d443f
module Gargantext.Components.App where
import Data.Array (fromFoldable, reverse)
import Data.Foldable (intercalate)
import Data.Array (fromFoldable)
import Data.Maybe (Maybe(..), maybe')
import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.
AsyncTasks as GAT
import Gargantext.Components.Forest (forest
, forest
Layout)
import Gargantext.
Components.Footer (footer)
import Gargantext.Components.Forest (forestLayout)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Login (login)
...
...
@@ -25,14 +22,12 @@ import Gargantext.Components.Nodes.Frame (frameLayout)
import Gargantext.Components.Nodes.Home (homeLayout)
import Gargantext.Components.Nodes.Lists (listsLayout)
import Gargantext.Components.Nodes.Texts (textsLayout)
import Gargantext.Components.
TopBar (topBar
)
import Gargantext.Components.
SimpleLayout (simpleLayout
)
import Gargantext.Config (defaultFrontends, defaultBackends, publicBackend)
import Gargantext.Ends (Frontends, Backend)
import Gargantext.Hooks.Router (useHashRouter)
import Gargantext.License (license)
import Gargantext.Router (router)
import Gargantext.Routes (AppRoute(..))
import Gargantext.Sessions (
Sessions,
useSessions)
import Gargantext.Sessions (useSessions)
import Gargantext.Sessions as Sessions
import Gargantext.Types as GT
...
...
@@ -142,7 +137,7 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
PGraphExplorer sid graphId ->
withSession sid $
\session ->
simpleLayout
handed $
simpleLayout
{ handed } [
explorerLayout { asyncTasksRef
, backend
, frontends
...
...
@@ -153,6 +148,7 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, sessions: (fst sessions)
, showLogin
}
]
RouteFile sid nodeId -> withSession sid $ \session -> forested [ fileLayout { nodeId, session } ]
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameCalc, session }
...
...
@@ -179,31 +175,3 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, treeReloadRef
}
]
-- Simple layout does not accommodate the tree
simpleLayout :: R.State GT.Handed -> R.Element -> R.Element
simpleLayout handed child = H.div { className: "simple-layout" } [
topBar { handed }
, child
, license
]
---------------------------------------------------------------------------
type FooterProps =
(
session :: Sessions.Session
)
footer :: Record FooterProps -> R.Element
footer props = R.createElement footerCpt props []
footerCpt :: R.Component FooterProps
footerCpt = R.hooksComponentWithModule thisModule "footer" cpt
where
cpt { session } _ = do
pure $ H.div
{ className: "container" }
[ H.hr {}
, H.footer {} []
]
src/Gargantext/Components/Footer.purs
0 → 100644
View file @
650d443f
module Gargantext.Components.Footer where
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Sessions as Sessions
thisModule :: String
thisModule = "Gargantext.Components.Footer"
---------------------------------------------------------------------------
type FooterProps =
(
session :: Sessions.Session
)
footer :: Record FooterProps -> R.Element
footer props = R.createElement footerCpt props []
footerCpt :: R.Component FooterProps
footerCpt = R.hooksComponentWithModule thisModule "footer" cpt
where
cpt { session } _ = do
pure $ H.div
{ className: "container" }
[ H.hr {}
, H.footer {} []
]
src/Gargantext/Components/SimpleLayout.purs
0 → 100644
View file @
650d443f
module Gargantext.Components.SimpleLayout where
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.TopBar (topBar)
import Gargantext.License (license)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.SimpleLayout"
-- Simple layout does not accommodate the tree
type SimpleLayoutProps = (
handed :: R.State GT.Handed
)
simpleLayout :: R2.Component SimpleLayoutProps
simpleLayout = R.createElement simpleLayoutCpt
simpleLayoutCpt :: R.Component SimpleLayoutProps
simpleLayoutCpt = R.hooksComponentWithModule thisModule "simpleLayout" cpt
where
cpt { handed } children = do
pure $ H.div { className: "simple-layout" } (
[ topBar { handed } ] <> children <> [ license ]
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment