From 63b523a8a4acf65b0782a45a67514d6d22303e3d Mon Sep 17 00:00:00 2001 From: Alexander Wong Date: Wed, 18 Apr 2018 13:05:56 -0600 Subject: [PATCH] shift stub --- package.json | 8 +- src/components/App.jsx | 10 + src/components/Navbar.jsx | 5 + .../User/Client/ClientAddShiftForm.jsx | 83 + src/components/User/Client/ClientShifts.jsx | 39 + src/reducers/cshiftReducer.js | 0 src/reducers/index.js | 2 + yarn.lock | 1723 +++++++++++------ 8 files changed, 1307 insertions(+), 563 deletions(-) create mode 100644 src/components/User/Client/ClientAddShiftForm.jsx create mode 100644 src/components/User/Client/ClientShifts.jsx create mode 100644 src/reducers/cshiftReducer.js diff --git a/package.json b/package.json index 3874787..f56a286 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "axios": "^0.17.1", + "axios": "^0.18.0", "localStorage": "^1.0.3", "react": "^16.2.0", "react-color": "^2.13.8", @@ -11,11 +11,11 @@ "react-redux": "^5.0.6", "react-router": "^4.2.0", "react-router-dom": "^4.2.2", - "react-scripts": "1.1.0", - "redux": "^3.7.2", + "react-scripts": "^1.1.0", + "redux": "^4.0.0", "redux-logger": "^3.0.6", "redux-saga": "^0.16.0", - "semantic-ui-react": "^0.77.2" + "semantic-ui-react": "^0.79.1" }, "scripts": { "start": "react-scripts start", diff --git a/src/components/App.jsx b/src/components/App.jsx index bf45cd1..b930d27 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -12,6 +12,8 @@ import UpdateWorkTypeForm from "./Worktype/UpdateWorkTypeForm"; import Worktypes from "./Worktype/Worktypes"; import ClientProviders from "./User/Client/ClientProviders"; import ClientAddProviderForm from "./User/Client/ClientAddProviderForm"; +import ClientShifts from "./User/Client/ClientShifts"; +import ClientAddShiftForm from "./User/Client/ClientAddShiftForm"; import ProviderClients from "./User/Provider/ProviderClients"; import CompleteRegistration from "./User/CompleteRegistration"; import EditProfile from "./User/EditProfile"; @@ -72,6 +74,14 @@ class App extends Component { path="/user/profile/client/add-provider" component={ClientAddProviderForm} /> + + ( Providers )} + {selfUser.client && ( + + Shifts + + )} {selfUser.provider && ( Clients diff --git a/src/components/User/Client/ClientAddShiftForm.jsx b/src/components/User/Client/ClientAddShiftForm.jsx new file mode 100644 index 0000000..f000bdb --- /dev/null +++ b/src/components/User/Client/ClientAddShiftForm.jsx @@ -0,0 +1,83 @@ +import React, { Component } from "react"; +import { connect } from "react-redux"; +import { Redirect } from "react-router-dom"; +import { + Container, + Dropdown, + Form, + Header, + Input, + TextArea +} from "semantic-ui-react"; + +class ClientAddShiftForm extends Component { + render() { + const { selfUser } = this.props; + + if (!selfUser.client) { + return ; + } + + const employeeChoices = selfUser.client.employees + .filter(employee => !employee.deleted) + .map((val, idx, arr) => ({ + key: val.uuid, + value: val.uuid, + text: val.provider.email + })); + + const priceChoices = selfUser.client; + + return ( + + ); + } +} + +function mapStateToProps(state) { + return { ...state.employee, selfUser: state.user.selfUser }; +} + +const ClientAddShiftFormView = ({ employeeChoices, user }) => ( + +
Schedule a Shift
+
+ + + + + + + + + + + + + + + + + + + + +