You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
910 B
39 lines
910 B
import React, { Component } from "react"; |
|
import { connect } from "react-redux"; |
|
import { Redirect, Link } from "react-router-dom"; |
|
import { Button, Container, Header, Segment } from "semantic-ui-react"; |
|
|
|
class ClientShifts extends Component { |
|
render() { |
|
const { selfUser } = this.props; |
|
if (selfUser.client) { |
|
return <ClientShiftsView user={selfUser} />; |
|
} else { |
|
return <Redirect to="/" />; |
|
} |
|
} |
|
} |
|
|
|
function mapStateToProps(state) { |
|
return { selfUser: state.user.selfUser }; |
|
} |
|
|
|
const ClientShiftsView = ({ user }) => ( |
|
<Container> |
|
<Header>Shifts</Header> |
|
<Segment> |
|
<Button |
|
basic |
|
color="green" |
|
size="small" |
|
as={Link} |
|
to="/user/profile/client/add-shift" |
|
> |
|
Schedule a Shift |
|
</Button> |
|
</Segment> |
|
<p>Todo: List Shifts</p> |
|
</Container> |
|
); |
|
|
|
export default connect(mapStateToProps)(ClientShifts);
|
|
|