Actions.purs 540 Bytes
Newer Older
1 2 3 4
module Gargantext.Pages.Home.Actions where

import Prelude hiding (div)

Sudhir Kumar's avatar
Sudhir Kumar committed
5 6 7
import Effect.Class (liftEffect)
import Gargantext.Pages.Home.States (State)
import Routing.Hash (setHash)
8
import Thermite (PerformAction)
9 10

data Action
Nicolas Pouillard's avatar
Nicolas Pouillard committed
11
  = Documentation
12 13 14 15 16
  | Enter
  | Login
  | SignUp


17
performAction :: PerformAction State {} Action
Nicolas Pouillard's avatar
Nicolas Pouillard committed
18
performAction Documentation _ _ = pure unit
19 20

performAction Enter _ _ = void do
Sudhir Kumar's avatar
Sudhir Kumar committed
21
  liftEffect $ setHash "/search"
22 23

performAction Login _ _ = void do
Sudhir Kumar's avatar
Sudhir Kumar committed
24
  liftEffect $ setHash "/login"
25

Nicolas Pouillard's avatar
Nicolas Pouillard committed
26
performAction SignUp _ _ = pure unit