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
41a1c318
Commit
41a1c318
authored
Apr 06, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor code
parent
3f2bb7a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
38 deletions
+34
-38
Tabview.purs
src/Tabview.purs
+34
-38
No files found.
src/Tabview.purs
View file @
41a1c318
...
@@ -48,32 +48,34 @@ _doclens :: Lens' State DV.State
...
@@ -48,32 +48,34 @@ _doclens :: Lens' State DV.State
_doclens = lens (\s -> s.docview) (\s ss -> s {docview = ss})
_doclens = lens (\s -> s.docview) (\s ss -> s {docview = ss})
_authorlens :: Lens' State AV.State
_docAction :: Prism' Action DV.Action
_authorlens = lens (\s -> s.authorview) (\s ss -> s {authorview = ss})
_docAction = prism DocviewA \ action ->
case action of
DocviewA laction -> Right laction
_-> Left action
_sourcelens :: Lens' State SV.State
_sourcelens = lens (\s -> s.sourceview) (\s ss -> s {sourceview = ss})
docPageSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
docPageSpec = focus _doclens _docAction DV.layoutDocview
_termslens :: Lens' State TV.State
_termslens = lens (\s -> s.termsview) (\s ss -> s {termsview = ss})
_authorlens :: Lens' State AV.State
_authorlens = lens (\s -> s.authorview) (\s ss -> s {authorview = ss})
_tablens :: Lens' State Tab.State
_tablens = lens (\s -> s.activeTab) (\s ss -> s {activeTab = ss})
_
tabAction :: Prism' Action Tab
.Action
_
authorAction :: Prism' Action AV
.Action
_
tabAction = prism TabV
iewA \ action ->
_
authorAction = prism Authorv
iewA \ action ->
case action of
case action of
TabV
iewA laction -> Right laction
Authorv
iewA laction -> Right laction
_-> Left action
_-> Left action
_docAction :: Prism' Action DV.Action
authorPageSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
_docAction = prism DocviewA \ action ->
authorPageSpec = focus _authorlens _authorAction AV.authorSpec
case action of
DocviewA laction -> Right laction
_-> Left action
_sourcelens :: Lens' State SV.State
_sourcelens = lens (\s -> s.sourceview) (\s ss -> s {sourceview = ss})
_sourceAction :: Prism' Action SV.Action
_sourceAction :: Prism' Action SV.Action
_sourceAction = prism SourceviewA \ action ->
_sourceAction = prism SourceviewA \ action ->
...
@@ -81,11 +83,13 @@ _sourceAction = prism SourceviewA \ action ->
...
@@ -81,11 +83,13 @@ _sourceAction = prism SourceviewA \ action ->
SourceviewA laction -> Right laction
SourceviewA laction -> Right laction
_-> Left action
_-> Left action
_authorAction :: Prism' Action AV.Action
_authorAction = prism AuthorviewA \ action ->
sourcePageSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
case action of
sourcePageSpec = focus _sourcelens _sourceAction SV.sourceSpec
AuthorviewA laction -> Right laction
_-> Left action
_termslens :: Lens' State TV.State
_termslens = lens (\s -> s.termsview) (\s ss -> s {termsview = ss})
_termsAction :: Prism' Action TV.Action
_termsAction :: Prism' Action TV.Action
...
@@ -94,29 +98,21 @@ _termsAction = prism TermsviewA \ action ->
...
@@ -94,29 +98,21 @@ _termsAction = prism TermsviewA \ action ->
TermsviewA laction -> Right laction
TermsviewA laction -> Right laction
_-> Left action
_-> Left action
docPageSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
docPageSpec = focus _doclens _docAction DV.layoutDocview
authorPageSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
authorPageSpec = focus _authorlens _authorAction AV.authorSpec
sourcePageSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
sourcePageSpec = focus _sourcelens _sourceAction SV.sourceSpec
termsPageSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
termsPageSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
termsPageSpec = focus _termslens _termsAction TV.termsSpec
termsPageSpec = focus _termslens _termsAction TV.termsSpec
docPageActionSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
docPageActionSpec = simpleSpec (view _performAction docPageSpec) defaultRender
sourcePagesActionSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
_tablens :: Lens' State Tab.State
sourcePagesActionSpec = simpleSpec (view _performAction sourcePageSpec) defaultRender
_tablens = lens (\s -> s.activeTab) (\s ss -> s {activeTab = ss})
authorPageActionSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
authorPageActionSpec = simpleSpec (view _performAction authorPageSpec) defaultRender
termsPageActionSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
termsPageActionSpec = simpleSpec (view _performAction termsPageSpec) defaultRender
_tabAction :: Prism' Action Tab.Action
_tabAction = prism TabViewA \ action ->
case action of
TabViewA laction -> Right laction
_-> Left action
...
...
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