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
c67e7993
Commit
c67e7993
authored
Nov 19, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[texts] control of side panel inside it, not in parent
parent
a07f4b19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
27 deletions
+32
-27
Styles.css
dist/styles/Styles.css
+3
-0
Styles.sass
dist/styles/Styles.sass
+2
-0
Texts.purs
src/Gargantext/Components/Nodes/Texts.purs
+25
-22
Types.purs
src/Gargantext/Components/Nodes/Texts/Types.purs
+2
-5
No files found.
dist/styles/Styles.css
View file @
c67e7993
...
...
@@ -9,6 +9,9 @@
top
:
60px
;
width
:
28%
;
}
#page-wrapper
.side-panel
.header
{
float
:
right
;
}
.simple-layout
{
height
:
100%
;
...
...
dist/styles/Styles.sass
View file @
c67e7993
...
...
@@ -8,6 +8,8 @@
position
:
fixed
top
:
60px
width
:
28%
.header
float
:
right
.simple-layout
height
:
100%
...
...
src/Gargantext/Components/Nodes/Texts.purs
View file @
c67e7993
...
...
@@ -52,20 +52,9 @@ textsWithForestCpt = R.hooksComponentWithModule thisModule "textsWithForest" cpt
, textsProps: textProps@{ session } } _ = do
controls <- initialControls
R.useEffect' $ do
let trigger _ = do
snd controls.showSidePanel $ const InitialClosed
R2.setTrigger controls.triggers.triggerSidePanel trigger
pure $ Forest.forestLayoutWithTopBar forestProps [
topBar { controls } []
, H.div { className: "col-md-10" } [
H.div {id: "page-wrapper"} [
H.div {className: "container-fluid"} [
textsLayout (Record.merge textProps { controls }) []
]
]
]
, textsLayout (Record.merge textProps { controls }) []
, H.div { className: "side-panel" } [
sidePanel { controls, session } []
]
...
...
@@ -84,12 +73,13 @@ topBarCpt :: R.Component TopBarProps
topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
where
cpt { controls } _ = do
pure $
H.ul { className: "nav navbar-nav" } [
H.li {} [
sidePanelToggleButton { state: controls.showSidePanel } []
]
] -- head (goes to top bar)
-- empty for now because the button is moved to the side panel
pure $ H.div {} []
-- H.ul { className: "nav navbar-nav" } [
-- H.li {} [
-- sidePanelToggleButton { state: controls.showSidePanel } []
-- ]
-- ] -- head (goes to top bar)
------------------------------------------------------------------------
type CommonProps = (
...
...
@@ -360,10 +350,17 @@ sidePanel = R.createElement sidePanelCpt
sidePanelCpt :: R.Component SidePanelProps
sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
where
cpt { controls: { showSidePanel: (showSidePanel /\ _)
, triggers: { triggerAnnotatedDocIdChange
cpt { controls: { triggers: { triggerAnnotatedDocIdChange
, triggerSidePanel } }
, session } _ = do
showSidePanel <- R.useState' InitialClosed
R.useEffect' $ do
let trigger _ = do
snd showSidePanel $ const Opened
R2.setTrigger triggerSidePanel trigger
(mCorpusId /\ setMCorpusId) <- R.useState' Nothing
(mListId /\ setMListId) <- R.useState' Nothing
(mNodeId /\ setMNodeId) <- R.useState' Nothing
...
...
@@ -386,12 +383,18 @@ sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
-- log "[sidePanel] clearing triggerAnnotatedDocIdChange"
R2.clearTrigger triggerAnnotatedDocIdChange
let mainStyle = case showSidePanel of
let mainStyle = case
fst
showSidePanel of
Opened -> { display: "block" }
_ -> { display: "none" }
pure $ H.div { style: mainStyle } [
sidePanelDocView { mCorpusId, mListId, mNodeId, session } []
H.div { className: "header" } [
H.span { className: "btn btn-danger"
, on: { click: \_ -> snd showSidePanel $ const Closed } } [
H.span { className: "fa fa-times" } []
]
]
, sidePanelDocView { mCorpusId, mListId, mNodeId, session } []
]
type SidePanelDocView = (
...
...
src/Gargantext/Components/Nodes/Texts/Types.purs
View file @
c67e7993
...
...
@@ -40,16 +40,13 @@ emptySidePanelTriggers = do
type TextsLayoutControls = (
showSidePanel :: R.State SidePanelState
, triggers :: Record SidePanelTriggers
triggers :: Record SidePanelTriggers
)
initialControls :: R.Hooks (Record TextsLayoutControls)
initialControls = do
showSidePanel <- R.useState' Opened
triggers <- emptySidePanelTriggers
pure $ {
showSidePanel
, triggers
triggers
}
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