Mila-Zagrevskaya 5 anos atrás
pai
commit
800af43ee6

+ 243 - 0
.idea/workspace.xml

@@ -5,6 +5,7 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="a8a32a88-c432-4104-a927-0d3d1c1c21be" name="Default Changelist" comment="">
+<<<<<<< HEAD
       <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/public/favicon.ico" beforeDir="false" />
@@ -14,6 +15,18 @@
       <change beforePath="$PROJECT_DIR$/src/index.css" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/src/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.js" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/logo.svg" beforeDir="false" />
+=======
+      <change afterPath="$PROJECT_DIR$/src/components/Doctors.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/App.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/App.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/components/Appointment.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/Appointment.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/components/Header.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/Header.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/components/Main.js" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/components/Service.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/Service.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/db.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/db.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/store/app/actions.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/store/app/actions.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/store/app/reducers.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/store/app/reducers.js" afterDir="false" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
     </list>
     <ignored path="$PROJECT_DIR$/.tmp/" />
     <ignored path="$PROJECT_DIR$/temp/" />
@@ -26,11 +39,19 @@
   </component>
   <component name="FileEditorManager">
     <leaf>
+<<<<<<< HEAD
       <file pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/src/App.js">
           <provider selected="true" editor-type-id="text-editor">
             <state relative-caret-position="612">
               <caret line="36" column="1" lean-forward="true" selection-start-line="36" selection-start-column="1" selection-end-line="36" selection-end-column="1" />
+=======
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/App.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="242">
+              <caret line="52" column="38" selection-start-line="52" selection-start-column="28" selection-end-line="52" selection-end-column="38" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
               <folding>
                 <element signature="e#0#26#0" expanded="true" />
               </folding>
@@ -41,17 +62,29 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/src/components/Appointment.js">
           <provider selected="true" editor-type-id="text-editor">
+<<<<<<< HEAD
             <state relative-caret-position="1156">
               <caret line="68" column="27" lean-forward="true" selection-start-line="68" selection-start-column="27" selection-end-line="68" selection-end-column="27" />
+=======
+            <state relative-caret-position="578">
+              <caret line="76" column="21" lean-forward="true" selection-start-line="76" selection-start-column="21" selection-end-line="76" selection-end-column="21" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
+<<<<<<< HEAD
         <entry file="file://$PROJECT_DIR$/src/components/Main.js">
           <provider selected="true" editor-type-id="text-editor">
             <state relative-caret-position="629">
               <caret line="37" column="1" lean-forward="true" selection-start-line="37" selection-start-column="1" selection-end-line="37" selection-end-column="1" />
+=======
+        <entry file="file://$PROJECT_DIR$/src/components/Services.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="238">
+              <caret line="14" column="58" lean-forward="true" selection-start-line="14" selection-start-column="28" selection-end-line="14" selection-end-column="58" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
               <folding>
                 <element signature="e#0#26#0" expanded="true" />
               </folding>
@@ -59,11 +92,52 @@
           </provider>
         </entry>
       </file>
+<<<<<<< HEAD
+=======
+      <file pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/src/store/app/reducers.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="463">
+              <caret line="68" column="18" lean-forward="true" selection-start-line="68" selection-start-column="18" selection-end-line="68" selection-end-column="18" />
+              <folding>
+                <element signature="e#0#207#0" expanded="true" />
+                <element signature="e#1513#1662#0" />
+                <element signature="e#1672#1811#0" />
+                <element signature="e#1821#1958#0" />
+                <element signature="e#2115#2255#0" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/store/app/actions.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="204">
+              <caret line="12" column="31" selection-start-line="12" selection-start-column="13" selection-end-line="12" selection-end-column="31" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/../../my-app/src/store/app/actions.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="493">
+              <caret line="62" selection-start-line="62" selection-end-line="75" selection-end-column="2" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
     </leaf>
   </component>
   <component name="FindInProjectRecents">
     <findStrings>
       <find>week.indexOf(week.find(el =&gt; el === 'чт'))</find>
+<<<<<<< HEAD
+=======
+      <find>arr</find>
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
     </findStrings>
   </component>
   <component name="Git.Settings">
@@ -78,16 +152,26 @@
         <option value="$PROJECT_DIR$/src/components/Footer.js" />
         <option value="$PROJECT_DIR$/src/store.js" />
         <option value="$PROJECT_DIR$/src/index.js" />
+<<<<<<< HEAD
         <option value="$PROJECT_DIR$/src/components/Header.js" />
         <option value="$PROJECT_DIR$/src/store/reducers.js" />
         <option value="$PROJECT_DIR$/../../db.json" />
         <option value="$PROJECT_DIR$/src/store/app/actions.js" />
         <option value="$PROJECT_DIR$/src/store/app/reducers.js" />
         <option value="$PROJECT_DIR$/src/components/Appoitnment.js" />
+=======
+        <option value="$PROJECT_DIR$/src/store/reducers.js" />
+        <option value="$PROJECT_DIR$/../../db.json" />
+        <option value="$PROJECT_DIR$/src/components/Appoitnment.js" />
+        <option value="$PROJECT_DIR$/src/components/Header.js" />
+        <option value="$PROJECT_DIR$/src/components/Main.js" />
+        <option value="$PROJECT_DIR$/src/components/Services.js" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
         <option value="$PROJECT_DIR$/src/components/Service.js" />
         <option value="$PROJECT_DIR$/src/db.json" />
         <option value="$PROJECT_DIR$/src/App.js" />
         <option value="$PROJECT_DIR$/src/components/Appointment.js" />
+<<<<<<< HEAD
         <option value="$PROJECT_DIR$/src/components/Main.js" />
       </list>
     </option>
@@ -100,6 +184,10 @@
         <option value="$PROJECT_DIR$/.idea/vcs.xml" />
         <option value="$PROJECT_DIR$/.idea/misc.xml" />
         <option value="$PROJECT_DIR$/.idea/modules.xml" />
+=======
+        <option value="$PROJECT_DIR$/src/store/app/actions.js" />
+        <option value="$PROJECT_DIR$/src/store/app/reducers.js" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
       </list>
     </option>
   </component>
@@ -114,6 +202,7 @@
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
+<<<<<<< HEAD
       <pane id="ProjectPane" />
       <pane id="Scope">
         <subPane subId="Scope 'Changed Files'; set:Changed Files; ALL; class com.intellij.packageDependencies.ChangeListScope">
@@ -126,16 +215,58 @@
               <item name="our-app" type="3d21c010:ScopeViewTreeModel$ProjectNode" />
               <item name="C:\React\GroupProject\our-app" type="442cc68d:ScopeViewTreeModel$RootNode" />
               <item name="src" type="9f88c78c:ScopeViewTreeModel$FileNode" />
+=======
+      <pane id="ProjectPane">
+        <subPane>
+          <expand>
+            <path>
+              <item name="our-app" type="b2602c69:ProjectViewProjectNode" />
+              <item name="our-app" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="our-app" type="b2602c69:ProjectViewProjectNode" />
+              <item name="our-app" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="our-app" type="b2602c69:ProjectViewProjectNode" />
+              <item name="our-app" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="components" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="our-app" type="b2602c69:ProjectViewProjectNode" />
+              <item name="our-app" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="store" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="our-app" type="b2602c69:ProjectViewProjectNode" />
+              <item name="our-app" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="store" type="462c0819:PsiDirectoryNode" />
+              <item name="app" type="462c0819:PsiDirectoryNode" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
             </path>
           </expand>
           <select />
         </subPane>
       </pane>
+<<<<<<< HEAD
     </panes>
   </component>
   <component name="PropertiesComponent">
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="last_opened_file_path" value="$PROJECT_DIR$/../../my-app/src/App.js" />
+=======
+      <pane id="Scope" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../my-app/src/store/app/actions.js" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
     <property name="node.js.selected.package.eslint" value="(autodetect)" />
@@ -183,11 +314,16 @@
       <option name="number" value="Default" />
       <option name="presentableId" value="Default" />
       <updated>1562445740358</updated>
+<<<<<<< HEAD
       <workItem from="1562445741612" duration="29973000" />
+=======
+      <workItem from="1562445741612" duration="45849000" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
     </task>
     <servers />
   </component>
   <component name="TimeTrackingManager">
+<<<<<<< HEAD
     <option name="totallyTimeSpent" value="29973000" />
   </component>
   <component name="ToolWindowManager">
@@ -200,6 +336,21 @@
       <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
       <window_info anchor="bottom" id="Version Control" />
       <window_info anchor="bottom" id="Terminal" weight="0.094257854" />
+=======
+    <option name="totallyTimeSpent" value="45849000" />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="-8" y="-8" width="2576" height="1056" extended-state="6" />
+    <editor active="true" />
+    <layout>
+      <window_info id="npm" sideWeight="0.227446" side_tool="true" weight="0.08392435" />
+      <window_info id="Favorites" side_tool="true" />
+      <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.772554" visible="true" weight="0.08392435" />
+      <window_info id="Structure" order="1" sideWeight="0.5005417" side_tool="true" weight="0.08392435" />
+      <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
+      <window_info anchor="bottom" id="Version Control" />
+      <window_info anchor="bottom" id="Terminal" visible="true" weight="0.0964247" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
       <window_info anchor="bottom" id="Event Log" side_tool="true" />
       <window_info anchor="bottom" id="Message" order="0" />
       <window_info anchor="bottom" id="Find" order="1" weight="0.32936078" />
@@ -387,6 +538,7 @@
         </state>
       </provider>
     </entry>
+<<<<<<< HEAD
     <entry file="file://$PROJECT_DIR$/src/db.json">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="153">
@@ -400,10 +552,36 @@
           <caret line="21" column="24" lean-forward="true" selection-start-line="21" selection-start-column="24" selection-end-line="21" selection-end-column="24" />
           <folding>
             <element signature="e#0#115#0" expanded="true" />
+=======
+    <entry file="file://$PROJECT_DIR$/src/components/Header.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="170">
+          <caret line="10" column="36" lean-forward="true" selection-start-line="10" selection-start-column="36" selection-end-line="10" selection-end-column="36" />
+          <folding>
+            <element signature="e#0#26#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/src/db.json">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="204">
+          <caret line="12" column="26" lean-forward="true" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/components/Doctors.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="408">
+          <caret line="24" column="26" lean-forward="true" selection-start-line="24" selection-start-column="26" selection-end-line="24" selection-end-column="26" />
+          <folding>
+            <element signature="e#0#26#0" expanded="true" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
+          </folding>
+        </state>
+      </provider>
+    </entry>
+<<<<<<< HEAD
     <entry file="file://$PROJECT_DIR$/src/store/app/actions.js">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="136">
@@ -429,6 +607,46 @@
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="629">
           <caret line="37" column="1" lean-forward="true" selection-start-line="37" selection-start-column="1" selection-end-line="37" selection-end-column="1" />
+=======
+    <entry file="file://$PROJECT_DIR$/src/components/Service.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="340">
+          <caret line="20" column="1" lean-forward="true" selection-start-line="20" selection-start-column="1" selection-end-line="20" selection-end-column="1" />
+          <folding>
+            <element signature="e#0#26#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/jsLanguageServicesImpl/external/react.d.ts">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="371">
+          <caret line="298" column="8" selection-start-line="298" selection-start-column="8" selection-end-line="298" selection-end-column="8" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/components/Services.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="238">
+          <caret line="14" column="58" lean-forward="true" selection-start-line="14" selection-start-column="28" selection-end-line="14" selection-end-column="58" />
+          <folding>
+            <element signature="e#0#26#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/../../my-app/src/store/app/actions.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="493">
+          <caret line="62" selection-start-line="62" selection-end-line="75" selection-end-column="2" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/App.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="242">
+          <caret line="52" column="38" selection-start-line="52" selection-start-column="28" selection-end-line="52" selection-end-column="38" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
           <folding>
             <element signature="e#0#26#0" expanded="true" />
           </folding>
@@ -437,6 +655,7 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/src/components/Appointment.js">
       <provider selected="true" editor-type-id="text-editor">
+<<<<<<< HEAD
         <state relative-caret-position="1156">
           <caret line="68" column="27" lean-forward="true" selection-start-line="68" selection-start-column="27" selection-end-line="68" selection-end-column="27" />
         </state>
@@ -448,6 +667,30 @@
           <caret line="36" column="1" lean-forward="true" selection-start-line="36" selection-start-column="1" selection-end-line="36" selection-end-column="1" />
           <folding>
             <element signature="e#0#26#0" expanded="true" />
+=======
+        <state relative-caret-position="578">
+          <caret line="76" column="21" lean-forward="true" selection-start-line="76" selection-start-column="21" selection-end-line="76" selection-end-column="21" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/store/app/actions.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="204">
+          <caret line="12" column="31" selection-start-line="12" selection-start-column="13" selection-end-line="12" selection-end-column="31" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/store/app/reducers.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="463">
+          <caret line="68" column="18" lean-forward="true" selection-start-line="68" selection-start-column="18" selection-end-line="68" selection-end-column="18" />
+          <folding>
+            <element signature="e#0#207#0" expanded="true" />
+            <element signature="e#1513#1662#0" />
+            <element signature="e#1672#1811#0" />
+            <element signature="e#1821#1958#0" />
+            <element signature="e#2115#2255#0" />
+>>>>>>> 2940c859193c8bb3d6590481e26d221acc18dc0b
           </folding>
         </state>
       </provider>

Diferenças do arquivo suprimidas por serem muito extensas
+ 629 - 629
db.json


Diferenças do arquivo suprimidas por serem muito extensas
+ 534 - 578
package-lock.json


+ 3 - 6
package.json

@@ -1,19 +1,16 @@
 {
-  "name": "fe12",
+  "name": "our-app",
   "version": "0.1.0",
   "private": true,
   "dependencies": {
     "axios": "^0.19.0",
-    "gsap": "^2.1.3",
-    "history": "^4.9.0",
     "node-sass": "^4.12.0",
     "react": "^16.8.6",
     "react-dom": "^16.8.6",
-    "react-google-maps": "^9.4.5",
     "react-redux": "^7.1.0",
-    "react-router-dom": "^5.0.0",
+    "react-router-dom": "^5.0.1",
     "react-scripts": "3.0.1",
-    "redux": "^4.0.3",
+    "redux": "^4.0.1",
     "redux-thunk": "^2.3.0"
   },
   "scripts": {

+ 210 - 0
src/actions/actions.js

@@ -0,0 +1,210 @@
+import * as types from '../actionsTypes/actionsTypes'
+
+const URL = "https://team-app-28f4a.firebaseio.com/";
+
+// -----------------------------------------------------------------------------------------------------------------
+
+export const setAppointmentDate = payload => ({
+    type: types.CHANGE_APPOINTMENT_DATE,
+    payload
+});
+
+export const setAppointmentDoctor = payload => ({
+    type: types.CHANGE_APPOINTMENT_DOCTOR,
+    payload
+});
+
+export const setAppointmentTime = payload => ({
+    type: types.CHANGE_APPOINTMENT_TIME,
+    payload
+});
+
+export const setAppointmentSpec = payload => ({
+    type: types.CHANGE_APPOINTMENT_SPEC,
+    payload
+});
+
+export const setAppointmentComment = payload => ({
+    type: types.CHANGE_APPOINTMENT_COMMENT,
+    payload
+});
+
+export const clearAppointment = payload => ({
+    type: types.CLEAR_APPOINTMENT,
+    payload
+});
+
+// -----------------------------------------------------------------------------------------------------------------
+
+
+const putOrdersRequest = payload => ({
+    type: types.PUT_ORDERS_REQUEST,
+    payload
+});
+
+const putOrdersSuccess = payload => ({
+    type: types.PUT_ORDERS_REQUEST_SUCCESS,
+    payload
+});
+
+const putOrdersFail = payload => ({
+    type: types.PUT_ORDERS_REQUEST_FAIL,
+    payload
+});
+
+export const putOrders = (payload) => dispatch => {
+    dispatch(putOrdersRequest());
+    return fetch(`${URL}/orders.json`, {
+        method: "PUT",
+        headers: {
+            'Content-Type': 'application/json'
+        },
+        body: JSON.stringify(payload)
+    })
+        .then(res => res.json())
+        .then(res => dispatch(putOrdersSuccess(res)))
+        .catch(err => dispatch(putOrdersFail(err)));
+
+};
+
+
+// -----------------------------------------------------------------------------------------------------------------
+
+const getAllRequest = payload => ({
+    type: types.GET_ALL_REQUEST,
+    payload
+});
+
+const getAllRequestSuccess = payload => ({
+    type: types.GET_ALL_REQUEST_SUCCESS,
+    payload
+});
+
+const getAllRequestFail = payload => ({
+    type: types.GET_ALL_REQUEST_FAIL,
+    payload
+});
+
+export const getAll = () => dispatch => {
+    dispatch(getAllRequest());
+    return fetch(`${URL}.json`)
+        .then(res => res.json())
+        .then(res => dispatch(getAllRequestSuccess(res)))
+        .catch(err => dispatch(getAllRequestFail(err)));
+};
+
+// -----------------------------------------------------------------------------------------------------------------
+
+const getDoctorsRequest = payload => ({
+    type: types.GET_DOCTORS_REQUEST,
+    payload
+});
+
+const getDoctorsRequestSuccess = payload => ({
+    type: types.GET_DOCTORS_REQUEST_SUCCESS,
+    payload
+});
+
+const getDoctorsRequestFail = payload => ({
+    type: types.GET_DOCTORS_REQUEST_FAIL,
+    payload
+});
+
+export const getDoctors = () => dispatch => {
+    dispatch(getDoctorsRequest());
+    return fetch(`${URL}doctors.json`)
+        .then(res => res.json())
+        .then(res => dispatch(getDoctorsRequestSuccess(res)))
+        .catch(err => dispatch(getDoctorsRequestFail(err)));
+};
+
+// -----------------------------------------------------------------------------------------------------------------
+const getServicesRequest = payload => ({
+    type: types.GET_SERVICES_REQUEST,
+    payload
+});
+
+const getServicesRequestSuccess = payload => ({
+    type: types.GET_SERVICES_REQUEST_SUCCESS,
+    payload
+});
+
+const getServicesRequestFail = payload => ({
+    type: types.GET_SERVICES_REQUEST_FAIL,
+    payload
+});
+
+export const getServices = () => dispatch => {
+    dispatch(getServicesRequest());
+    return fetch(`${URL}services.json`)
+        .then(res => res.json())
+        .then(res => dispatch(getServicesRequestSuccess(res)))
+        .catch(err => dispatch(getServicesRequestFail(err)));
+};
+
+// _____________________________________________________________________________________
+export const postDoctorsRequest = payload => ({
+    type: types.POST_DOCTORS_REQUEST,
+    payload
+});
+
+const postDoctorsRequestSuccess = payload => ({
+    type: types.POST_DOCTORS_REQUEST_SUCCESS,
+    payload
+});
+
+const postDoctorsRequestFail = payload => ({
+    type: types.POST_DOCTORS_REQUEST_FAIL,
+    payload
+});
+
+export const postDoctors = (payload) => dispatch => {
+    // console.log(payload)
+    dispatch(postDoctorsRequest());
+    return fetch("https://api-clinics.herokuapp.com/api/v1/doctors", {
+        method: "POST",
+        credentials: "include",
+        headers: {
+            "Content-Type": "application/json"
+        },
+        body: JSON.stringify(payload)
+    })
+        .then(res => res.json())
+        .then(res => dispatch(postDoctorsRequestSuccess(res)))
+        .catch(err => dispatch(postDoctorsRequestFail(err)));
+};
+
+// -----------------------------------------------------------------------------------------------------------------
+
+export const postServicesRequest = payload => ({
+    type: types.POST_SERVICES_REQUEST,
+    payload
+});
+
+const postServicesRequestSuccess = payload => ({
+    type: types.POST_SERVICES_REQUEST_SUCCESS,
+    payload
+});
+
+const postServicesRequestFail = payload => ({
+    type: types.POST_SERVICES_REQUEST_FAIL,
+    payload
+});
+
+export const postServices = (payload) => dispatch => {
+    // console.log(payload)
+    dispatch(postServicesRequest());
+    return fetch("https://api-clinics.herokuapp.com/api/v1/services", {
+        method: "POST",
+        credentials: "include",
+        headers: {
+            "Content-Type": "application/json"
+        },
+        body: JSON.stringify(payload)
+    })
+        .then(res => res.json())
+        .then(res =>  dispatch(postServicesRequestSuccess(res)))
+        .catch(err => dispatch(postServicesRequestFail(err)))
+};
+
+// _____________________________________________________________

+ 62 - 0
src/actions/auth.js

@@ -0,0 +1,62 @@
+import * as types from '../actionsTypes/actionsTypes'
+
+import axios from 'axios'
+
+const authRequest = payload => ({
+    type: types.AUTH_REQUEST,
+    payload
+})
+
+const authRequestSuccess = payload => ({
+    type: types.AUTH_REQUEST_SUCCESS,
+    payload
+})
+
+const authRequestFail = payload => ({
+    type: types.AUTH_REQUEST_FAIL,
+    payload
+})
+
+export const auth = payload => {
+    return async dispatch => {
+        dispatch(authRequest());
+        try {
+            const { data } = await axios.post("http://subdomain.entony.fs.a-level.com.ua/api/auth/login", payload);
+            console.log('data',data)
+            dispatch(authRequestSuccess(data));
+        } catch (error){
+            dispatch(authRequestFail(error));
+        }
+    }
+}
+
+const registerRequest = payload => ({
+    type:types.REGISTRATION_REQUEST,
+    payload
+})
+
+const registerRequestSuccess = payload => ({
+    type: types.REGISTRATION_REQUEST_SUCCESS,
+    payload
+})
+
+const registrRequestFail = payload => ({
+    type: types.REGISTRATION_REQUEST_FAIL,
+    payload
+})
+
+export const register = payload => {
+    return async dispatch => {
+        dispatch(registerRequest());
+        try {
+            const { data } = await axios.post(
+                "http://subdomain.entony.fs.a-level.com.ua/api/auth/register",
+                payload
+            );
+           
+            dispatch(registerRequestSuccess(data))
+        } catch(error) {
+            dispatch(registrRequestFail(error))
+        }
+    };
+};

+ 38 - 0
src/actionsTypes/actionsTypes.js

@@ -0,0 +1,38 @@
+export const GET_DOCTORS_REQUEST = "GET_DOCTORS_REQUEST";
+export const GET_DOCTORS_REQUEST_SUCCESS = "GET_DOCTORS_REQUEST_SUCCESS";
+export const GET_DOCTORS_REQUEST_FAIL = "GET_DOCTORS_REQUEST_FAIL";
+
+export const GET_SERVICES_REQUEST = "GET_SERVICES_REQUEST";
+export const GET_SERVICES_REQUEST_SUCCESS = "GET_SERVICES_REQUEST_SUCCESS";
+export const GET_SERVICES_REQUEST_FAIL = "GET_SERVICES_REQUEST_FAIL";
+
+export const GET_ALL_REQUEST = "GET_ALL_REQUEST";
+export const GET_ALL_REQUEST_SUCCESS = "GET_ALL_REQUEST_SUCCESS";
+export const GET_ALL_REQUEST_FAIL = "GET_ALL_REQUEST_FAIL";
+
+export const PUT_ORDERS_REQUEST = "PUT_ORDERS_REQUEST";
+export const PUT_ORDERS_REQUEST_SUCCESS = "PUT_ORDERS_REQUEST_SUCCESS";
+export const PUT_ORDERS_REQUEST_FAIL = "PUT_ORDERS_REQUEST_FAIL";
+
+export const CHANGE_APPOINTMENT_DATE= "CHANGE_APPOINTMENT_DATE";
+export const CHANGE_APPOINTMENT_DOCTOR= "CHANGE_APPOINTMENT_DOCTOR";
+export const CHANGE_APPOINTMENT_TIME= "CHANGE_APPOINTMENT_TIME";
+export const CHANGE_APPOINTMENT_SPEC= "CHANGE_APPOINTMENT_SPEC";
+export const CHANGE_APPOINTMENT_COMMENT= "CHANGE_APPOINTMENT_COMMENT";
+export const CLEAR_APPOINTMENT= "CLEAR_APPOINTMENT";
+
+export const AUTH_REQUEST = "GET_AUTH_REQUEST";
+export const AUTH_REQUEST_SUCCESS = "AUTH_REQUEST_SUCCESS";
+export const AUTH_REQUEST_FAIL = "AUTH_REQUEST_FAIL";
+
+export const REGISTRATION_REQUEST = "REQISTRATION_REQUEST";
+export const REGISTRATION_REQUEST_SUCCESS = "REGISTRATION_REQUEST_SUCCESS";
+export const REGISTRATION_REQUEST_FAIL = "REGISTRATION_REQUEST_FAIL";
+
+export const POST_DOCTORS_REQUEST = "POST_DOCTORS_REQUEST";
+export const POST_DOCTORS_REQUEST_SUCCESS = "POST_DOCTORS_REQUEST_SUCCESS";
+export const POST_DOCTORS_REQUEST_FAIL = "POST_DOCTORS_REQUEST_FAIL";
+
+export const POST_SERVICES_REQUEST = "POST_SERVICES_REQUEST";
+export const POST_SERVICES_REQUEST_SUCCESS = "POST_SERVICES_REQUEST_SUCCESS";
+export const POST_SERVICES_REQUEST_FAIL = "POST_SERVICES_REQUEST_FAIL";

+ 58 - 67
src/components/Appointment.js

@@ -2,92 +2,83 @@ import React from 'react';
 
 
 export default class Appointment extends React.Component {
-    state={
-        date:{
-            year:0,
-            month:0,
-            day:0
-        },
-        spec:null,
-        time:null
-    };
 
-
-    changeDate =(e) => {
-        const date = e.target.value.split('-');
-        this.setState({
-            date:{
-                year:date[0],
-                month:date[1],
-                day:date[2]
-            }
-        })
-    };
-
-    chooseSpeciality = (e) => {
-        this.setState({spec:e.target.value})
+    componentDidMount() {
+        this.props.setAppointmentDoctor(+this.props.his.match.params.doctor)
     }
 
-    chooseTime =(e) => {
-        this.setState({time:e.target.value})
+    componentWillUnmount() {
+        this.props.clearAppointment()
     }
 
     render() {
-        let schedule
-        const {his,dataDoctors,dataServices} = this.props;
-        const path = his.match.params.doctor;
-        const doctor = dataDoctors.find(el => el.id === +path);
-        if(doctor){
-            schedule = doctor.schedule
-
-
-        }
-
-
-        // if (doctor){
-        //     schedule = doctor.schedule[`${this.state.date.month<10 ? '0'+this.state.date.month : this.state.date.month}`][`${this.state.date.day<10 ? '0'+this.state.date.day : this.state.date.day}`]
-        //     console.log(doctor.schedule[`${this.state.date.month<10 ? '0'+this.state.date.month : this.state.date.month}`][`${this.state.date.day<10 ? '0'+this.state.date.day : this.state.date.day}`])
-        // }
-        if (this.state.time){
-        console.log(this.state.time)
-        console.log(this.state.time.split(':'))
-        console.log(dataServices[this.state.spec].duration)
-            console.log(+this.state.time.split(':')[0] + dataServices[this.state.spec].duration)
+        const {his,dataDoctors,dataServices,dataOrders,appointment,
+            setAppointmentDate,
+            setAppointmentTime,
+            setAppointmentSpec,
+            setAppointmentComment,
+            putOrders
+        } = this.props;
+        const timeArray = [];
+        const doctor = dataDoctors.find(el => el.id === +his.match.params.doctor);
+        if (appointment.date.year){
+            for (let index in doctor.schedule[appointment.date.month][appointment.date.day]){
+                timeArray.push({[`${index}`]:doctor.schedule[appointment.date.month][appointment.date.day][`${index}`]})
+            }
         }
-
         return (
             <>
-                {doctor && <div style={{display:'flex',flexDirection:'column',width:'400px'}}>
+                {doctor &&
+                <div style={{display:'flex',flexDirection:'column',width:'400px'}}>
                     <p>{doctor.photo}</p>
                     <p>{doctor.name}</p>
                     <p>{doctor.lastName}</p>
                     <p>{doctor.skillsDescription}</p>
-                    <select onChange={this.chooseSpeciality} defaultValue='choose spec'>
+                    <select onChange={(e)=>setAppointmentSpec(e.target.value)} defaultValue='choose spec'>
                         <option disabled >choose spec</option>
-                        {doctor.speciality.map(el=> (
-                            <option key={el}>{el}</option>
-                        ))}
+                        {
+                            doctor.speciality.map(el=> (
+                                <option key={el}>{el}</option>
+                            ))
+                        }
 
                     </select>
-                    {this.state.spec && <input type="date" onChange={this.changeDate}/>}
-                    {this.state.date.year !== 0 &&
+
+                    {appointment.spec && <input type="date" onChange={(e)=>setAppointmentDate(e.target.value)}/>}
+
+                    {appointment.date.year !== 0 &&
                     <div>
-                        {Object.values(schedule)[0][this.state.date.day] ?
-                            <div>
-                            <select onChange={this.chooseTime}>
-                                {Object.values(schedule)[0][this.state.date.day].map(el=> (
-                                    <option key={el}>{el}</option>
-                                ))}
-                                
-                            </select>
-                                <input type="time" readOnly placeholder="Time will be calculated" value={this.state.time ? +this.state.time.split(':')[0] + dataServices[this.state.spec].duration + ':00' : ''}/>
-                            </div>
-                            : <p>No work today</p>}
+                        {
+                            ( +appointment.date.month >= new Date().getMonth()+1 && +appointment.date.day >= new Date().getDate() ) ?
+                                doctor.schedule[appointment.date.month][appointment.date.day] ?
+                                    <div>
+                                        <select onChange={(e)=>setAppointmentTime(e.target.value)} defaultValue='choose time'>
+                                            <option disabled >choose time</option>
+                                            {
+                                                timeArray.map(el=> (
+                                                    <option key={Object.keys(el)[0]}>{Object.values(el)[0] ? Object.keys(el)[0] : null}</option>
+                                                ))
+                                            }
+
+                                        </select>
+                                        <input type="time" readOnly placeholder="Time will be calculated" value={appointment.time ? +appointment.time.split(':')[0] + dataServices[appointment.spec].duration + ':00' : ''}/>
+                                    </div>
+                                    : <p>No work today</p>
+                                : <p>Please choose current or future date</p>
+                        }
                     </div>
                     }
-            </div>}
-                </>
+
+                    {appointment.time &&
+                    <div style={{display:"flex",flexDirection:"column"}}>
+                        <input type='text' placeholder='Add comments here' onChange={(e)=>setAppointmentComment(e.target.value)}/>
+                        <button onClick={()=>putOrders([...dataOrders,appointment])}>Confirm Appointment</button>
+                    </div>
+                    }
+
+                </div>
+                }
+            </>
         );
     }
 }
-

+ 31 - 0
src/components/Doctors.js

@@ -0,0 +1,31 @@
+import React from 'react';
+import {Link} from 'react-router-dom'
+
+export default class Doctors extends React.Component {
+
+
+    render() {
+        const {data} = this.props
+        return (
+            <div style={{display:'flex', justifyContent:'center', flexWrap:'wrap'}}>
+                {data.map(el => (
+                    <div key={el.id}
+                         style={{display: 'flex', flexDirection: 'column', width: '300px', margin: '10px 20px'}}>
+                        <Link to={`/doctors/${el.id}`}>
+                            <p>{el.photo}</p>
+                            <p>{el.name}</p>
+                            <p>{el.lastName}</p>
+                            <p>{el.age}</p>
+                            <p>{el.skillsDescription}</p>
+                        </Link>
+                        {el.speciality.map(el => (
+                            <Link to={`/services/${el}`} key={el}>{el}</Link>
+                        ))}
+                        <Link to={`/appointment/${el.id}`}>Make an appointment</Link>
+                    </div>
+                ))
+                }
+            </div>
+        );
+    }
+}

+ 6 - 3
src/components/Service.js

@@ -1,4 +1,5 @@
 import React from 'react';
+import {Link} from "react-router-dom";
 
 
 export default class Service extends React.Component {
@@ -8,10 +9,12 @@ export default class Service extends React.Component {
         const {his,data} = this.props;
         const path = his.match.params.service;
         return (
-            <div >
+            <div style={{display:'flex',flexDirection:'column', width:'200px', margin:'10px 20px'}}>
                 {data[path].name}
-                {data[path].description}
-                {data[path].price}
+                <p>Duration:{data[path].duration}h</p>
+                <p>{data[path].description}</p>
+                <p>Price:{data[path].price}$</p>
+                <Link to={`/appointment/${path}`}>Make an appointment</Link>
             </div>
         );
     }

+ 29 - 0
src/components/Services.js

@@ -0,0 +1,29 @@
+import React from 'react';
+import {Link} from 'react-router-dom'
+
+export default class Services extends React.Component {
+
+
+    render() {
+        const {data} = this.props;
+        return (
+            <div style={{display:'flex', justifyContent:'center', flexWrap:'wrap'}}>
+                {
+                    data.map(el => (
+                        <div key={el.id} style={{display:'flex',flexDirection:'column', width:'200px', margin:'10px 20px'}}>
+                            <p>{el.name}</p>
+                            <p>Duration:{el.duration}h</p>
+                            <p>{el.description}</p>
+                            <p>Price:{el.price}$</p>
+                            <div>
+                            <Link to={`/services/service${el.id}`}>More Info</Link>
+                                <button>Make appointment</button>
+                            </div>
+                        </div>
+                    ))
+                }
+
+            </div>
+        );
+    }
+}

+ 7 - 0
src/components/button.js

@@ -0,0 +1,7 @@
+import React from 'react';
+
+export default ({ text,type = 'button', ...rest }) => (
+    <button type={type} {...rest}>
+        { text }
+    </button>
+);

+ 1 - 1
src/components/header/navigation.js

@@ -9,7 +9,7 @@ const liArr = [
 	{ path: "/doctors",  id: 2,  text: "Специалисты"  },
 	{ path: "/services", id: 3,  text: "Услуги" },
 	{ path: "/reviews", id: 4, text: "Отзывы"  },
-	{ path: "/authorization", id: 5, text: "Войти" },
+	{ path: "/auth", id: 5, text: "Войти", hideWhenAuth: true }
 ];
 
 export default ( props ) => (

+ 13 - 0
src/components/input.js

@@ -0,0 +1,13 @@
+import React from 'react';
+
+export default ({ id, label, type = "text", fail, touch, ...rest }) => (
+    <label htmlFor={id} className="input-box">
+        {label}
+        <input 
+            className={fail && touch ? 'input-box__input input-box__input--fail' : 'input-box__input'}
+            id={id}
+            type={type}
+            {...rest}
+        />
+    </label>
+);

+ 3 - 0
src/components/loader.js

@@ -0,0 +1,3 @@
+import React from "react";
+
+export default ({ children, flag }) => (flag ? <div>Loading...</div> : children);

+ 80 - 80
src/components/main/reviews.js

@@ -6,245 +6,245 @@ import Button from "../buttons/button";
 
 const services =  [
     {
-      description: "Первичное эндодонтическое лечение зуба",
+      name: "Первичное эндодонтическое лечение зуба",
         duration: 1,
-     name: "Эндодонтическое лечение с помощью микроскопа",
+     description: "Эндодонтическое лечение с помощью микроскопа",
       price: 3560
     },
     {
-      description: "Удаление штифта из корневого канала",
+      name: "Удаление штифта из корневого канала",
       duration: 1,
-     name:  "Эндодонтическое лечение с помощью микроскопа",
+     description:  "Эндодонтическое лечение с помощью микроскопа",
       price: 596
     },
     {
-      description: "Удаление чужеродного инструмента из корневого канала",
+      name: "Удаление чужеродного инструмента из корневого канала",
       duration: 2,
-     name:  "Эндодонтическое лечение с помощью микроскопа",
+     description:  "Эндодонтическое лечение с помощью микроскопа",
       price: 1490
     },
     {
-      description: "Повторное эндодонтическое лечение зуба",
+      name: "Повторное эндодонтическое лечение зуба",
       duration: 2,
-     name:  "Эндодонтическое лечение с помощью микроскопа",
+     description:  "Эндодонтическое лечение с помощью микроскопа",
       price: 3960
     },
     {
-      description: "Поиск и прохождение 1 корневого канала",
+      name: "Поиск и прохождение 1 корневого канала",
       duration: 1,
-     name:  "Эндодонтическое лечение с помощью микроскопа",
+     description:  "Эндодонтическое лечение с помощью микроскопа",
       price: 1600
     },
   
   
     {
-      description: "Комплексная чистка зубов",
+      name: "Комплексная чистка зубов",
       duration: 2,
-     name: "Лечение пародонтита",
+     description: "Лечение пародонтита",
       price: 945
     },
     {
-      description: "Вектор-терапия (полный курс)",
+      name: "Вектор-терапия (полный курс)",
       duration: 3,
-     name: "Лечение пародонтита",
+     description: "Лечение пародонтита",
       price: 3300
     },
     {
-      description: "Плазмолифтинг",
+      name: "Плазмолифтинг",
       duration: 1,
-     name: "Лечение пародонтита",
+     description: "Лечение пародонтита",
       price: 1970
     },
     {
-      description: "Закрытый кюретаж зубов",
+      name: "Закрытый кюретаж зубов",
       duration: 2,
-     name: "Лечение пародонтита",
+     description: "Лечение пародонтита",
       price: 396
     },
   
   
     {
-      description: "Коронка пластмассовая",
+      name: "Коронка пластмассовая",
       duration: 1,
-     name: "Протезирование",
+     description: "Протезирование",
       price: 590
     },
     {
-      description: "Коронка металлокерамическая",
+      name: "Коронка металлокерамическая",
       duration: 1,
-     name: "Протезирование",
+     description: "Протезирование",
       price:  4960
     },
     {
-      description: "Коронка керамическая, безметалловая",
+      name: "Коронка керамическая, безметалловая",
       duration: 2,
-     name: "Протезирование",
+     description: "Протезирование",
       price: 6650
     },
     {
-      description: "Винир керамический",
+      name: "Винир керамический",
       duration: 2,
-     name: "Протезирование",
+     description: "Протезирование",
       price: 7400
     },
     {
-      description: "Люминиры",
+      name: "Люминиры",
       duration: 2,
-     name: "Протезирование",
+     description: "Протезирование",
       price: 15500
     },
     {
-      description: "Изготовление протеза",
+      name: "Изготовление протеза",
       duration: 1,
-     name: "Протезирование",
+     description: "Протезирование",
       price: 6750
     },
     {
-      description: "Бюгельный протез",
+      name: "Бюгельный протез",
       duration: 3,
-     name: "Протезирование",
+     description: "Протезирование",
       price: 12600
     },
   
   
     {
-      description: "Брекет-система (1 челюсть)",
+      name: "Брекет-система (1 челюсть)",
       duration: 1,
-     name: "Ортодонтия",
+     description: "Ортодонтия",
       price: 11800
     },
     {
-      description: "Пластинка ортодонтическая на одну челюсть",
+      name: "Пластинка ортодонтическая на одну челюсть",
       duration: 1,
-     name: "Ортодонтия",
+     description: "Ортодонтия",
       price: 4200
     },
     {
-      description: "Елайнер-капа - 1 челюсть (10 кап)",
+      name: "Елайнер-капа - 1 челюсть (10 кап)",
       duration: 2,
-     name: "Ортодонтия",
+     description: "Ортодонтия",
       price: 19800
     },
   
   
     {
-      description: "Удаление зуба",
+      name: "Удаление зуба",
       duration: 1,
-     name: "Хирургия",
+     description: "Хирургия",
       price: 490
     },
     {
-      description: "Удаление кисты",
+      name: "Удаление кисты",
       duration: 2,
-     name: "Хирургия",
+     description: "Хирургия",
       price: 2800
     },
     {
-      description: "Закрытие рецессии десны",
+      name: "Закрытие рецессии десны",
       duration: 2,
-     name: "Хирургия",
+     description: "Хирургия",
       price: 2350
     },
   
   
     {
-      description: "Пластика десны (в области 1-3 зубов)",
+      name: "Пластика десны (в области 1-3 зубов)",
       duration: 2,
-     name: "Хирургическая пародонтология",
+     description: "Хирургическая пародонтология",
       price: 970
     },
     {
-      description: "Подрезание уздечки с помощью лазера",
+      name: "Подрезание уздечки с помощью лазера",
       duration: 1,
-     name: "Хирургическая пародонтология",
+     description: "Хирургическая пародонтология",
       price: 1700
     },
     {
-      description: "Открытый кюретаж в области 1 зуба",
+      name: "Открытый кюретаж в области 1 зуба",
       duration: 2,
-     name: "Хирургическая пародонтология",
+     description: "Хирургическая пародонтология",
       price: 980
     },
   
   
     {
-      description: "Установка импланта",
+      name: "Установка импланта",
       duration: 2,
-     name: "Имплантация",
+     description: "Имплантация",
       price: 7656
     },
     {
-      description: "Синус-лифтинг",
+      name: "Синус-лифтинг",
       duration: 2,
-     name: "Имплантация",
+     description: "Имплантация",
       price: 3500
     },
   
   
     {
-      description: "Консультация (осмотр, рекомендации) с составлением плана лчения",
+      name: "Консультация (осмотр, рекомендации) с составлением плана лчения",
       duration: 2,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 396
     },
     {
-      description: "Психологическая адаптация (от 30 мн)",
+      name: "Психологическая адаптация (от 30 мн)",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 190
     },
     {
-      description: "Цифровая рентгенография (в обл. 1-3 зубов)",
+      name: "Цифровая рентгенография (в обл. 1-3 зубов)",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 145
     },
     {
-      description: "Оказание помощи при острой боли",
+      name: "Оказание помощи при острой боли",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 670
     },
     {
-      description: "Медикаментозная обработка корневого канала",
+      name: "Медикаментозная обработка корневого канала",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 322
     },
     {
-      description: "Пломбировка одного корневого канала молочного, постоянного зуба",
+      name: "Пломбировка одного корневого канала молочного, постоянного зуба",
       duration: 2,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 320
     },
     {
-      description: "Временная пломба",
+      name: "Временная пломба",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 230
     },
     {
-      description: "Пломба",
+      name: "Пломба",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 965
     },
     {
-      description: "Гигиеническая чистка ультразвуком (1 челюсть)",
+      name: "Гигиеническая чистка ультразвуком (1 челюсть)",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 520
     },
     {
-      description: "Удаление зуба",
+      name: "Удаление зуба",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 345
     },
     {
-      description: "Общая анестезия – седация (медикаментозный сон ) (1 час)",
+      name: "Общая анестезия – седация (медикаментозный сон ) (1 час)",
       duration: 1,
-     name: "Детская стоматология",
+     description: "Детская стоматология",
       price: 1950
     }
   ]
@@ -258,10 +258,10 @@ export default class Reviews extends React.Component {
         return (
             <>
                 <h2>Отзывы</h2>
-                <div className = "reviews-container">
-                    <Button className = "btn" text = "POST to servises" onClick = { ( ) => { 
-                        console.log ( "hello" )
-                        services.map  ( el => postServices ( el )  ) } } />
+                <div classdescription = "reviews-container">
+                    <Button className = "btn" text = "POST to servises"
+                     onClick = { ( ) => {              }  }
+                        />
                  </div>
             </>
         ) 

+ 179 - 0
src/components/signIn.js

@@ -0,0 +1,179 @@
+import React, { Component } from 'react';
+
+import Input from './input';
+import Button from './button';
+
+class SignIn extends Component {
+    state = { 
+        form: {
+            email: {
+                id: 1,
+                name: 'email',
+                type: 'email',
+                label: 'Email',
+                validation: {
+                    requred: {
+                        cb: v => v.trim() === ""
+                    }
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            },
+            password: {
+                id: 2,
+                name: 'password',
+                type: 'password',
+                label: 'Password',
+                validation: {
+                    requred: {
+                        cb: v => v.trim() === ""
+                    },
+                    minL: {
+                        cb: v => v.trim().length < 6
+                    }
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            }
+        },
+        validForm: false
+     };
+
+     componentDidMount(){
+        this.loadJS("https://apis.google.com/js/platform.js?onload=init");
+     }
+
+     loadJS = src => {
+		const body = window.document.getElementsByTagName("body")[0];
+		const ref = body.getElementsByTagName("script")[0];
+
+		const script = window.document.createElement("script");
+		script.src = src;
+		script.async = true;
+		script.defer = true;
+		script.onload = () => {
+			window.gapi.load("auth2", () => {
+				console.log("success");
+			});
+		};
+		ref.parentNode.insertBefore(script, ref);
+    };
+    
+    googleAuth = () => {
+		const ga = window.gapi.auth2.init({
+			client_id: '1018884941403-cd6ilegbhitova86k4i7k89eqldpatfj.apps.googleusercontent.com'
+		});
+
+		ga.signIn().then(info => {
+			const { Zi } = info;
+			fetch("http://subdomain.entony.fs.a-level.com.ua/api/auth/google", {
+				method: "POST",
+				headers: {
+					"Content-Type": "application/json"
+				},
+				body: JSON.stringify({ access_token: Zi.access_token })
+			})
+				.then(res => res.json())
+				.then(res => console.log("res", res))
+				.catch(err => console.log(err.response));
+		});
+    };
+    
+    instaAuth = () => {
+        
+    }
+    
+     validator = (rules,value) => {
+         const { required, minL } = rules;
+
+         let valid = true;
+         if(required){
+             valid = value.trim() === '' && valid;
+         }
+
+         if(minL){
+             valid = value.trim().length < minL && valid;
+         }
+
+         return valid
+     };
+
+     submit = e => {
+         e.preventDefault();
+
+         const values = Object.keys(this.state.form).reduce((prev,elem) => {
+             return {...prev, [elem]: this.state.form[elem].value };
+         }, {});
+
+         this.props.submitHandler(values);
+     };
+
+     onChangeHandler = e => {
+         const { name, value } = e.target;
+
+         this.setState(prevState => {
+             const values = Object.keys(prevState.form).reduce((prev, elem) => {
+                 if (elem === name) return prev.concat(value);
+                 return prev.concat(prevState.form[elem].value);
+             },[]);
+
+             return {
+                 ...prevState,
+                 form: {
+                     ...prevState.form,
+                     [name]: {
+                         ...prevState.form[name],
+                         value,
+                         touch: true,
+                         fail: this.validator(prevState.form[name].validation, value)
+                     }
+                 },
+                 validForm: values.some(value => value)
+             };
+         });
+     };
+
+    render() { 
+        const { form, validForm } = this.state;
+        const { error } = this.props;
+        
+        return (
+                <div className="auth__auth-box">
+                    <form onSubmit={this.submit} className="auth__auth-form">
+                        {Object.keys(form).map(input_name => {
+                            return (
+                                <Input 
+                                    key={form[input_name].id}
+                                    id={form[input_name].id}
+                                    value={form[input_name].value}
+                                    name={form[input_name].name}
+                                    type={form[input_name].type}
+                                    fail={form[input_name].fail}
+                                    touch={form[input_name].touch}
+                                    label={form[input_name].label}
+                                    onChange={this.onChangeHandler}
+                                />
+                          );
+                     })}
+                    {error && <p className='auth__error-auth-text'>{error}</p>}
+                     <div className="auth__control-box">
+                         <Button className='auth__submit-btn'
+                            disabled={!validForm}
+                            type='submit'
+                            text='Sign In'/>
+                    </div>
+                 </form>
+                 <div className="auth__google-auth">
+                    <Button 
+                        type="button" 
+                        text='Sign in with Google' 
+                        onClick={this.googleAuth}/>
+                </div>
+             </div> 
+         );
+    }
+}
+ 
+export default SignIn;

+ 173 - 0
src/components/signUp.js

@@ -0,0 +1,173 @@
+import React, { Component } from 'react';
+
+import Input from './input';
+import Button from './button';
+
+class SignUp extends Component {
+    state = {
+        form: {
+            email: {
+                id: 1,
+                name: 'email',
+                type: 'email',
+                label: 'Email',
+                validation: {
+                    required: true
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            },
+            firstName: {
+                id: 2,
+                name: 'firstName',
+                type: 'text',
+                label: 'First Name',
+                validation: {
+                    required: true
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            },
+            lastName: {
+                id: 3,
+                name: 'lastName',
+                type: 'text',
+                label: 'Last Name',
+                validation: {
+                    required: true
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            },
+            // phone: {
+            //     id: 4,
+            //     name: 'phone',
+            //     type: 'phone',
+            //     label: 'Phone',
+            //     validation: {
+            //         required: true
+            //     },
+            //     fail: false,
+            //     touch: false,
+            //     value: ''
+            // },
+            password: {
+                id: 5,
+                name: 'password',
+                type: 'password',
+                label: 'Password',
+                validation: {
+                    required: true,
+                    minL: 6
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            },
+            confirmPassword: {
+                id: 6,
+                name: 'confirmPassword',
+                type: 'password',
+                label: 'Confirm Password',
+                validation: {
+                    required: true,
+                    minL: 6,
+                    match: 'password'
+                },
+                fail: false,
+                touch: false,
+                value: ''
+            }
+        },
+        validForm: false 
+    }
+
+    validator = (rules,value) => {
+        const { required, minL } = rules;
+
+        let valid = true;
+        if(required){
+            valid = value.trim() === '' && valid;
+        }
+
+        if(minL){
+            valid = value.trim().length < minL && valid;
+        }
+
+        return valid
+    };
+
+    submit = e => {
+        e.preventDefault();
+
+        const values = Object.keys(this.state.form).reduce((prev,elem) => {
+            return {...prev, [elem]: this.state.form[elem].value };
+        }, {});
+
+        this.props.submitHandler(values);
+    };
+
+    onChangeHandler = e => {
+        const { name, value } = e.target;
+
+        this.setState(prevState => {
+            const values = Object.keys(prevState.form).reduce((prev, elem) => {
+                if (elem === name) return prev.concat(value);
+                return prev.concat(prevState.form[elem].value);
+            },[]);
+
+            return {
+                ...prevState,
+                form: {
+                    ...prevState.form,
+                    [name]: {
+                        ...prevState.form[name],
+                        value,
+                        touch: true,
+                        fail: this.validator(prevState.form[name].validation, value)
+                    }
+                },
+                validForm: values.some(value => value)
+            };
+        });
+    };
+
+    render() { 
+        const { form, validForm } = this.state;
+        const { error, successRegister } = this.props;
+
+        return ( 
+            <div>
+                <form onSubmit={this.submit} className="auth__auth-form">
+                        {Object.keys(form).map(input_name => {
+                            return (
+                                <Input 
+                                    key={form[input_name].id}
+                                    id={form[input_name].id}
+                                    value={form[input_name].value}
+                                    name={form[input_name].name}
+                                    type={form[input_name].type}
+                                    fail={form[input_name].fail}
+                                    touch={form[input_name].touch}
+                                    label={form[input_name].label}
+                                    onChange={this.onChangeHandler}
+                                />
+                          );
+                     })}
+                    {successRegister && <p className="auth_success-auth-text">{successRegister}</p>}
+                    {error && <p className='auth__error-auth-text'>{error}</p>}
+                     <div className="auth__control-box">
+                         <Button className='auth__submit-btn'
+                            disabled={!validForm}
+                            type='submit'
+                            text='Sign Up'/>
+                    </div>
+                 </form>
+            </div> );
+    }
+}
+ 
+export default SignUp;

+ 73 - 0
src/containers/auth.js

@@ -0,0 +1,73 @@
+import React, { Component } from "react";
+import { connect } from 'react-redux';
+import { Redirect } from 'react-router-dom';
+
+import { auth, register } from '../actions/auth';
+
+import SignUpForm from '../components/signUp';
+import SignInForm from '../components/signIn';
+import Loader from '../components/loader';
+
+class Auth extends Component {
+  state = { auth: true };
+
+  toggleAuth = () => this.setState(prevState => ({ auth: !prevState.auth}));
+
+  render() {
+    const { auth } = this.state;
+
+    if(this.props.user) {
+      return <Redirect to='/' />;
+    }
+
+    return (
+      <div className="auth">
+        <div className="auth__content">
+          { auth ? (
+              <Loader flag={this.props.isFetching}>
+                <SignInForm error={this.props.errorFromAuth} submitHandler={this.props.auth} />
+              </Loader>
+          ) : (
+              <Loader flag={this.props.isFetching}>
+                <SignUpForm 
+                  error={this.props.errorFromAuth}
+                  submitHandler={this.props.register}
+                  successRegister={this.props.successRegister}
+                />
+              </Loader>
+          )}
+
+          <div className="auth__additional-content">
+            {auth ? (
+              <p className="auth__text">
+                Do you have account ? {" "}
+                <span className="auth__toggle-span" onClick={this.toggleAuth}>
+									Sing Up
+								</span>
+              </p>
+            ) : (
+              <p className="auth__text">
+								I have account{" "}
+								<span className="auth__toggle-span" onClick={this.toggleAuth}>
+									Sign In
+								</span>
+							</p>
+            )}
+          </div>
+        </div>
+      </div>
+    );
+  }
+}
+
+const mapStateToProps = state => ({
+  user: state.auth.user,
+  isFetching: state.auth.isFetching,
+  errorFromAuth: state.auth.error,
+  successRegister: state.auth.successRegister
+})
+
+export default connect(
+  mapStateToProps,
+  { auth,register }
+)(Auth);

+ 0 - 23
src/db.json

@@ -1,23 +0,0 @@
-{
-  "doctors": [
-    {
-      "age":30,
-      "id":1,
-      "lastName":"Sidorov",
-      "name":"Ivan",
-      "photo":"some photo here",
-      "skillsDescription":"Lorem ipsum dolor sit amet, consectetur adipisi...",
-      "schedule": {
-        "07": {
-          "09": ["8:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00"],
-          "10": ["8:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
-          "11": ["8:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
-          "12": ["8:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00"],
-          "13": false,
-          "14": false
-        }
-      }
-
-    }
-  ]
-}

+ 3 - 3
src/index.js

@@ -1,6 +1,6 @@
 import React from 'react';
 import ReactDOM from 'react-dom';
-import App from './App'
+import App from './router'
 import * as serviceWorker from './serviceWorker';
 
 import {BrowserRouter} from "react-router-dom";
@@ -9,8 +9,8 @@ import {Provider} from "react-redux";
 
 
 import "./style/normalize.css"
-// import "./style/style.css"
-import "./style/all.scss";
+import './style/all.scss'
+import "./style/auth.scss"
 
 ReactDOM.render(
     <Provider store={store}>

+ 43 - 0
src/reducers/auth.js

@@ -0,0 +1,43 @@
+import * as types from '../actionsTypes/actionsTypes'
+
+const initialState = {
+    user: null,
+    isFetching: false,
+    token:null,
+    error:null,
+    successRegister: null
+}
+
+export default (state = initialState, action) => {
+    switch(action.type){
+        case types.AUTH_REQUEST: {
+            return {...state, isFetching: true};
+        }
+
+        case types.AUTH_REQUEST_SUCCESS: {
+            const { user, token } = action.payload;
+            return {...state, isFetching: false, user, token };
+        }
+
+        case types.AUTH_REQUEST_FAIL: {
+            return {...state, isFetching: false,error: action.payload.response.data.message };
+        }
+
+        case types.REGISTRATION_REQUEST: {
+            return { ...state, isFetching: true}
+        }
+
+        case types.REGISTRATION_REQUEST_SUCCESS: {
+            const { message } = action.payload;
+            return { ...state, isFetching: false, successRegister: message }
+        }
+
+        case types.REGISTRATION_REQUEST_FAIL: {
+            return { ...state, isFetching: false, error: action.payload.response.data.message}
+        }
+        
+        default:
+             return state
+    }
+
+}

+ 11 - 0
src/reducers/index.js

@@ -0,0 +1,11 @@
+import {combineReducers} from "redux";
+
+import {appReducer} from "./reducers";
+import auth from './auth';
+
+
+
+export default combineReducers({
+    app:appReducer,
+    auth,
+})

+ 277 - 0
src/reducers/reducers.js

@@ -0,0 +1,277 @@
+import * as types from '../actionsTypes/actionsTypes'
+
+const defaultState = {
+    currentUser:{
+        email:"dead1990bb@gmail.com",
+        id:1,
+        name:"Borys",
+        lastName:"Kozhyn",
+        age:29,
+        phone:"380938807183",
+        avatar:"some avatar",
+        password:"123456",
+        root:false,
+        doctor:false,
+    },
+    doctors:[],
+    services:{
+        service1:{id:1},
+        service2:{id:2},
+        service3:{id:3},
+        service4:{id:4},
+        service5:{id:5},
+        service6:{id:6},
+        service7:{id:7},
+        service8:{id:8},
+        service9:{id:9},
+    },
+    orders:[],
+    users:[],
+    reviews: [],
+    appointment:{
+        date:{
+            year:0,
+            month:0,
+            day:0
+        },
+        price:null,
+        time:null,
+        doctorId:null,
+        spec:null,
+        user:null,
+        comment:''
+    },
+    isFetching:false,
+    error: null,
+
+};
+
+// -----------------------------------------------------------------------------------------------------------------
+
+export const appReducer = (state = defaultState,action) => {
+
+    switch (action.type) {
+// -----------------------------------------------------------------------------------------------------------------
+
+        case types.CHANGE_APPOINTMENT_DATE : {
+            return {
+                ...state,
+                appointment:{
+                    ...state.appointment,
+                    date:{
+                        year: action.payload.split('-')[0],
+                        month: action.payload.split('-')[1],
+                        day: action.payload.split('-')[2],
+                    }
+                }
+            };
+        }
+
+        case types.CHANGE_APPOINTMENT_DOCTOR : {
+            return {
+                ...state,
+                appointment:{
+                    ...state.appointment,
+                    doctorId:action.payload
+                }
+            };
+        }
+
+        case types.CHANGE_APPOINTMENT_TIME : {
+            return {
+                ...state,
+                appointment:{
+                    ...state.appointment,
+                    time:action.payload
+                }
+            };
+        }
+
+        case types.CHANGE_APPOINTMENT_SPEC : {
+            return {
+                ...state,
+                appointment:{
+                    ...state.appointment,
+                    spec:action.payload,
+                    id:state.orders[state.orders.length-1].id+1,
+                    price:+state.services[action.payload].price
+                }
+            };
+        }
+
+        case types.CHANGE_APPOINTMENT_COMMENT : {
+            return {
+                ...state,
+                appointment:{
+                    ...state.appointment,
+                    comment:action.payload
+                }
+            };
+        }
+
+        case types.CLEAR_APPOINTMENT : {
+            return {
+                ...state,
+                appointment: defaultState.appointment
+            };
+        }
+
+// -----------------------------------------------------------------------------------------------------------------
+
+
+        case types.PUT_ORDERS_REQUEST : {
+            return {
+                ...state,
+                isFetching: true
+            };
+        }
+
+        case types.PUT_ORDERS_REQUEST_SUCCESS : {
+            return {
+                ...state,
+                appointment: defaultState.appointment,
+                orders:action.payload,
+                isFetching: false
+            }
+        }
+
+        case types.PUT_ORDERS_REQUEST_FAIL : {
+            return {
+                ...state,
+                error:action.payload,
+                isFetching: false
+            }
+        }
+
+// -----------------------------------------------------------------------------------------------------------------
+
+
+        case types.GET_ALL_REQUEST : {
+            return {
+                ...state,
+                isFetching: true
+            };
+        }
+
+        case types.GET_ALL_REQUEST_SUCCESS : {
+            return {
+                ...state,
+                doctors: action.payload.doctors,
+                services: action.payload.services,
+                orders: action.payload.orders,
+                users: action.payload.users,
+                reviews: action.payload.reviews,
+                isFetching: false
+            }
+        }
+
+        case types.GET_ALL_REQUEST_FAIL : {
+            return {
+                ...state,
+                error:action.payload,
+                isFetching: false
+            }
+        }
+
+// -----------------------------------------------------------------------------------------------------------------
+
+        case types.GET_DOCTORS_REQUEST : {
+            return {
+                ...state,
+                isFetching: true
+            };
+        }
+
+        case types.GET_DOCTORS_REQUEST_SUCCESS : {
+            return {
+                ...state,
+                doctors:action.payload,
+                isFetching: false
+            }
+        }
+
+        case types.GET_DOCTORS_REQUEST_FAIL : {
+            return {
+                ...state,
+                error:action.payload,
+                isFetching: false
+            }
+        }
+
+// -----------------------------------------------------------------------------------------------------------------
+
+        case types.GET_SERVICES_REQUEST : {
+            return {
+                ...state,
+                isFetching: true
+            };
+        }
+
+        case types.GET_SERVICES_REQUEST_SUCCESS : {
+            return {
+                ...state,
+                services:action.payload,
+                isFetching: false
+            }
+        }
+
+        case types.GET_SERVICES_REQUEST_FAIL : {
+            return {
+                ...state,
+                error:action.payload,
+                isFetching: false
+            }
+        }
+
+// -----------------------------------------------------------------------------------------------------------------
+case types.POST_DOCTORS_REQUEST : {
+    return {
+        ...state,
+        isFetching: true
+    };
+}
+
+case types.POST_DOCTORS_REQUEST_SUCCESS : {
+    return {
+        ...state,
+        isFetching: false
+    }
+}
+
+case types.POST_DOCTORS_REQUEST_FAIL : {
+    return {
+        ...state,
+        error: action.payload,
+        isFetching: false
+    }
+}
+
+// _______________________________________________________________________________
+
+case types.POST_SERVICES_REQUEST : {
+    return {
+        ...state,
+        isFetching: true
+    };
+}
+
+case types.POST_SERVICES_REQUEST_SUCCESS : {
+    return {
+        ...state,
+        isFetching: false
+    }
+}
+
+case types.POST_SERVICES_REQUEST_FAIL : {
+    return {
+        ...state,
+        error: action.payload,
+        isFetching: false
+    }
+}
+
+
+        default:
+            return state
+    }
+};

+ 53 - 11
src/App.js

@@ -1,9 +1,20 @@
 import React from 'react';
 import {connect} from 'react-redux'
 import {Switch, Route} from "react-router-dom";
-// import axios from "axios";
 
-import {getDoctors,getServices, postServices} from "./store/app/actions";
+import {
+    getAll,
+    getDoctors,
+    getServices,
+    setAppointmentDate,
+    setAppointmentDoctor,
+    setAppointmentTime,
+    setAppointmentSpec,
+    setAppointmentComment,
+    clearAppointment,
+    putOrders,
+
+} from "./actions/actions";
 
 import Header from "./components/header/index"
 import Footer from "./components/Footer";
@@ -11,11 +22,17 @@ import Main from "./components/main/Main";
 import Doctors from "./components/specialists/doctors";
 import Service from "./components/Service";
 import Appointment from "./components/Appointment";
+import Services from "./components/Services"
+import Auth from './containers/auth'
 
 
 export class App extends React.Component {
 
     componentDidMount() {
+        // this.props.getDoctors();
+        // this.props.getServices()
+        this.props.getAll()
+
         this.props.getDoctors();
         this.props.getServices( );
         // this.props.postServices()
@@ -47,20 +64,37 @@ export class App extends React.Component {
         // })
         //     .then (res => res.json ())
         //     .then (res => console.log (res))
-}
-
+    }
 
     render() {
-
+        console.log(this.props.app)
         return (
-            <div className="App">
+            <div className="container">
                 <Header/>
                     <Switch>
                         <Route exact path="/" component={Main} />
-                        <Route exact path="/doctors" render={() => <Doctors data={this.props.app.doctors} flag={'doctors'}/> } />
-                        <Route exact path="/services" render={() => <Doctors data={Array.from(Object.values(this.props.app.services))} flag={'services'}/>} />
-                        <Route exact path="/services/:service" render={(props) => <Service his={props} data={this.props.app.services}/>} />
-                        <Route  path="/appointment/:doctor" render={(props) => <Appointment his={props} dataDoctors={this.props.app.doctors} dataServices={this.props.app.services}/>} />
+                        <Route exact path="/doctors" render={() => <Doctors data={this.props.app.doctors} /> } />
+                        <Route exact path="/services" render={() => <Services data={Array.from(Object.values(this.props.app.services))} />} />
+                        <Route exact path="/reviews" render={() => <div>Reviews</div>} />
+                        <Route exact path="/services/:service" render={(props) => <Service
+                            his={props}
+                            data={this.props.app.services}
+                        />} />
+                        <Route  path="/appointment/:doctor" render={(props) => <Appointment
+                            his={props}
+                            dataDoctors={this.props.app.doctors}
+                            dataServices={this.props.app.services}
+                            dataOrders={this.props.app.orders}
+                            appointment={this.props.app.appointment}
+                            setAppointmentDate={this.props.setAppointmentDate}
+                            setAppointmentDoctor={this.props.setAppointmentDoctor}
+                            setAppointmentTime={this.props.setAppointmentTime}
+                            setAppointmentSpec={this.props.setAppointmentSpec}
+                            setAppointmentComment={this.props.setAppointmentComment}
+                            clearAppointment={this.props.clearAppointment}
+                            putOrders={this.props.putOrders}
+                        />} />
+                        <Route exact path="/auth" component={Auth} />
                     </Switch>
                 <Footer/>
             </div>
@@ -75,9 +109,17 @@ const mapStateToProps = state => {
 };
 
 const mapDispatchToProps = {
+    getAll,
     getDoctors,
     getServices,
-    postServices
+    setAppointmentDate,
+    setAppointmentDoctor,
+    setAppointmentTime,
+    setAppointmentSpec,
+    setAppointmentComment,
+    clearAppointment,
+    putOrders
+
 };
 
 export default connect (mapStateToProps,mapDispatchToProps)(App)

+ 1 - 1
src/store.js

@@ -1,6 +1,6 @@
 import { createStore, applyMiddleware } from "redux";
 import thunk from "redux-thunk";
 
-import rootReducer from './store/reducers'
+import rootReducer from './reducers/index'
 
 export const store = createStore(rootReducer, applyMiddleware(thunk));

+ 0 - 9
src/store/reducers.js

@@ -1,9 +0,0 @@
-import {combineReducers} from "redux";
-
-import {appReducer} from "./app/reducers";
-
-
-
-export default combineReducers({
-    app:appReducer
-})

+ 2 - 1
src/style/all.scss

@@ -3,7 +3,7 @@ $main-title-color: #3b3b3b;
 $main-text-color: #101010;
 $main-color:   #789084;
 $hover-color: #b1e8ca;
-$opacity-color: rgba(17,17,17,0.7);
+$opacity-color: rgba(17,17,17,0.9);
 
 //
 
@@ -113,6 +113,7 @@ body {
 	}
 	img {
 		margin: 150px auto 30px;
+		max-width: 350px;
 		@media (max-width: 768px) {
 			max-width: 200px;	
 		}

+ 116 - 0
src/style/auth.scss

@@ -0,0 +1,116 @@
+.auth {
+	width: 100%;
+	height: 100%;
+
+
+	&__content {
+		width: 30rem;
+		position: absolute;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+
+		padding: 2rem;
+		border: 1px solid #eee;
+	}
+
+	&__text {
+		font-size: 1.6rem;
+	}
+
+	&__toggle-span {
+		font-size: 1.6rem;
+		font-weight: bold;
+		color: rgb(102, 104, 223);
+		cursor: pointer;
+	}
+
+	&__auth-box {
+		margin-bottom: 2rem;
+	}
+
+	&__control-box {
+		margin-top: 2rem;
+	}
+
+	&__error-auth-text {
+		margin-top: 1rem;
+		text-align: center;
+		width: 100%;
+		color: #8f240a;
+		font-size: 2rem;
+	}
+
+	&__success-auth-text {
+		margin-top: 1rem;
+		text-align: center;
+		width: 100%;
+		color: #1eb437;
+		font-size: 2rem;
+	}
+
+	&__submit-btn {
+		width: 100%;
+		border: 1px solid #eee;
+		border-radius: 3px;
+
+		color: #fff;
+		background-color: #5f6df0;
+		border: none;
+		cursor: pointer;
+		font-weight: 600;
+		font-size: 1.2rem;
+		transition: 0.2s;
+		padding: 0.5rem 1rem;
+
+		&:focus {
+			outline: none;
+		}
+		&:hover {
+			color: #5f6df0;
+			background-color: #fff;
+			outline: none;
+			transform: translateY(-1px);
+			box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
+			&:after {
+				transform: scaleX(1.4) scaleY(1.6);
+				opacity: 0;
+			}
+		}
+
+		&:disabled {
+			color: #fff;
+			background-color: #eee;
+		}	
+	}
+}
+
+// input
+.input-box {
+	display: flex;
+	flex-direction: column;
+
+	&__input {
+		font-family: inherit;
+		color: inherit;
+		font-size: 1.5rem;
+		padding: 0.5rem 1rem;
+		border-radius: 2px;
+		background-color: rgba(255, 255, 255, 0.5);
+		border: none;
+		border-bottom: 3px solid #eee;
+		width: 100%;
+		display: block;
+		transition: all 0.3s;
+
+		&:focus {
+			outline: none;
+			box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1);
+			border-bottom: 3px solid green;
+		}
+
+		&--fail {
+			border-bottom: 3px solid #9e4560;
+		}
+	}
+}