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 {
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 >
......
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