Commit 21252bab authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[refactoring] fix broken Cpt refactoring

parent e8ade662
...@@ -38,10 +38,10 @@ type Props = ( ...@@ -38,10 +38,10 @@ type Props = (
forest :: R2.Component Props forest :: R2.Component Props
forest = R.createElement forestCpt forest = R.createElement forestCpt
where
forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt
forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt
where
cpt { appReload cpt { appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
...@@ -124,10 +124,10 @@ type ForestLayoutProps = ( ...@@ -124,10 +124,10 @@ type ForestLayoutProps = (
forestLayout :: R2.Component ForestLayoutProps forestLayout :: R2.Component ForestLayoutProps
forestLayout props = R.createElement forestLayoutCpt props forestLayout props = R.createElement forestLayoutCpt props
where
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
where
cpt props@{ handed } children = do cpt props@{ handed } children = do
pure $ R.fragment [ topBar { handed } [], forestLayoutMain props children ] pure $ R.fragment [ topBar { handed } [], forestLayoutMain props children ]
...@@ -135,10 +135,10 @@ forestLayout props = R.createElement forestLayoutCpt props ...@@ -135,10 +135,10 @@ forestLayout props = R.createElement forestLayoutCpt props
-- while the remaining ones are put into the main view -- while the remaining ones are put into the main view
forestLayoutWithTopBar :: R2.Component ForestLayoutProps forestLayoutWithTopBar :: R2.Component ForestLayoutProps
forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
where
forestLayoutWithTopBarCpt :: R.Component ForestLayoutProps
forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutWithTopBar" cpt
forestLayoutWithTopBarCpt :: R.Component ForestLayoutProps
forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutWithTopBar" cpt
where
cpt props@{ handed } children = do cpt props@{ handed } children = do
let { head: topBarChild, tail: mainChildren } = let { head: topBarChild, tail: mainChildren } =
fromMaybe { head: H.div {} [], tail: [] } $ A.uncons children fromMaybe { head: H.div {} [], tail: [] } $ A.uncons children
...@@ -149,10 +149,10 @@ forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props ...@@ -149,10 +149,10 @@ forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
forestLayoutMain :: R2.Component ForestLayoutProps forestLayoutMain :: R2.Component ForestLayoutProps
forestLayoutMain props = R.createElement forestLayoutMainCpt props forestLayoutMain props = R.createElement forestLayoutMainCpt props
where
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
where
cpt props children = do cpt props children = do
pure $ forestLayoutRaw props [ pure $ forestLayoutRaw props [
mainPage {} children mainPage {} children
...@@ -160,10 +160,10 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props ...@@ -160,10 +160,10 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props
forestLayoutRaw :: R2.Component ForestLayoutProps forestLayoutRaw :: R2.Component ForestLayoutProps
forestLayoutRaw props = R.createElement forestLayoutRawCpt props forestLayoutRaw props = R.createElement forestLayoutRawCpt props
where
forestLayoutRawCpt :: R.Component ForestLayoutProps
forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
forestLayoutRawCpt :: R.Component ForestLayoutProps
forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
where
cpt { appReload cpt { appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
...@@ -194,10 +194,10 @@ forestLayoutRaw props = R.createElement forestLayoutRawCpt props ...@@ -194,10 +194,10 @@ forestLayoutRaw props = R.createElement forestLayoutRawCpt props
mainPage :: R2.Component () mainPage :: R2.Component ()
mainPage = R.createElement mainPageCpt mainPage = R.createElement mainPageCpt
where
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
where
cpt {} children = do cpt {} children = do
pure $ H.div {className: "col-md-10"} [ pure $ H.div {className: "col-md-10"} [
H.div {id: "page-wrapper"} [ H.div {id: "page-wrapper"} [
......
...@@ -63,11 +63,11 @@ type Props = ( ...@@ -63,11 +63,11 @@ type Props = (
) )
treeView :: R2.Component Props treeView :: R2.Component Props
treeView = R.createElement elCpt treeView = R.createElement treeViewCpt
where
elCpt :: R.Component Props
elCpt = R.hooksComponentWithModule thisModule "treeView" cpt
treeViewCpt :: R.Component Props
treeViewCpt = R.hooksComponentWithModule thisModule "treeView" cpt
where
cpt { appReload cpt { appReload
, asyncTasks , asyncTasks
, currentRoute , currentRoute
...@@ -90,11 +90,11 @@ treeView = R.createElement elCpt ...@@ -90,11 +90,11 @@ treeView = R.createElement elCpt
} [] } []
treeLoadView :: R2.Component Props treeLoadView :: R2.Component Props
treeLoadView = R.createElement elCpt treeLoadView = R.createElement treeLoadViewCpt
where
elCpt :: R.Component Props
elCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt
treeLoadViewCpt :: R.Component Props
treeLoadViewCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt
where
cpt { appReload cpt { appReload
, asyncTasks , asyncTasks
, currentRoute , currentRoute
...@@ -135,11 +135,11 @@ type TreeViewProps = ( ...@@ -135,11 +135,11 @@ type TreeViewProps = (
) )
loadedTreeViewFirstLevel :: R2.Component TreeViewProps loadedTreeViewFirstLevel :: R2.Component TreeViewProps
loadedTreeViewFirstLevel = R.createElement elCpt loadedTreeViewFirstLevel = R.createElement loadedTreeViewFirstLevelCpt
where
elCpt :: R.Component TreeViewProps
elCpt = R.hooksComponentWithModule thisModule "loadedTreeViewFirstLevel" cpt
loadedTreeViewFirstLevelCpt :: R.Component TreeViewProps
loadedTreeViewFirstLevelCpt = R.hooksComponentWithModule thisModule "loadedTreeViewFirstLevel" cpt
where
cpt { appReload cpt { appReload
, asyncTasks , asyncTasks
, currentRoute , currentRoute
...@@ -180,11 +180,11 @@ type ToHtmlProps = ( ...@@ -180,11 +180,11 @@ type ToHtmlProps = (
) )
toHtmlFirstLevel :: R2.Component ToHtmlProps toHtmlFirstLevel :: R2.Component ToHtmlProps
toHtmlFirstLevel = R.createElement elCpt toHtmlFirstLevel = R.createElement toHtmlFirstLevelCpt
where
elCpt :: R.Component ToHtmlProps
elCpt = R.hooksComponentWithModule thisModule "toHtmlFirstLevel" cpt
toHtmlFirstLevelCpt :: R.Component ToHtmlProps
toHtmlFirstLevelCpt = R.hooksComponentWithModule thisModule "toHtmlFirstLevel" cpt
where
cpt p@{ appReload cpt p@{ appReload
, asyncTasks , asyncTasks
, currentRoute , currentRoute
...@@ -268,11 +268,11 @@ type ChildNodeFirstLevelProps = ( ...@@ -268,11 +268,11 @@ type ChildNodeFirstLevelProps = (
) )
childNodeFirstLevel :: R2.Component ChildNodeFirstLevelProps childNodeFirstLevel :: R2.Component ChildNodeFirstLevelProps
childNodeFirstLevel = R.createElement elCpt childNodeFirstLevel = R.createElement childNodeFirstLevelCpt
where
elCpt :: R.Component ChildNodeFirstLevelProps
elCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevel" cpt
childNodeFirstLevelCpt :: R.Component ChildNodeFirstLevelProps
childNodeFirstLevelCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevel" cpt
where
cpt props@{ appReload cpt props@{ appReload
, asyncTasks , asyncTasks
, currentRoute , currentRoute
...@@ -313,11 +313,11 @@ type ChildNodeFirstLevelPaintProps = ( ...@@ -313,11 +313,11 @@ type ChildNodeFirstLevelPaintProps = (
) )
childNodeFirstLevelPaint :: R2.Component ChildNodeFirstLevelPaintProps childNodeFirstLevelPaint :: R2.Component ChildNodeFirstLevelPaintProps
childNodeFirstLevelPaint = R.createElement elCpt childNodeFirstLevelPaint = R.createElement childNodeFirstLevelPainCpt
where
elCpt :: R.Component ChildNodeFirstLevelPaintProps
elCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevelPaint" cpt
childNodeFirstLevelPainCpt :: R.Component ChildNodeFirstLevelPaintProps
childNodeFirstLevelPainCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevelPaint" cpt
where
-- TODO folderOpen is unused -- TODO folderOpen is unused
cpt props@{ asyncTasks cpt props@{ asyncTasks
......
...@@ -60,19 +60,19 @@ type IsLeaf = Boolean ...@@ -60,19 +60,19 @@ type IsLeaf = Boolean
nodeSpan :: R2.Component NodeMainSpanProps nodeSpan :: R2.Component NodeMainSpanProps
nodeSpan = R.createElement nodeSpanCpt nodeSpan = R.createElement nodeSpanCpt
where
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
where
cpt props children = do cpt props children = do
pure $ H.div {} ([ nodeMainSpan props [] ] <> children) pure $ H.div {} ([ nodeMainSpan props [] ] <> children)
nodeMainSpan :: R2.Component NodeMainSpanProps nodeMainSpan :: R2.Component NodeMainSpanProps
nodeMainSpan = R.createElement nodeMainSpanCpt nodeMainSpan = R.createElement nodeMainSpanCpt
where
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
where
cpt props@{ appReload cpt props@{ appReload
, asyncTasks: (asyncTasks /\ dispatchAsyncTasks) , asyncTasks: (asyncTasks /\ dispatchAsyncTasks)
, currentRoute , currentRoute
...@@ -249,10 +249,10 @@ type NodeActionsProps = ...@@ -249,10 +249,10 @@ type NodeActionsProps =
nodeActions :: Record NodeActionsProps -> R.Element nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p [] nodeActions p = R.createElement nodeActionsCpt p []
where
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
where
cpt { id cpt { id
, nodeType: GT.Graph , nodeType: GT.Graph
, session , session
......
...@@ -24,10 +24,10 @@ moveNodeReq session fromId toId = ...@@ -24,10 +24,10 @@ moveNodeReq session fromId toId =
moveNode :: Record SubTreeParamsIn -> R.Element moveNode :: Record SubTreeParamsIn -> R.Element
moveNode p = R.createElement moveNodeCpt p [] moveNode p = R.createElement moveNodeCpt p []
where
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
where
cpt { dispatch, handed, id, nodeType, session, subTreeParams } _ = do cpt { dispatch, handed, id, nodeType, session, subTreeParams } _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
......
...@@ -41,10 +41,10 @@ type SearchIFramesProps = ( ...@@ -41,10 +41,10 @@ type SearchIFramesProps = (
searchIframes :: Record SearchIFramesProps -> R.Element searchIframes :: Record SearchIFramesProps -> R.Element
searchIframes props = R.createElement searchIframesCpt props [] searchIframes props = R.createElement searchIframesCpt props []
where
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R.hooksComponentWithModule thisModule "searchIframes" cpt
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R.hooksComponentWithModule thisModule "searchIframes" cpt
where
cpt { iframeRef, search: search@(search' /\ _) } _ = do cpt { iframeRef, search: search@(search' /\ _) } _ = do
pure $ if isIsTex_Advanced search'.datafield pure $ if isIsTex_Advanced search'.datafield
then divIframe { frameSource: Istex, iframeRef, search } then divIframe { frameSource: Istex, iframeRef, search }
...@@ -62,10 +62,10 @@ type IFrameProps = ( ...@@ -62,10 +62,10 @@ type IFrameProps = (
divIframe :: Record IFrameProps -> R.Element divIframe :: Record IFrameProps -> R.Element
divIframe props = R.createElement divIframeCpt props [] divIframe props = R.createElement divIframeCpt props []
where
divIframeCpt :: R.Component IFrameProps
divIframeCpt = R.hooksComponentWithModule thisModule "divIframe" cpt
divIframeCpt :: R.Component IFrameProps
divIframeCpt = R.hooksComponentWithModule thisModule "divIframe" cpt
where
cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do
pure $ H.div { className: "frame-search card" } pure $ H.div { className: "frame-search card" }
[ iframeWith { frameSource, iframeRef, search } ] [ iframeWith { frameSource, iframeRef, search } ]
...@@ -77,10 +77,10 @@ frameUrl Searx = "https://searx.frame.gargantext.org" -- 192.168.1.4:8080" ...@@ -77,10 +77,10 @@ frameUrl Searx = "https://searx.frame.gargantext.org" -- 192.168.1.4:8080"
iframeWith :: Record IFrameProps -> R.Element iframeWith :: Record IFrameProps -> R.Element
iframeWith props = R.createElement iframeWithCpt props [] iframeWith props = R.createElement iframeWithCpt props []
where
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R.hooksComponentWithModule thisModule "iframeWith" cpt
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R.hooksComponentWithModule thisModule "iframeWith" cpt
where
cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ = cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ =
pure $ H.iframe { src: src frameSource search.term pure $ H.iframe { src: src frameSource search.term
, width: "100%" , width: "100%"
......
...@@ -26,10 +26,10 @@ type Props = ( langs :: Array Lang ...@@ -26,10 +26,10 @@ type Props = ( langs :: Array Lang
searchBar :: Record Props -> R.Element searchBar :: Record Props -> R.Element
searchBar props = R.createElement searchBarCpt props [] searchBar props = R.createElement searchBarCpt props []
where
searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
where
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
--onSearchChange session s --onSearchChange session s
pure $ H.div { className: "search-bar" } pure $ H.div { className: "search-bar" }
......
...@@ -266,10 +266,10 @@ type DatabaseInputProps = ( ...@@ -266,10 +266,10 @@ type DatabaseInputProps = (
databaseInput :: R2.Component DatabaseInputProps databaseInput :: R2.Component DatabaseInputProps
databaseInput = R.createElement databaseInputCpt databaseInput = R.createElement databaseInputCpt
where
databaseInputCpt :: R.Component DatabaseInputProps
databaseInputCpt = R.hooksComponentWithModule thisModule "databaseInput" cpt
databaseInputCpt :: R.Component DatabaseInputProps
databaseInputCpt = R.hooksComponentWithModule thisModule "databaseInput" cpt
where
cpt { databases cpt { databases
, search: (search /\ setSearch) } _ = do , search: (search /\ setSearch) } _ = do
pure $ pure $
...@@ -338,10 +338,10 @@ type SearchInputProps = ...@@ -338,10 +338,10 @@ type SearchInputProps =
searchInput :: Record SearchInputProps -> R.Element searchInput :: Record SearchInputProps -> R.Element
searchInput p = R.createElement searchInputCpt p [] searchInput p = R.createElement searchInputCpt p []
where
searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
where
cpt {search: (search@{ term } /\ setSearch)} _ = do cpt {search: (search@{ term } /\ setSearch)} _ = do
valueRef <- R.useRef term valueRef <- R.useRef term
......
...@@ -57,10 +57,10 @@ instance encodeJsonShareNodeParams :: Argonaut.EncodeJson ShareNodeParams where ...@@ -57,10 +57,10 @@ instance encodeJsonShareNodeParams :: Argonaut.EncodeJson ShareNodeParams where
------------------------------------------------------------------------ ------------------------------------------------------------------------
shareNode :: Record SubTreeParamsIn -> R.Element shareNode :: Record SubTreeParamsIn -> R.Element
shareNode p = R.createElement shareNodeCpt p [] shareNode p = R.createElement shareNodeCpt p []
where
shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R.hooksComponentWithModule thisModule "shareNode" cpt
shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R.hooksComponentWithModule thisModule "shareNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
......
...@@ -71,10 +71,10 @@ type UploadFile = ...@@ -71,10 +71,10 @@ type UploadFile =
uploadFileView :: Record Props -> R.Element uploadFileView :: Record Props -> R.Element
uploadFileView props = R.createElement uploadFileViewCpt props [] uploadFileView props = R.createElement uploadFileViewCpt props []
where
uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R.hooksComponentWithModule thisModule "uploadFileView" cpt
uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R.hooksComponentWithModule thisModule "uploadFileView" cpt
where
cpt {dispatch, id, nodeType} _ = do cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
fileType@(_ /\ setFileType) <- R.useState' CSV fileType@(_ /\ setFileType) <- R.useState' CSV
......
...@@ -48,10 +48,10 @@ type CommonProps = ...@@ -48,10 +48,10 @@ type CommonProps =
nodePopupView :: Record NodePopupProps -> R.Element nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p [] nodePopupView p = R.createElement nodePopupCpt p []
where
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
where
cpt p _ = do cpt p _ = do
renameIsOpen <- R.useState' false renameIsOpen <- R.useState' false
...@@ -254,10 +254,10 @@ type PanelActionProps = ...@@ -254,10 +254,10 @@ type PanelActionProps =
panelAction :: Record PanelActionProps -> R.Element panelAction :: Record PanelActionProps -> R.Element
panelAction p = R.createElement panelActionCpt p [] panelAction p = R.createElement panelActionCpt p []
where
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R.hooksComponentWithModule thisModule "panelAction" cpt
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R.hooksComponentWithModule thisModule "panelAction" cpt
where
cpt {action: Documentation nodeType} _ = actionDoc nodeType cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
cpt {action: Upload, dispatch, id, nodeType, session} _ = actionUpload nodeType id session dispatch cpt {action: Upload, dispatch, id, nodeType, session} _ = actionUpload nodeType id session dispatch
......
...@@ -292,10 +292,10 @@ type NodeLinkProps = ( ...@@ -292,10 +292,10 @@ type NodeLinkProps = (
nodeLink :: R2.Component NodeLinkProps nodeLink :: R2.Component NodeLinkProps
nodeLink = R.createElement nodeLinkCpt nodeLink = R.createElement nodeLinkCpt
where
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
where
cpt { folderOpen: (_ /\ setFolderOpen) cpt { folderOpen: (_ /\ setFolderOpen)
, frontends , frontends
, handed , handed
...@@ -348,10 +348,10 @@ type NodeTextProps = ...@@ -348,10 +348,10 @@ type NodeTextProps =
nodeText :: Record NodeTextProps -> R.Element nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p [] nodeText p = R.createElement nodeTextCpt p []
where
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
where
cpt { isSelected: true, name } _ = do cpt { isSelected: true, name } _ = do
pure $ H.u {} [ pure $ H.u {} [
H.b {} [ H.b {} [
......
...@@ -36,10 +36,10 @@ type SubTreeParamsProps = ...@@ -36,10 +36,10 @@ type SubTreeParamsProps =
subTreeView :: Record SubTreeParamsProps -> R.Element subTreeView :: Record SubTreeParamsProps -> R.Element
subTreeView props = R.createElement subTreeViewCpt props [] subTreeView props = R.createElement subTreeViewCpt props []
where
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
where
cpt params@{ action cpt params@{ action
, dispatch , dispatch
, handed , handed
......
...@@ -54,10 +54,10 @@ type Props = ...@@ -54,10 +54,10 @@ type Props =
sidebar :: Record Props -> R.Element sidebar :: Record Props -> R.Element
sidebar props = R.createElement sidebarCpt props [] sidebar props = R.createElement sidebarCpt props []
where
sidebarCpt :: R.Component Props
sidebarCpt = R.hooksComponentWithModule thisModule "sidebar" cpt
sidebarCpt :: R.Component Props
sidebarCpt = R.hooksComponentWithModule thisModule "sidebar" cpt
where
cpt {showSidePanel: (GET.Closed /\ _)} _children = do cpt {showSidePanel: (GET.Closed /\ _)} _children = do
pure $ RH.div {} [] pure $ RH.div {} []
cpt {showSidePanel: (GET.InitialClosed /\ _)} _children = do cpt {showSidePanel: (GET.InitialClosed /\ _)} _children = do
......
...@@ -25,10 +25,9 @@ type Props a = ( ...@@ -25,10 +25,9 @@ type Props a = (
inputWithEnter :: forall a. Record (Props a) -> R.Element inputWithEnter :: forall a. Record (Props a) -> R.Element
inputWithEnter props = R.createElement inputWithEnterCpt props [] inputWithEnter props = R.createElement inputWithEnterCpt props []
inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
where where
inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
cpt props@{ onEnter, onValueChanged cpt props@{ onEnter, onValueChanged
, autoFocus, autoSave, className, defaultValue, placeholder } _ = do , autoFocus, autoSave, className, defaultValue, placeholder } _ = do
pure $ H.input { on: { blur: \_ -> if autoSave then onEnter unit else pure unit pure $ H.input { on: { blur: \_ -> if autoSave then onEnter unit else pure unit
......
...@@ -274,10 +274,9 @@ type Props = ( ...@@ -274,10 +274,9 @@ type Props = (
loadedNgramsTable :: R2.Component Props loadedNgramsTable :: R2.Component Props
loadedNgramsTable = R.createElement loadedNgramsTableCpt loadedNgramsTable = R.createElement loadedNgramsTableCpt
loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
where where
loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
cpt props@{ afterSync cpt props@{ afterSync
, appReload , appReload
, asyncTasksRef , asyncTasksRef
...@@ -524,10 +523,9 @@ type MainNgramsTableProps = ( ...@@ -524,10 +523,9 @@ type MainNgramsTableProps = (
mainNgramsTable :: R2.Component MainNgramsTableProps mainNgramsTable :: R2.Component MainNgramsTableProps
mainNgramsTable = R.createElement mainNgramsTableCpt mainNgramsTable = R.createElement mainNgramsTableCpt
mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
where where
mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
cpt props@{ afterSync cpt props@{ afterSync
, appReload , appReload
, asyncTasksRef , asyncTasksRef
...@@ -631,10 +629,10 @@ type MainNgramsTablePaintProps = ( ...@@ -631,10 +629,10 @@ type MainNgramsTablePaintProps = (
mainNgramsTablePaint :: R2.Component MainNgramsTablePaintProps mainNgramsTablePaint :: R2.Component MainNgramsTablePaintProps
mainNgramsTablePaint = R.createElement mainNgramsTablePaintCpt mainNgramsTablePaint = R.createElement mainNgramsTablePaintCpt
where
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
where
cpt props@{ afterSync cpt props@{ afterSync
, appReload , appReload
, asyncTasksRef , asyncTasksRef
...@@ -670,10 +668,10 @@ type MainNgramsTablePaintNoCacheProps = ( ...@@ -670,10 +668,10 @@ type MainNgramsTablePaintNoCacheProps = (
mainNgramsTablePaintNoCache :: R2.Component MainNgramsTablePaintNoCacheProps mainNgramsTablePaintNoCache :: R2.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCache = R.createElement mainNgramsTablePaintNoCacheCpt mainNgramsTablePaintNoCache = R.createElement mainNgramsTablePaintNoCacheCpt
where
mainNgramsTablePaintNoCacheCpt :: R.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCacheCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaintNoCache" cpt
mainNgramsTablePaintNoCacheCpt :: R.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCacheCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaintNoCache" cpt
where
cpt props@{ afterSync cpt props@{ afterSync
, appReload , appReload
, asyncTasksRef , asyncTasksRef
......
...@@ -1129,10 +1129,10 @@ type SyncResetButtonsProps = ...@@ -1129,10 +1129,10 @@ type SyncResetButtonsProps =
syncResetButtons :: Record SyncResetButtonsProps -> R.Element syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons p = R.createElement syncResetButtonsCpt p [] syncResetButtons p = R.createElement syncResetButtonsCpt p []
where
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
where
cpt { afterSync, ngramsLocalPatch, performAction } _ = do cpt { afterSync, ngramsLocalPatch, performAction } _ = do
synchronizing@(s /\ setSynchronizing) <- R.useState' false synchronizing@(s /\ setSynchronizing) <- R.useState' false
......
...@@ -144,10 +144,10 @@ type NgramsViewTabsProps = ( ...@@ -144,10 +144,10 @@ type NgramsViewTabsProps = (
ngramsView :: R2.Component NgramsViewTabsProps ngramsView :: R2.Component NgramsViewTabsProps
ngramsView = R.createElement ngramsViewCpt ngramsView = R.createElement ngramsViewCpt
where
ngramsViewCpt :: R.Component NgramsViewTabsProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
ngramsViewCpt :: R.Component NgramsViewTabsProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
where
cpt { appReload cpt { appReload
, asyncTasksRef , asyncTasksRef
, cacheState , cacheState
......
...@@ -47,10 +47,10 @@ type KeyProps = ...@@ -47,10 +47,10 @@ type KeyProps =
corpusLayout :: Record Props -> R.Element corpusLayout :: Record Props -> R.Element
corpusLayout props = R.createElement corpusLayoutCpt props [] corpusLayout props = R.createElement corpusLayoutCpt props []
where
corpusLayoutCpt :: R.Component Props
corpusLayoutCpt = R.hooksComponentWithModule thisModule "corpusLayout" cpt
corpusLayoutCpt :: R.Component Props
corpusLayoutCpt = R.hooksComponentWithModule thisModule "corpusLayout" cpt
where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do