[NGRAM] use the mode in loadPage

parent 215e7156
......@@ -493,9 +493,14 @@ type PageLoaderProps =
getTable :: TabType -> Maybe Int -> Aff NgramsTable
getTable tab = get <<< toUrl Back (Ngrams tab Nothing)
-- TODO TabTerms or TabAuthors ...
modeTabType :: Mode -> TabType
modeTabType Authors = TabAuthors
modeTabType Sources = TabSources
modeTabType Institutes = TabInstitutes
modeTabType Terms = TabTerms
loadPage :: PageParams -> Aff NgramsTable
loadPage {nodeId} = getTable TabTerms (Just nodeId) -- TODO this ignores params
loadPage {nodeId, mode} = getTable (modeTabType mode) (Just nodeId) -- TODO this ignores params
ngramsLoaderClass :: ReactClass (Loader.Props PageParams NgramsTable)
ngramsLoaderClass = Loader.createLoaderClass "NgramsLoader" loadPage
......
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