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
2e7f246c
Commit
2e7f246c
authored
Apr 07, 2021
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Home: show folder view when logged in
parent
e8a6be94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
24 deletions
+36
-24
Home.purs
src/Gargantext/Components/Nodes/Home.purs
+36
-24
No files found.
src/Gargantext/Components/Nodes/Home.purs
View file @
2e7f246c
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 Reactix as R
import Reactix.DOM.HTML as H
import Routing.Hash (setHash)
import Toestand as T
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.FolderView as FV
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Nodes.Home.Public (renderPublic)
import Gargantext.License (license)
import Gargantext.Prelude -- (Unit, map, pure, unit, void, ($), (<>), (*>))
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)
import Toestand as T
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.Home"
...
...
@@ -87,7 +91,8 @@ joinButtonOrTutorial :: forall e. Sessions -> (e -> Effect Unit) -> R.Element
joinButtonOrTutorial sessions click =
if Sessions.null sessions
then joinButton click
else tutorial
-- sessions is not empty
else tutorial {session: unsafePartial $ fromJust $ Array.head $ Sessions.unSessions sessions}
joinButton :: forall e. (e -> Effect Unit) -> R.Element
joinButton click =
...
...
@@ -131,23 +136,30 @@ summary =
, H.ol {} (map toSummary tutos) ] ]
toSummary (Tuto x) = H.li {} [ H.a {href: "#" <> x.id} [ H.text x.title ]]
tutorial :: R.Element
tutorial =
H.div { className: "mx-auto container" }
[ H.h1 {} [H.text "Welcome!"]
, H.h2 {} [H.text "For easy start, just watch the tutorials"]
, summary
, H.h3 {} [H.text "Tutorial resources"]
, section "How to start?" "alert-info" startTutos
-- , section "How to play?" "alert-warning" playTutos
-- , section "How to master?" "alert-danger" expertTutos
]
where
section name class' tutos =
H.div {} $ Array.cons (H.h4 {} [ H.text name ]) (map (makeTuto class') tutos)
makeTuto class' (Tuto x) =
H.div { className : "alert " <> class', id: x.id}
[ video x.id, H.h4 {} [ H.text x.title ], H.p {} [ H.text x.text ] ]
tutorial :: R2.Leaf (session :: Session)
tutorial props = R.createElement tutorialCpt props []
tutorialCpt :: R.Component (session :: Session)
tutorialCpt = here.component "tutorial" cpt where
cpt {session: session@(Session {treeId})} _ = do
let nodeId = treeId
pure $ H.div { className: "mx-auto container" }
[ FV.folderViewLoad {session, nodeId}
, H.h1 {} [H.text "Welcome!"]
, H.h2 {} [H.text "For easy start, just watch the tutorials"]
, summary
, H.h3 {} [H.text "Tutorial resources"]
, section "How to start?" "alert-info" startTutos
-- , section "How to play?" "alert-warning" playTutos
-- , section "How to master?" "alert-danger" expertTutos
]
where
section name class' tutos =
H.div {} $ Array.cons (H.h4 {} [ H.text name ]) (map (makeTuto class') tutos)
makeTuto class' (Tuto x) =
H.div { className : "alert " <> class', id: x.id}
[ video x.id, H.h4 {} [ H.text x.title ], H.p {} [ H.text x.text ] ]
startTutos :: Array Tuto
startTutos =
...
...
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