Hide Brevet state

parent df3a2470
module Gargantext.Pages.Corpus.User.Brevets where
import Prelude
import Data.Void
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
type State = String
initialState :: State
initialState = ""
type Action = Void
performAction :: PerformAction State {} Action
performAction action _ _ = absurd action
brevetsSpec :: Spec State {} Action
brevetsSpec = simpleSpec performAction render
brevetsSpec :: Spec {} {} Void
brevetsSpec = simpleSpec defaultPerformAction render
where
render :: Render State {} Action
render :: Render {} {} Void
render dispatch _ state _ =
[]
......@@ -18,10 +18,10 @@ import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Gargantext.Pages.Folder as PS
import Gargantext.Components.Tab (tabs)
import Thermite (Spec, focus)
import Thermite (Spec, focus, noState)
brevetSpec :: Spec State {} Action
brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec
brevetSpec = noState B.brevetsSpec
projectSpec :: Spec State {} Action
projectSpec = focus _projectslens _projectsAction PS.projets
......
......@@ -35,15 +35,6 @@ _pubAction = prism PublicationA \ action ->
publicationSpec :: Spec State {} Action
publicationSpec = focus _publens _pubAction P.publicationSpec
_brevetslens :: Lens' State B.State
_brevetslens = lens (\s -> s.brevets) (\s ss -> s {brevets = ss})
_brevetsAction :: Prism' Action B.Action
_brevetsAction = prism BrevetsA \ action ->
case action of
BrevetsA laction -> Right laction
_-> Left action
_projectslens :: Lens' State PS.State
_projectslens = lens (\s -> s.projects) (\s ss -> s {projects = ss})
......
module Gargantext.Pages.Corpus.User.Users.Types.States where
import Gargantext.Pages.Corpus.User.Brevets as B
import Data.Maybe (Maybe(..))
import Gargantext.Pages.Corpus.User.Users.Types.Types (User)
import Gargantext.Pages.Folder as PS
......@@ -10,7 +9,6 @@ import Gargantext.Components.Tab as Tab
data Action
= NoOp
| PublicationA P.Action
| BrevetsA B.Action
| ProjectsA PS.Action
| TabA Tab.Action
| FetchUser Int
......@@ -18,7 +16,6 @@ data Action
type State =
{ activeTab :: Int
, publications :: P.State
, brevets :: B.State
, projects :: PS.State
, user :: Maybe User
}
......@@ -27,7 +24,6 @@ initialState :: State
initialState =
{ activeTab : 0
, publications : P.initialState
, brevets : B.initialState
, projects : PS.initialState
, user: Nothing
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment