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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
e02121a7
Commit
e02121a7
authored
Apr 06, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search bar as a spec done
parent
f5aa2ab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
Navigation.purs
src/Navigation.purs
+19
-9
No files found.
src/Navigation.purs
View file @
e02121a7
...
...
@@ -2,7 +2,6 @@ module Navigation where
import DOM
import Gargantext.Data.Lang
import Prelude hiding (div)
import AddCorpusview as AC
import AnnotationDocumentView as D
...
...
@@ -19,13 +18,15 @@ import Login as LN
import NTree as NT
import Network.HTTP.Affjax (AJAX)
import PageRouter (Routes(..))
import Prelude hiding (div)
import React (ReactElement)
import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span, text, ul)
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onC
hange, onC
lick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props as RP
import SearchForm as S
import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import UserPage as UP
...
...
@@ -42,6 +43,7 @@ type AppState =
, annotationdocumentView :: D.State
, ntreeView :: NT.State
, tabview :: TV.State
, search :: String
}
initAppState :: AppState
...
...
@@ -56,6 +58,7 @@ initAppState =
, annotationdocumentView : D.initialState
, ntreeView : NT.exampleTree
, tabview : TV.initialState
, search : ""
}
data Action
...
...
@@ -70,6 +73,8 @@ data Action
| AnnotationDocumentViewA D.Action
| TreeViewA NT.Action
| TabViewA TV.Action
| Search String
| Go
performAction :: forall eff props. PerformAction ( dom :: DOM
...
...
@@ -78,8 +83,15 @@ performAction :: forall eff props. PerformAction ( dom :: DOM
performAction (SetRoute route) _ _ = void do
modifyState $ _ {currentRoute = pure route}
performAction (Search s) _ _ = void do
modifyState $ _ {search = s}
performAction Go _ _ = void do
modifyState id
performAction _
_ _ = void do
performAction _ _ _ = void do
modifyState id
...
...
@@ -408,15 +420,13 @@ divSearchBar = simpleSpec performAction render
, placeholder "Query, URL or FILE (works with Firefox or Chromium browsers)"
, _type "text"
, style { height: "35px"
-- , color: "white"
-- , background : "#A1C2D8"
}
, onChange \e -> dispatch $ Search (unsafeCoerce e).target.value
] []
-- TODO add button in navbar (and "enter" execution)
-- , div [] [button [][]
]
, div []
[ button [onClick \e -> dispatch Go, className "btn btn-primary", style {marginTop : "10px"}] [text "Enter"]
]
]
]
]
...
...
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