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
0139553e
Commit
0139553e
authored
Dec 30, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bootstrap v4] contacts page
parent
cd81a4a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
34 deletions
+28
-34
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+28
-34
No files found.
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
View file @
0139553e
...
...
@@ -102,40 +102,42 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
let value = (L.view cLens hyperdata) :: String
valueRef <- R.useRef value
pure $ H.
li { className: "list-group-item
" } [
H.span { className: "badge badge-default badge-pill"
} [ H.text label ]
pure $ H.
div { className: "form-group row
" } [
H.span { className: "col-sm-2 col-form-label"
} [ H.text label ]
, item isEditing valueRef
]
where
cLens = L.cloneLens lens
usePlaceholder valueRef =
if R.readRef valueRef == "" then
Tuple true placeholder
else
Tuple false $ R.readRef valueRef
item (false /\ setIsEditing) valueRef =
H.span {} [
H.span { className: if (fst $ usePlaceholder valueRef) then "text-muted" else "" } [
H.text $ snd $ usePlaceholder valueRef
H.div { className: "input-group col-sm-6" } [
H.input { className: "form-control"
, defaultValue: placeholder
, disabled: 1
, type: "text" }
, H.div { className: "btn input-group-append"
, on: { click: onClick } } [
H.div { className: "input-group-text fa fa-pencil" } []
]
, H.span { className: "fa fa-pencil"
, on: {click: onClick} } []
]
where
placeholder = R.readRef valueRef
onClick _ = setIsEditing $ const true
item (true /\ setIsEditing) valueRef =
H.
span {
} [
H.
div { className: "input-group col-sm-6"
} [
inputWithEnter {
onEnter: onClick
, onValueChanged: R.setRef valueRef
, autoFocus: true
autoFocus: true
, className: "form-control"
, defaultValue: R.readRef valueRef
, onEnter: onClick
, onValueChanged: R.setRef valueRef
, placeholder
, type: "text"
}
, H.span { className: "fa fa-floppy-o"
, on: {click: onClick} } []
, H.div { className: "btn input-group-append"
, on: { click: onClick } } [
H.div { className: "input-group-text fa fa-floppy-o" } []
]
]
where
onClick _ = do
...
...
@@ -143,17 +145,9 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
let newHyperdata = (L.over cLens (\_ -> R.readRef valueRef) hyperdata) :: HyperdataUser
onUpdateHyperdata newHyperdata
listInfo :: Tuple String String -> R.Element
listInfo s = listElement $ infoRender s
listElement :: Array R.Element -> R.Element
listElement = H.li { className: "list-group-item justify-content-between" }
infoRender :: Tuple String String -> Array R.Element
infoRender (Tuple title content) =
[ H.span { className: "badge badge-default badge-pill"} [ H.text title ]
, H.span {} [H.text content] ]
type LayoutProps = (
appReload :: ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
...
...
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