Hide Brevet state

parent df3a2470
module Gargantext.Pages.Corpus.User.Brevets where module Gargantext.Pages.Corpus.User.Brevets where
import Prelude import Prelude
import Data.Void import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
brevetsSpec :: Spec {} {} Void
type State = String brevetsSpec = simpleSpec defaultPerformAction render
initialState :: State
initialState = ""
type Action = Void
performAction :: PerformAction State {} Action
performAction action _ _ = absurd action
brevetsSpec :: Spec State {} Action
brevetsSpec = simpleSpec performAction render
where where
render :: Render State {} Action render :: Render {} {} Void
render dispatch _ state _ = render dispatch _ state _ =
[] []
...@@ -18,10 +18,10 @@ import Data.List (fromFoldable) ...@@ -18,10 +18,10 @@ import Data.List (fromFoldable)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Gargantext.Pages.Folder as PS import Gargantext.Pages.Folder as PS
import Gargantext.Components.Tab (tabs) import Gargantext.Components.Tab (tabs)
import Thermite (Spec, focus) import Thermite (Spec, focus, noState)
brevetSpec :: Spec State {} Action brevetSpec :: Spec State {} Action
brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec brevetSpec = noState B.brevetsSpec
projectSpec :: Spec State {} Action projectSpec :: Spec State {} Action
projectSpec = focus _projectslens _projectsAction PS.projets projectSpec = focus _projectslens _projectsAction PS.projets
......
...@@ -35,15 +35,6 @@ _pubAction = prism PublicationA \ action -> ...@@ -35,15 +35,6 @@ _pubAction = prism PublicationA \ action ->
publicationSpec :: Spec State {} Action publicationSpec :: Spec State {} Action
publicationSpec = focus _publens _pubAction P.publicationSpec 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' State PS.State
_projectslens = lens (\s -> s.projects) (\s ss -> s {projects = ss}) _projectslens = lens (\s -> s.projects) (\s ss -> s {projects = ss})
......
module Gargantext.Pages.Corpus.User.Users.Types.States where module Gargantext.Pages.Corpus.User.Users.Types.States where
import Gargantext.Pages.Corpus.User.Brevets as B
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Gargantext.Pages.Corpus.User.Users.Types.Types (User) import Gargantext.Pages.Corpus.User.Users.Types.Types (User)
import Gargantext.Pages.Folder as PS import Gargantext.Pages.Folder as PS
...@@ -10,7 +9,6 @@ import Gargantext.Components.Tab as Tab ...@@ -10,7 +9,6 @@ import Gargantext.Components.Tab as Tab
data Action data Action
= NoOp = NoOp
| PublicationA P.Action | PublicationA P.Action
| BrevetsA B.Action
| ProjectsA PS.Action | ProjectsA PS.Action
| TabA Tab.Action | TabA Tab.Action
| FetchUser Int | FetchUser Int
...@@ -18,7 +16,6 @@ data Action ...@@ -18,7 +16,6 @@ data Action
type State = type State =
{ activeTab :: Int { activeTab :: Int
, publications :: P.State , publications :: P.State
, brevets :: B.State
, projects :: PS.State , projects :: PS.State
, user :: Maybe User , user :: Maybe User
} }
...@@ -27,7 +24,6 @@ initialState :: State ...@@ -27,7 +24,6 @@ initialState :: State
initialState = initialState =
{ activeTab : 0 { activeTab : 0
, publications : P.initialState , publications : P.initialState
, brevets : B.initialState
, projects : PS.initialState , projects : PS.initialState
, user: Nothing , 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