Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Web Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orlando Piñero
Web Frontend
Commits
eab89f40
Commit
eab89f40
authored
2 years ago
by
Orlando Piñero
Browse files
Options
Downloads
Patches
Plain Diff
not rendeering
parent
d65776b7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
my-app/src/components/UserItem.js
+36
-39
36 additions, 39 deletions
my-app/src/components/UserItem.js
with
36 additions
and
39 deletions
my-app/src/components/UserItem.js
+
36
−
39
View file @
eab89f40
...
...
@@ -46,7 +46,7 @@ class UserItem extends Component {
handleShowEditPage
(
e
,
user
)
{
e
.
preventDefault
();
this
.
setState
({
editingUser
:
user
})
this
.
setState
({
editingUser
:
user
})
this
.
setState
({
displayingPage
:
DISPLAY
.
EDIT
})
}
...
...
@@ -82,55 +82,52 @@ class UserItem extends Component {
userID
:
user
.
userID
}
let
currentUserID
=
user
.
userID
switch
(
this
.
state
.
displayingPage
)
{
case
DISPLAY
.
LIST
:
return
(
<
div
key
=
{
user
.
userID
}
>
<
DeleteUserModal
/>
<
Card
style
=
{{
width
:
"
18rem
"
,
background
:
'
#ebebeb
'
}}
id
=
{
itemID
}
>
<
Card
.
Header
>
{
user
.
firstName
}
{
user
.
lastName
}
<
/Card.Header
>
<
ListGroup
variant
=
"
flush
"
>
<
ListGroup
.
Item
>
User
ID
:
{
user
.
userID
}
<
/ListGroup.Item
>
<
ListGroup
.
Item
>
First
Name
:
{
user
.
firstName
}
<
/ListGroup.Item
>
<
ListGroup
.
Item
>
Last
Name
:
{
user
.
lastName
}
<
/ListGroup.Item
>
<
/ListGroup
>
<
Card
.
Footer
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
space-evenly
'
}}
>
<
Button
variant
=
"
primary
"
onClick
=
{(
e
)
=>
this
.
handleShowEditPage
(
e
,
user
)}
id
=
{
editButtonID
}
>
Edit
<
/Button
>
<
Button
variant
=
"
primary
"
type
=
"
submit
"
onClick
=
{(
e
)
=>
this
.
handleShowDeleteModal
(
e
,
dialogData
)}
id
=
{
deleteButtonID
}
style
=
{{
background
:
'
#ffc800
'
,
color
:
'
black
'
,
border
:
'
none
'
}}
>
Delete
<
/Button
>
<
/Card.Footer
>
<
/Card
>
<
/div
>
)
case
DISPLAY
.
EDIT
:
return
(
<
EditUser
goBack
=
{
this
.
handleSwitchToList
}
editUser
=
{
user
}
/>
)
case
DISPLAY
.
CREATE
:
return
(
<
CreateNewUser
goBack
=
{
this
.
handleSwitchToList
}
/>
)
default
:
return
null
}
return
(
<
div
key
=
{
user
.
userID
}
>
<
DeleteUserModal
/>
<
Card
style
=
{{
width
:
"
18rem
"
,
background
:
'
#ebebeb
'
}}
id
=
{
itemID
}
>
<
Card
.
Header
>
{
user
.
firstName
}
{
user
.
lastName
}
<
/Card.Header
>
<
ListGroup
variant
=
"
flush
"
>
<
ListGroup
.
Item
>
User
ID
:
{
user
.
userID
}
<
/ListGroup.Item
>
<
ListGroup
.
Item
>
First
Name
:
{
user
.
firstName
}
<
/ListGroup.Item
>
<
ListGroup
.
Item
>
Last
Name
:
{
user
.
lastName
}
<
/ListGroup.Item
>
<
/ListGroup
>
<
Card
.
Footer
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
space-evenly
'
}}
>
<
Button
variant
=
"
primary
"
onClick
=
{(
e
)
=>
this
.
handleShowEditPage
(
e
,
user
)}
id
=
{
editButtonID
}
>
Edit
<
/Button
>
<
Button
variant
=
"
primary
"
type
=
"
submit
"
onClick
=
{(
e
)
=>
this
.
handleShowDeleteModal
(
e
,
dialogData
)}
id
=
{
deleteButtonID
}
style
=
{{
background
:
'
#ffc800
'
,
color
:
'
black
'
,
border
:
'
none
'
}}
>
Delete
<
/Button
>
<
/Card.Footer
>
<
/Card
>
<
/div
>
)
})
console
.
log
(
users
)
return
users
}
}
render
()
{
var
workspace
console
.
log
(
this
.
MapAllUsers
)
switch
(
this
.
state
.
displayingPage
)
{
case
DISPLAY
.
LIST
:
case
DISPLAY
.
LIST
:
workspace
=
<
Button
onClick
=
{
this
.
handleShowCreatePage
}
>
<
img
alt
=
"
Add-User-Button
"
src
=
"
https://cdn.icon-icons.com/icons2/933/PNG/512/round-add-button_icon-icons.com_72595.png
"
style
=
{{
width
:
'
2rem
'
}}
><
/img
>
<
/Button
>
{
this
.
MapAllUsers
()}
case
DISPLAY
.
CREATE
:
workspace
=
<
CreateNewUser
goBack
=
{
this
.
handleSwitchToList
}
/
>
case
DISPLAY
.
EDIT
:
workspace
=
<
EditUser
goBack
=
{
this
.
handleSwitchToList
}
editUser
=
{
this
.
state
.
editingUser
}
/
>
this
.
MapAllUsers
()
break
case
DISPLAY
.
CREATE
:
workspace
=
<
CreateNewUser
goBack
=
{
this
.
handleSwitchToList
}
/
>
break
case
DISPLAY
.
EDIT
:
workspace
=
<
EditUser
goBack
=
{
this
.
handleSwitchToList
}
editUser
=
{
this
.
state
.
editingUser
}
/
>
break
default
:
workspace
=
<
Button
onClick
=
{
this
.
handleShowCreatePage
}
>
<
img
alt
=
"
Add-User-Button
"
src
=
"
https://cdn.icon-icons.com/icons2/933/PNG/512/round-add-button_icon-icons.com_72595.png
"
style
=
{{
width
:
'
2rem
'
}}
><
/img
>
<
/Button
>
this
.
MapAllUsers
()
}
return
(
<
div
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment