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
72f16c5a
Commit
72f16c5a
authored
Apr 30, 2021
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Home: show folders for all sessions
parent
614a6e1b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Home.purs
src/Gargantext/Components/Nodes/Home.purs
+10
-10
No files found.
src/Gargantext/Components/Nodes/Home.purs
View file @
72f16c5a
...
...
@@ -3,7 +3,6 @@ module Gargantext.Components.Nodes.Home where
import Gargantext.Prelude
import Data.Array as Array
import Data.Maybe (fromJust)
import Data.Newtype (class Newtype)
import Effect (Effect)
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
...
...
@@ -17,7 +16,6 @@ import Gargantext.Sessions (Sessions)
import Gargantext.Sessions as Sessions
import Gargantext.Sessions.Types (Session(..))
import Gargantext.Utils.Reactix as R2
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as H
import Routing.Hash (setHash)
...
...
@@ -91,8 +89,7 @@ joinButtonOrTutorial :: forall e. Sessions -> (e -> Effect Unit) -> R.Element
joinButtonOrTutorial sessions click =
if Sessions.null sessions
then joinButton click
-- sessions is not empty
else tutorial {session: unsafePartial $ fromJust $ Array.head $ Sessions.unSessions sessions}
else tutorial {sessions: Sessions.unSessions sessions}
joinButton :: forall e. (e -> Effect Unit) -> R.Element
joinButton click =
...
...
@@ -136,17 +133,16 @@ summary =
, H.ol {} (map toSummary tutos) ] ]
toSummary (Tuto x) = H.li {} [ H.a {href: "#" <> x.id} [ H.text x.title ]]
tutorial :: R2.Leaf (session
::
Session)
tutorial :: R2.Leaf (session
s :: Array
Session)
tutorial props = R.createElement tutorialCpt props []
tutorialCpt :: R.Component (session
::
Session)
tutorialCpt :: R.Component (session
s :: Array
Session)
tutorialCpt = here.component "tutorial" cpt where
cpt {session
: session@(Session {treeId})
} _ = do
let
nodeId = treeId
cpt {session
s
} _ = do
let
folders = makeFolders sessions
pure $ H.div { className: "mx-auto container" }
[ H.div {className: "d-flex justify-content-center"}
[FV.folderView {session, nodeId, backFolder: false}]
[ H.div {className: "d-flex justify-content-center"} folders
, H.h1 {} [H.text "Welcome!"]
, H.h2 {} [H.text "For easy start, just watch the tutorials"]
, summary
...
...
@@ -162,6 +158,10 @@ tutorialCpt = here.component "tutorial" cpt where
H.div { className : "alert " <> class', id: x.id}
[ video x.id, H.h4 {} [ H.text x.title ], H.p {} [ H.text x.text ] ]
makeFolders :: Array Session -> Array R.Element
makeFolders s = sessionToFolder <$> s where
sessionToFolder session@(Session {treeId}) = FV.folderView {session, nodeId: treeId, backFolder: false}
startTutos :: Array Tuto
startTutos =
[ Tuto { title: "The tree is your friend"
...
...
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