Jelajahi Sumber

some changes

Boris K 5 tahun lalu
induk
melakukan
af9fed4042
3 mengubah file dengan 12 tambahan dan 10 penghapusan
  1. 7 7
      src/App.js
  2. 3 2
      src/components/Appointment.js
  3. 2 1
      src/components/main/team.js

+ 7 - 7
src/App.js

@@ -25,12 +25,12 @@ export class App extends React.Component {
         this.props.getServices();
 
      
-        // fetch("https://api-clinics.herokuapp.com/api/v1/doctors", {
-        //     method: "GET",
-        //     credentials: "include"
-        // })
-        //     .then(res => res.json())
-        //     .then(res => console.log (res))
+        fetch("https://api-clinics.herokuapp.com/api/v1/doctors", {
+            method: "GET",
+            credentials: "include"
+        })
+            .then(res => res.json())
+            .then(res => console.log (res))
 
         // fetch("https://api-clinics.herokuapp.com/api/v1/services", {
         //     method: "GET",
@@ -43,7 +43,7 @@ export class App extends React.Component {
         //     method : "POST",
         //     credentials: "include",
         //     headers: {
-        //         "Content-Type":   "aplication/json"
+        //         "Content-Type": "application/json"
         //     },
         //     body: JSON.stringify ({
         //         email: "test@test.com",

+ 3 - 2
src/components/Appointment.js

@@ -42,10 +42,11 @@ export class Appoint extends React.Component {
         return (
             <>
                 {doctor &&
-                    <div style={{display:'flex',flexDirection:'column',width:'400px'}}>
+                    <div style={{display:'flex',flexDirection:'column',width:'400px',margin:'100px 0'}}>
                         <img src={doctor.photo} alt=""/>
                         <p>{doctor.name}</p>
-                        <p>{doctor.lastName}</p>
+                        <p>{doctor.profession}</p>
+                        <p>Опыт работы {new Date().toISOString().split('T')[0].split('-')[0] - doctor.experience.split('T')[0].split('-')[0]} лет</p>
                         <p>{doctor.skillsDescription}</p>
 
                         {appointment.spec &&

+ 2 - 1
src/components/main/team.js

@@ -7,6 +7,7 @@ import {Link} from 'react-router-dom';
 export default class Team extends React.Component {
     render( ) {
         const {doctorsArr } = this.props
+        console.log(doctorsArr)
         return (
             <>
                 <h2>Наши врачи</h2>
@@ -21,7 +22,7 @@ export default class Team extends React.Component {
                             </div>
                              <div className="link-box">
                                 <Link to = "/doctors" className = "btn link more">Подробнее ...</Link>
-                                <Link to = "/doctors" className = "btn link ">Записаться на приём</Link>
+                                <Link to ={`/appointment/${el._id}`} className = "btn link ">Записаться на приём</Link>
                             </div>
                         </div>
                     )}