diff --git a/.babelrc b/.babelrc index 456751f..5b1ade7 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,11 @@ { - "presets": ["@babel/preset-env", "@babel/preset-react"] + "presets": [ + "@babel/preset-env", + "@babel/preset-react" + ], + "plugins": [ + [ + "@babel/plugin-proposal-class-properties" + ] + ] } \ No newline at end of file diff --git a/.gitignore b/.gitignore index f0d7bd8..6238175 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -app/ \ No newline at end of file +app/ +.DS_Store \ No newline at end of file diff --git a/dist/images/aaron-ladage.jpg b/dist/images/aaron-ladage.jpg new file mode 100644 index 0000000..1fcf72c Binary files /dev/null and b/dist/images/aaron-ladage.jpg differ diff --git a/dist/images/alejandro-cerro.jpg b/dist/images/alejandro-cerro.jpg new file mode 100644 index 0000000..ff6034b Binary files /dev/null and b/dist/images/alejandro-cerro.jpg differ diff --git a/dist/images/anna-scheuler.jpg b/dist/images/anna-scheuler.jpg new file mode 100644 index 0000000..627ffeb Binary files /dev/null and b/dist/images/anna-scheuler.jpg differ diff --git a/dist/images/brian-graves.jpg b/dist/images/brian-graves.jpg new file mode 100644 index 0000000..3497e9a Binary files /dev/null and b/dist/images/brian-graves.jpg differ diff --git a/dist/images/cody-frazer.jpg b/dist/images/cody-frazer.jpg new file mode 100644 index 0000000..f4381d2 Binary files /dev/null and b/dist/images/cody-frazer.jpg differ diff --git a/dist/images/fredy-alvarado.jpg b/dist/images/fredy-alvarado.jpg new file mode 100644 index 0000000..6425e35 Binary files /dev/null and b/dist/images/fredy-alvarado.jpg differ diff --git a/dist/images/henrique-eidt.jpg b/dist/images/henrique-eidt.jpg new file mode 100644 index 0000000..6426f87 Binary files /dev/null and b/dist/images/henrique-eidt.jpg differ diff --git a/dist/images/joseph-lawhorn.jpg b/dist/images/joseph-lawhorn.jpg new file mode 100644 index 0000000..78d59ee Binary files /dev/null and b/dist/images/joseph-lawhorn.jpg differ diff --git a/dist/images/khalid-saleem.jpg b/dist/images/khalid-saleem.jpg new file mode 100644 index 0000000..17d816c Binary files /dev/null and b/dist/images/khalid-saleem.jpg differ diff --git a/dist/images/ryan-heap.jpg b/dist/images/ryan-heap.jpg new file mode 100644 index 0000000..75f0b40 Binary files /dev/null and b/dist/images/ryan-heap.jpg differ diff --git a/dist/images/vequan-clark.jpg b/dist/images/vequan-clark.jpg new file mode 100644 index 0000000..25f209d Binary files /dev/null and b/dist/images/vequan-clark.jpg differ diff --git a/package-lock.json b/package-lock.json index e0d0549..a08afd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -112,6 +112,153 @@ "semver": "^5.5.0" } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", + "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.5", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/generator": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "requires": { + "@babel/types": "^7.11.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", + "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==" + }, + "@babel/helper-replace-supers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==" + }, + "@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/traverse": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + } + }, "@babel/helper-create-regexp-features-plugin": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.3.tgz", @@ -272,6 +419,11 @@ "@babel/types": "^7.8.3" } }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" + }, "@babel/helper-wrap-function": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", @@ -323,6 +475,22 @@ "@babel/plugin-syntax-async-generators": "^7.8.0" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz", + "integrity": "sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==", + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==" + } + } + }, "@babel/plugin-proposal-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", @@ -944,6 +1112,11 @@ "integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==", "dev": true }, + "@degjs/fetch-utils": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@degjs/fetch-utils/-/fetch-utils-3.0.2.tgz", + "integrity": "sha512-1K2AyHknsp08wGR/TLTmhkBSPeEx3gTaAbioo66uKufL35XfbxqgENSjBZYgB1mK0Leac+WTqXQtKy8Vuyjm0A==" + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -1223,7 +1396,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -1860,7 +2032,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1966,7 +2137,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -1974,8 +2144,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { "version": "2.20.3", @@ -2269,7 +2438,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, "requires": { "ms": "^2.1.1" } @@ -2606,8 +2774,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint-scope": { "version": "4.0.3", @@ -3790,8 +3957,7 @@ "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "globby": { "version": "6.1.0", @@ -3838,8 +4004,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { "version": "1.0.1", @@ -4430,8 +4595,7 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" }, "json-parse-better-errors": { "version": "1.0.2", @@ -4836,8 +5000,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multicast-dns": { "version": "6.2.3", @@ -6696,8 +6859,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, "source-map-resolve": { "version": "0.5.3", @@ -6931,7 +7093,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -7031,8 +7192,7 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, "to-object-path": { "version": "0.3.0", diff --git a/package.json b/package.json index 94c4723..c570907 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "start": "webpack-dev-server --open --config webpack.config.js" }, "dependencies": { + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@degjs/fetch-utils": "^3.0.2", "react": "^16.12.0", "react-dom": "^16.12.0" }, diff --git a/src/api/doctors.json b/src/api/doctors.json index 1e8fa05..288d81d 100644 --- a/src/api/doctors.json +++ b/src/api/doctors.json @@ -1,14 +1,15 @@ { "results":[ { - "fullName":"Nick Andrew Mandela", - "lastName":"Mandela", + "fullName":"Dr. Brian Graves", + "lastName":"Graves", "specialties":[ - "Vein Care Again", - "Neurology" + "Vein Care", + "Neurology", + "Heart" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", + "image":"../../images/brian-graves.jpg", "gender":"Male", "bio": "", "locations":[ @@ -54,7 +55,7 @@ "fullName":"Dr. Ryan Heap", "lastName":"Heap", "specialties":[ - "Vein Care Again", + "Vein Care", "Neurology" ], "url":"#", @@ -101,14 +102,15 @@ ] }, { - "fullName":"Dr. Jan Smith", - "lastName":"Smith", + "fullName":"Dr. Joseph Lawhorn", + "lastName":"Lawhorn", "specialties":[ - + "Heart", + "Vein Care" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", - "gender": "Female", + "image":"../../images/joseph-lawhorn.jpg", + "gender": "Male", "bio": "", "locations":[ { @@ -118,7 +120,7 @@ "cityStateZip":null, "lat":0, "lng":0, - "distance":32.1210731921023, + "distance":28.1210731921023, "phone":null, "image":null, "availability":null @@ -126,17 +128,18 @@ ] }, { - "fullName":"John A Doe", - "lastName":"Doe", + "fullName":"Dr. Aaron Ladage", + "lastName":"Ladage", "specialties":[ - + "Vein Care", + "Heart" ], "languages":[ "English" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", - "gender": "Female", + "image":"../../images/aaron-ladage.jpg", + "gender": "Male", "bio": "", "locations":[ { @@ -154,13 +157,14 @@ ] }, { - "fullName":"John D Test", - "lastName":"Test", + "fullName":"Dr. Anna Scheuler", + "lastName":"Scheuler", "specialties":[ - + "Neurology", + "Vein Care" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", + "image":"../../images/anna-scheuler.jpg", "gender":"Female", "bio": "", "locations":[ @@ -179,15 +183,93 @@ ] }, { - "fullName":"Alison T Test", - "lastName":"Test", + "fullName":"Dr. Fredy Alvarado, Jr.", + "lastName":"Alvarado, Jr", "specialties":[ - "Vein Care Again", - "Neurology" + "Neurology", + "Vein Care", + "Heart" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", - "gender":"Female", + "image":"../../images/fredy-alvarado.jpg", + "gender":"Male", + "bio": "", + "locations":[ + { + "name":"Olathe", + "url":"https://www.google.com", + "streetAddress":null, + "cityStateZip":null, + "lat":0, + "lng":0, + "distance":22.1210731921023, + "phone":null, + "image": "../../images/doctor-place-holder.jpg", + "availability":null + }, + { + "name":"Lenexa", + "url":"https://www.google.com", + "streetAddress":null, + "cityStateZip":null, + "lat":0, + "lng":0, + "distance":16.92244050719052, + "phone":null, + "image":null, + "availability":null + } + ] + }, + { + "fullName":"Dr. Khalid Saleem", + "lastName":"Saleem", + "specialties":[ + "Neurology", + "Heart" + ], + "url":"#", + "image":"../../images/khalid-saleem.jpg", + "gender":"Male", + "bio": "", + "locations":[ + { + "name":"Olathe", + "url":"https://www.google.com", + "streetAddress":null, + "cityStateZip":null, + "lat":0, + "lng":0, + "distance":1.1210731921023, + "phone":null, + "image": "../../images/doctor-place-holder.jpg", + "availability":null + }, + { + "name":"Lenexa", + "url":"https://www.google.com", + "streetAddress":null, + "cityStateZip":null, + "lat":0, + "lng":0, + "distance":3.92244050719052, + "phone":null, + "image":null, + "availability":null + } + ] + }, + { + "fullName":"Dr. Vequan Clark", + "lastName":"Clark", + "specialties":[ + "Neurology", + "Heart", + "Vein Care" + ], + "url":"#", + "image":"../../images/vequan-clark.jpg", + "gender":"Male", "bio": "", "locations":[ { @@ -199,17 +281,55 @@ "lng":0, "distance":1.1210731921023, "phone":null, + "image": "../../images/doctor-place-holder.jpg", + "availability":null + }, + { + "name":"Lenexa", + "url":"https://www.google.com", + "streetAddress":null, + "cityStateZip":null, + "lat":0, + "lng":0, + "distance":2.52244050719052, + "phone":null, "image":null, "availability":null + } + ] + }, + { + "fullName":"Alejandro Cerro", + "lastName":"Cerro", + "specialties":[ + "Neurology", + "Heart" + ], + "url":"#", + "image":"../../images/alejandro-cerro.jpg", + "gender":"Male", + "bio": "", + "locations":[ + { + "name":"Olathe", + "url":"https://www.google.com", + "streetAddress":null, + "cityStateZip":null, + "lat":0, + "lng":0, + "distance":18.1210731921023, + "phone":null, + "image": "../../images/doctor-place-holder.jpg", + "availability":null }, { - "name":"Vein Care Center", + "name":"Lenexa", "url":"https://www.google.com", "streetAddress":null, "cityStateZip":null, "lat":0, "lng":0, - "distance":12.59373900731615, + "distance":12.92244050719052, "phone":null, "image":null, "availability":null @@ -217,14 +337,15 @@ ] }, { - "fullName":"Test A Test", - "lastName":"Test", + "fullName":"Cody Frazer", + "lastName":"Frazer", "specialties":[ - "Neurology" + "Neurology", + "Heart" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", - "gender":"Female", + "image":"../../images/cody-frazer.jpg", + "gender":"Male", "bio": "", "locations":[ { @@ -234,7 +355,7 @@ "cityStateZip":null, "lat":0, "lng":0, - "distance":22.1210731921023, + "distance":25.1210731921023, "phone":null, "image": "../../images/doctor-place-holder.jpg", "availability":null @@ -246,7 +367,7 @@ "cityStateZip":null, "lat":0, "lng":0, - "distance":16.92244050719052, + "distance":18.92244050719052, "phone":null, "image":null, "availability":null @@ -254,14 +375,16 @@ ] }, { - "fullName":"Dr. James Bolton", - "lastName":"Test", + "fullName":"Dr. Henrique Eidt", + "lastName":"Eidt", "specialties":[ - "Neurology" + "Neurology", + "Heart", + "Vein Care" ], "url":"#", - "image":"../../images/doctor-place-holder.jpg", - "gender":"Female", + "image":"../../images/henrique-eidt.jpg", + "gender":"Male", "bio": "", "locations":[ { @@ -271,7 +394,7 @@ "cityStateZip":null, "lat":0, "lng":0, - "distance":1.1210731921023, + "distance":4.1210731921023, "phone":null, "image": "../../images/doctor-place-holder.jpg", "availability":null @@ -283,7 +406,7 @@ "cityStateZip":null, "lat":0, "lng":0, - "distance":3.92244050719052, + "distance":5.92244050719052, "phone":null, "image":null, "availability":null diff --git a/src/components/app.js b/src/components/app.js index ea14d56..1633458 100644 --- a/src/components/app.js +++ b/src/components/app.js @@ -1,46 +1,89 @@ -import React from 'react'; +import React, {useEffect, useState} from 'react'; import Search from './search/search.js'; import Gender from './gender/gender.js'; import Distance from './distance/distance.js'; import DoctorInfoList from './results/doctorInfoList.js'; import TotalResults from './results/totalResults.js'; -import data from '../api/doctors.json' - -class App extends React.Component { - constructor() { - super(); - this.state = { - results: [] - }; + + +const App = () => { + + const [finalResults, setFinalResults] = useState({ + results: [], + filteredResults: [], + zipCode: '', + genders: 'nopreference', + distance: 'all' + }); + + useEffect(() => { + onFilterChange(); + }, [finalResults.genders, finalResults.distance, finalResults.results]); + + + const handleSearch = (searchResults) => { + setFinalResults({...finalResults, ...searchResults}); } - componentDidMount() { - this.setState({ - results: data.results - }); + const handleGender = (val) => { + setFinalResults({...finalResults, genders: val}); } - - render() { - return ( - <> - -
-
-
-
- - - -
-
- - -
-
-
- - ); + + const handleDistance = (val) => { + setFinalResults({...finalResults, distance: val}); } + + + const onFilterChange = () => { + const distance = finalResults.distance; + const genders = finalResults.genders; + const isDistanceAll = finalResults.distance === 'all'; + const isGendersNoPreference = genders === 'nopreference'; + + + function filterByDistance(item) { + return isDistanceAll || item.distance <= parseInt(distance); + } + + function filterbyGender(item) { + return isGendersNoPreference || item.gender.toLowerCase() === genders; + } + + const filteredArray = finalResults.results + .filter(filterbyGender) + .filter(item => item.locations.some(filterByDistance)) + .map(item => ({ + ...item, + locations: item.locations.filter(filterByDistance) + })); + setFinalResults({...finalResults, filteredResults: filteredArray}) + } + + return ( + <> + +
+ { finalResults.filteredResults.length ? : '' } +
+ + ); } + +const ResultsContainer = ({handleDistance, handleGender, finalResults}) => { + return ( +
+
+ + +
+ +
+ + +
+
+ ); + } + export default App; diff --git a/src/components/distance/distance.js b/src/components/distance/distance.js index 88ed84a..58231b6 100644 --- a/src/components/distance/distance.js +++ b/src/components/distance/distance.js @@ -1,10 +1,15 @@ import React from 'react'; -const Distance = () => { +const Distance = (props) => { + + const handleOnChange = (e) => { + props.getDistance(e.target.value); + } + return (
- + handleOnChange(e)} type="range" defaultValue="30" min="5" max="30" step="5" />
  1. 5
  2. 10
  3. @@ -13,10 +18,11 @@ const Distance = () => {
  4. 25
  5. All
-
Current: All miles from 66204
+
Current: All miles from {props.zipCode}
); -}; + +} export default Distance; diff --git a/src/components/gender/gender.js b/src/components/gender/gender.js index b490531..39b567f 100644 --- a/src/components/gender/gender.js +++ b/src/components/gender/gender.js @@ -1,28 +1,35 @@ import React from 'react'; -const Gender = () => { +const Gender = (props) => { + + const handleOnChange = (e) => { + props.getGender(e.target.value); + } return (
-
- Gender -
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
-
+
+
handleOnChange(e)}> + Gender +
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
+
+
- ); -}; + ) +} + export default Gender; diff --git a/src/components/search/search.js b/src/components/search/search.js index 68d4aa0..544e90e 100644 --- a/src/components/search/search.js +++ b/src/components/search/search.js @@ -1,17 +1,53 @@ -import React from 'react'; +import React, {useEffect, useState} from 'react'; +import fetchUtils from '@degjs/fetch-utils'; + +const Search = (props) => { + + const [searchResults, setSearchResults] = useState({ + zipCode: '', + results: [] + }); + + useEffect(() => { + props.getSearchResults(searchResults); + }, [searchResults]); + + const handleOnChange = (e) => { + setSearchResults({...searchResults, zipCode: e.target.value}); + } + + const handleOnSubmit = (e) => { + e.preventDefault(); + + const url = 'http://localhost:8080/api/doctors'; + fetchUtils.getJSON( + url, + { + method: 'POST', + body: JSON.stringify(searchResults.zipCode), + headers: { + 'Content-Type': 'application/json' + } + }) + .then(data => { + setSearchResults({...searchResults, results: data.results}); + }) + .catch(error => { + console.log(error); + }); + } -const Search = () => { return ( -
-
-
+
+ handleOnSubmit(e)}> +
- + handleOnChange(e)} required type="search" placeholder="Search Zip Code" pattern="[0-9]{5}" maxLength="5" />
- +
diff --git a/src/images/aaron-ladage.jpg b/src/images/aaron-ladage.jpg new file mode 100644 index 0000000..1fcf72c Binary files /dev/null and b/src/images/aaron-ladage.jpg differ diff --git a/src/images/alejandro-cerro.jpg b/src/images/alejandro-cerro.jpg new file mode 100644 index 0000000..ff6034b Binary files /dev/null and b/src/images/alejandro-cerro.jpg differ diff --git a/src/images/anna-scheuler.jpg b/src/images/anna-scheuler.jpg new file mode 100644 index 0000000..627ffeb Binary files /dev/null and b/src/images/anna-scheuler.jpg differ diff --git a/src/images/brian-graves.jpg b/src/images/brian-graves.jpg new file mode 100644 index 0000000..3497e9a Binary files /dev/null and b/src/images/brian-graves.jpg differ diff --git a/src/images/cody-frazer.jpg b/src/images/cody-frazer.jpg new file mode 100644 index 0000000..f4381d2 Binary files /dev/null and b/src/images/cody-frazer.jpg differ diff --git a/src/images/fredy-alvarado.jpg b/src/images/fredy-alvarado.jpg new file mode 100644 index 0000000..6425e35 Binary files /dev/null and b/src/images/fredy-alvarado.jpg differ diff --git a/src/images/henrique-eidt.jpg b/src/images/henrique-eidt.jpg new file mode 100644 index 0000000..6426f87 Binary files /dev/null and b/src/images/henrique-eidt.jpg differ diff --git a/src/images/joseph-lawhorn.jpg b/src/images/joseph-lawhorn.jpg new file mode 100644 index 0000000..78d59ee Binary files /dev/null and b/src/images/joseph-lawhorn.jpg differ diff --git a/src/images/khalid-saleem.jpg b/src/images/khalid-saleem.jpg new file mode 100644 index 0000000..17d816c Binary files /dev/null and b/src/images/khalid-saleem.jpg differ diff --git a/src/images/ryan-heap.jpg b/src/images/ryan-heap.jpg new file mode 100644 index 0000000..75f0b40 Binary files /dev/null and b/src/images/ryan-heap.jpg differ diff --git a/src/images/vequan-clark.jpg b/src/images/vequan-clark.jpg new file mode 100644 index 0000000..25f209d Binary files /dev/null and b/src/images/vequan-clark.jpg differ diff --git a/webpack.config.js b/webpack.config.js index f69c1e0..9242f8b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,7 +13,7 @@ module.exports = { contentBase: './dist', historyApiFallback: true, before: (app) => { - app.get('/api/doctors', (req, res) => { + app.post('/api/doctors', (req, res) => { res.json(doctorsData); }); }