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
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
Show 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 @@
...
@@ -9,6 +9,9 @@
top
:
60px
;
top
:
60px
;
width
:
28%
;
width
:
28%
;
}
}
#page-wrapper
.side-panel
.header
{
float
:
right
;
}
.simple-layout
{
.simple-layout
{
height
:
100%
;
height
:
100%
;
...
...
dist/styles/Styles.sass
View file @
c67e7993
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
position
:
fixed
position
:
fixed
top
:
60px
top
:
60px
width
:
28%
width
:
28%
.header
float
:
right
.simple-layout
.simple-layout
height
:
100%
height
:
100%
...
...
src/Gargantext/Components/Nodes/Texts.purs
View file @
c67e7993
...
@@ -52,20 +52,9 @@ textsWithForestCpt = R.hooksComponentWithModule thisModule "textsWithForest" cpt
...
@@ -52,20 +52,9 @@ textsWithForestCpt = R.hooksComponentWithModule thisModule "textsWithForest" cpt
, textsProps: textProps@{ session } } _ = do
, textsProps: textProps@{ session } } _ = do
controls <- initialControls
controls <- initialControls
R.useEffect' $ do
let trigger _ = do
snd controls.showSidePanel $ const InitialClosed
R2.setTrigger controls.triggers.triggerSidePanel trigger
pure $ Forest.forestLayoutWithTopBar forestProps [
pure $ Forest.forestLayoutWithTopBar forestProps [
topBar { controls } []
topBar { controls } []
, H.div { className: "col-md-10" } [
, textsLayout (Record.merge textProps { controls }) []
H.div {id: "page-wrapper"} [
H.div {className: "container-fluid"} [
textsLayout (Record.merge textProps { controls }) []
]
]
]
, H.div { className: "side-panel" } [
, H.div { className: "side-panel" } [
sidePanel { controls, session } []
sidePanel { controls, session } []
]
]
...
@@ -84,12 +73,13 @@ topBarCpt :: R.Component TopBarProps
...
@@ -84,12 +73,13 @@ topBarCpt :: R.Component TopBarProps
topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
where
where
cpt { controls } _ = do
cpt { controls } _ = do
pure $
-- empty for now because the button is moved to the side panel
H.ul { className: "nav navbar-nav" } [
pure $ H.div {} []
H.li {} [
-- H.ul { className: "nav navbar-nav" } [
sidePanelToggleButton { state: controls.showSidePanel } []
-- H.li {} [
]
-- sidePanelToggleButton { state: controls.showSidePanel } []
] -- head (goes to top bar)
-- ]
-- ] -- head (goes to top bar)
------------------------------------------------------------------------
------------------------------------------------------------------------
type CommonProps = (
type CommonProps = (
...
@@ -360,10 +350,17 @@ sidePanel = R.createElement sidePanelCpt
...
@@ -360,10 +350,17 @@ sidePanel = R.createElement sidePanelCpt
sidePanelCpt :: R.Component SidePanelProps
sidePanelCpt :: R.Component SidePanelProps
sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
where
where
cpt { controls: { showSidePanel: (showSidePanel /\ _)
cpt { controls: { triggers: { triggerAnnotatedDocIdChange
, triggers: { triggerAnnotatedDocIdChange
, triggerSidePanel } }
, triggerSidePanel } }
, session } _ = do
, 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
(mCorpusId /\ setMCorpusId) <- R.useState' Nothing
(mListId /\ setMListId) <- R.useState' Nothing
(mListId /\ setMListId) <- R.useState' Nothing
(mNodeId /\ setMNodeId) <- R.useState' Nothing
(mNodeId /\ setMNodeId) <- R.useState' Nothing
...
@@ -386,12 +383,18 @@ sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
...
@@ -386,12 +383,18 @@ sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
-- log "[sidePanel] clearing triggerAnnotatedDocIdChange"
-- log "[sidePanel] clearing triggerAnnotatedDocIdChange"
R2.clearTrigger triggerAnnotatedDocIdChange
R2.clearTrigger triggerAnnotatedDocIdChange
let mainStyle = case showSidePanel of
let mainStyle = case
fst
showSidePanel of
Opened -> { display: "block" }
Opened -> { display: "block" }
_ -> { display: "none" }
_ -> { display: "none" }
pure $ H.div { style: mainStyle } [
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 = (
type SidePanelDocView = (
...
...
src/Gargantext/Components/Nodes/Texts/Types.purs
View file @
c67e7993
...
@@ -40,16 +40,13 @@ emptySidePanelTriggers = do
...
@@ -40,16 +40,13 @@ emptySidePanelTriggers = do
type TextsLayoutControls = (
type TextsLayoutControls = (
showSidePanel :: R.State SidePanelState
triggers :: Record SidePanelTriggers
, triggers :: Record SidePanelTriggers
)
)
initialControls :: R.Hooks (Record TextsLayoutControls)
initialControls :: R.Hooks (Record TextsLayoutControls)
initialControls = do
initialControls = do
showSidePanel <- R.useState' Opened
triggers <- emptySidePanelTriggers
triggers <- emptySidePanelTriggers
pure $ {
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