Skip to content
Snippets Groups Projects
Commit eab89f40 authored by Orlando Piñero's avatar Orlando Piñero
Browse files

not rendeering

parent d65776b7
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ class UserItem extends Component { ...@@ -46,7 +46,7 @@ class UserItem extends Component {
handleShowEditPage(e, user) { handleShowEditPage(e, user) {
e.preventDefault(); e.preventDefault();
this.setState({ editingUser: user}) this.setState({ editingUser: user })
this.setState({ displayingPage: DISPLAY.EDIT }) this.setState({ displayingPage: DISPLAY.EDIT })
} }
...@@ -82,55 +82,52 @@ class UserItem extends Component { ...@@ -82,55 +82,52 @@ class UserItem extends Component {
userID: user.userID userID: user.userID
} }
let currentUserID = user.userID return (
<div key={user.userID}>
<DeleteUserModal />
switch (this.state.displayingPage) { <Card style={{ width: "18rem", background: '#ebebeb' }} id={itemID}>
case DISPLAY.LIST: <Card.Header>{user.firstName} {user.lastName}</Card.Header>
return ( <ListGroup variant="flush">
<div key={user.userID}> <ListGroup.Item >User ID: {user.userID}</ListGroup.Item>
<DeleteUserModal /> <ListGroup.Item >First Name: {user.firstName}</ListGroup.Item>
<Card style={{ width: "18rem", background: '#ebebeb' }} id={itemID}> <ListGroup.Item >Last Name: {user.lastName}</ListGroup.Item>
<Card.Header>{user.firstName} {user.lastName}</Card.Header> </ListGroup>
<ListGroup variant="flush"> <Card.Footer style={{ display: 'flex', justifyContent: 'space-evenly' }}>
<ListGroup.Item >User ID: {user.userID}</ListGroup.Item> <Button variant="primary" onClick={(e) => this.handleShowEditPage(e, user)} id={editButtonID} >Edit</Button>
<ListGroup.Item >First Name: {user.firstName}</ListGroup.Item> <Button variant="primary" type="submit" onClick={(e) => this.handleShowDeleteModal(e, dialogData)} id={deleteButtonID} style={{ background: '#ffc800', color: 'black', border: 'none' }}>
<ListGroup.Item >Last Name: {user.lastName}</ListGroup.Item> Delete
</ListGroup> </Button>
<Card.Footer style={{ display: 'flex', justifyContent: 'space-evenly' }}> </Card.Footer>
<Button variant="primary" onClick={(e) => this.handleShowEditPage(e, user)} id={editButtonID} >Edit</Button> </Card>
<Button variant="primary" type="submit" onClick={(e) => this.handleShowDeleteModal(e, dialogData)} id={deleteButtonID} style={{ background: '#ffc800', color: 'black', border: 'none' }}> </div>
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
}
}) })
console.log(users)
return users return users
} }
} }
render() { render() {
var workspace var workspace
console.log(this.MapAllUsers)
switch (this.state.displayingPage) { switch (this.state.displayingPage) {
case DISPLAY.LIST : case DISPLAY.LIST:
workspace = <Button onClick={this.handleShowCreatePage}> 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> <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> </Button>
{this.MapAllUsers()} this.MapAllUsers()
case DISPLAY.CREATE : break
workspace = <CreateNewUser goBack={this.handleSwitchToList} /> case DISPLAY.CREATE:
case DISPLAY.EDIT : workspace = <CreateNewUser goBack={this.handleSwitchToList} />
workspace = <EditUser goBack={this.handleSwitchToList} editUser={this.state.editingUser} /> 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 ( return (
<div > <div >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment