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
81931dc8
Commit
81931dc8
authored
May 30, 2023
by
Fabien Manière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding logout btn (without action yet)
parent
55589ac8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
17 deletions
+48
-17
Home.purs
src/Gargantext/Components/Nodes/Home.purs
+48
-17
No files found.
src/Gargantext/Components/Nodes/Home.purs
View file @
81931dc8
module Gargantext.Components.Nodes.Home
module Gargantext.Components.Nodes.Home
( Action(..)
(
Home
Action(..)
, HomeProps
, HomeProps
, State(..)
, State(..)
, Tuto(..)
, Tuto(..)
...
@@ -18,7 +18,7 @@ module Gargantext.Components.Nodes.Home
...
@@ -18,7 +18,7 @@ module Gargantext.Components.Nodes.Home
, jumboTitle
, jumboTitle
, langLandingData
, langLandingData
, license
, license
, performAction
, perform
Home
Action
, playTutos
, playTutos
, startTutos
, startTutos
, summary
, summary
...
@@ -30,19 +30,20 @@ module Gargantext.Components.Nodes.Home
...
@@ -30,19 +30,20 @@ module Gargantext.Components.Nodes.Home
import Gargantext.Prelude
import Gargantext.Prelude
import Data.Foldable (intercalate)
import Data.Foldable (intercalate
, for_
)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Effect (Effect)
import Effect (Effect)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..), Elevation(..), ModalSizing(..), Position(..), TooltipPosition(..), Variant(..))
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.FolderView as FV
import Gargantext.Components.FolderView as FV
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Config as Config
import Gargantext.Config as Config
import Gargantext.Sessions (Sessions)
import Gargantext.Sessions (Session
(..), Sessions, Action(Logout), unSession
s)
import Gargantext.Sessions as Sessions
import Gargantext.Sessions as Sessions
import Gargantext.Sessions.Types (Session(..), cleanBackendUrl)
import Gargantext.Sessions.Types (Session(..), cleanBackendUrl)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
...
@@ -51,6 +52,9 @@ import Reactix.DOM.HTML as H
...
@@ -51,6 +52,9 @@ import Reactix.DOM.HTML as H
import Routing.Hash (setHash)
import Routing.Hash (setHash)
import Toestand as T
import Toestand as T
import Effect.Console (log)
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.Home"
here = R2.here "Gargantext.Components.Nodes.Home"
...
@@ -61,17 +65,17 @@ derive instance Newtype State _
...
@@ -61,17 +65,17 @@ derive instance Newtype State _
initialState :: State
initialState :: State
initialState = State { userName: "", password: "" }
initialState = State { userName: "", password: "" }
data Action
data
Home
Action
= Documentation
= Documentation
| Enter
| Enter
| Login
| Login
| SignUp
| SignUp
perform
Action ::
Action -> Effect Unit
perform
HomeAction :: Home
Action -> Effect Unit
performAction Documentation = pure unit
perform
Home
Action Documentation = pure unit
performAction Enter = void $ setHash "/search"
perform
Home
Action Enter = void $ setHash "/search"
performAction Login = void $ setHash "/login"
perform
Home
Action Login = void $ setHash "/login"
performAction SignUp = pure unit
perform
Home
Action SignUp = pure unit
langLandingData :: LandingLang -> LandingData
langLandingData :: LandingLang -> LandingData
langLandingData LL_FR = Fr.landingData
langLandingData LL_FR = Fr.landingData
...
@@ -249,6 +253,13 @@ tutorialCpt = here.component "tutorial" cpt where
...
@@ -249,6 +253,13 @@ tutorialCpt = here.component "tutorial" cpt where
[ video x.id, H.h4 {} [ H.text x.title ], H.p {} [ H.text x.text ] ]
[ video x.id, H.h4 {} [ H.text x.title ], H.p {} [ H.text x.text ] ]
-}
-}
-- onSignOutClick _ = void $ Sessions.change (Logout session') sessions
onSignOutClick _ = do
log "Logging sessions:"
-- log show session'
for_ sessions $ \element -> log (show element)
makeFolders :: Array Session -> Array R.Element
makeFolders :: Array Session -> Array R.Element
makeFolders s = sessionToFolder <$> s
makeFolders s = sessionToFolder <$> s
where
where
...
@@ -266,14 +277,33 @@ tutorialCpt = here.component "tutorial" cpt where
...
@@ -266,14 +277,33 @@ tutorialCpt = here.component "tutorial" cpt where
B.wad
B.wad
[ "d-flex", "align-items-center" ]
[ "d-flex", "align-items-center" ]
[
[
B.icon
B.wad
{ name: "user" }
[ "text-left", "w-10/12" ]
,
[
B.wad_
B.icon
[ "virtual-space", "w-1" ]
{ name: "user", className: "pr-1" }
,
B.span_ $
username <> "@" <> cleanBackendUrl backend
]
,
,
B.span_ $
B.wad
username <> "@" <> cleanBackendUrl backend
[ "text-right", "w-2/12" ]
[
B.tooltipContainer
{ position: TooltipPosition Top
, delayShow: 600
, tooltipSlot:
B.span_ "Log out"
, defaultSlot:
B.iconButton
{ name: "sign-out"
, callback: onSignOutClick
, elevation: Level2
, className: "text-light"
}
}
]
]
]
]
]
,
,
...
@@ -286,6 +316,7 @@ tutorialCpt = here.component "tutorial" cpt where
...
@@ -286,6 +316,7 @@ tutorialCpt = here.component "tutorial" cpt where
}
}
]
]
]
]
startTutos :: Array Tuto
startTutos :: Array Tuto
startTutos =
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