From fd695627e755d99c81ecbce8fd649f8afb2c5c0c Mon Sep 17 00:00:00 2001 From: kurpfish Date: Mon, 16 Aug 2021 14:38:12 +0300 Subject: [PATCH 1/2] copyright --- src/components/Auth/AuthForDevelopers.js | 3 +++ src/components/Auth/AuthForPartners.js | 3 +++ src/components/Form/Form.js | 2 +- src/components/Form/Form.module.css | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/Auth/AuthForDevelopers.js b/src/components/Auth/AuthForDevelopers.js index a1ee30ae..7aab3cbf 100644 --- a/src/components/Auth/AuthForDevelopers.js +++ b/src/components/Auth/AuthForDevelopers.js @@ -164,6 +164,9 @@ const AuthForDevelopers = () => { Подберем и документально оформим IT-специалистов, после чего передадим исполнителей под ваше руководство. Вы получаете полное управление над сотрудниками, имея возможность контролировать и заменять IT штат.{' '} +

+

+ 2021 © Outstaffing
diff --git a/src/components/Auth/AuthForPartners.js b/src/components/Auth/AuthForPartners.js index b06a6dff..8aefa55d 100644 --- a/src/components/Auth/AuthForPartners.js +++ b/src/components/Auth/AuthForPartners.js @@ -155,6 +155,9 @@ const AuthForPartners = () => { Подберем и документально оформим IT-специалистов, после чего передадим исполнителей под ваше руководство. Вы получаете полное управление над сотрудниками, имея возможность контролировать и заменять IT штат.{' '} +

+

+ 2021 © Outstaffing
diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js index 10765bc0..5da45005 100644 --- a/src/components/Form/Form.js +++ b/src/components/Form/Form.js @@ -64,7 +64,7 @@ const Form = () => { Date: Mon, 16 Aug 2021 16:19:50 +0300 Subject: [PATCH 2/2] profile form --- package-lock.json | 23 ++++++++++++++++ package.json | 1 + src/App.js | 4 +-- src/components/Candidate/Candidate.js | 2 +- src/components/Form/Form.js | 38 ++++++++++++++++++++++++--- src/components/Form/Form.module.css | 1 + src/components/Form/form.css | 15 +++++++++++ src/components/Sidebar/Sidebar.js | 2 +- src/server/server.js | 4 +-- 9 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 src/components/Form/form.css diff --git a/package-lock.json b/package-lock.json index 6d0fd187..7ce002c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9951,6 +9951,16 @@ "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" }, + "lodash.reduce": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", + "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" + }, + "lodash.startswith": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.startswith/-/lodash.startswith-4.2.1.tgz", + "integrity": "sha1-xZjErc4YiiflMUVzHNxsDnF3YAw=" + }, "lodash.template": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", @@ -12768,6 +12778,19 @@ "warning": "^4.0.3" } }, + "react-phone-input-2": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/react-phone-input-2/-/react-phone-input-2-2.14.0.tgz", + "integrity": "sha512-gOY3jUpwO7ulryXPEdqzH7L6DPqI9RQxKfBxZbgqAwXyALGsmwLWFyi2RQwXlBLWN/EPPT4Nv6I9TESVY2YBcg==", + "requires": { + "classnames": "^2.2.6", + "lodash.debounce": "^4.0.8", + "lodash.memoize": "^4.1.2", + "lodash.reduce": "^4.6.0", + "lodash.startswith": "^4.2.1", + "prop-types": "^15.7.2" + } + }, "react-redux": { "version": "7.2.4", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.4.tgz", diff --git a/package.json b/package.json index 6a25ba47..9c433c18 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "react-bootstrap": "^1.6.0", "react-dom": "^17.0.2", "react-loader-spinner": "^4.0.0", + "react-phone-input-2": "^2.14.0", "react-redux": "^7.2.4", "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", diff --git a/src/App.js b/src/App.js index fe3ecdf6..6700b0c0 100644 --- a/src/App.js +++ b/src/App.js @@ -24,9 +24,9 @@ const App = () => { - + - +
Page not found
} /> diff --git a/src/components/Candidate/Candidate.js b/src/components/Candidate/Candidate.js index 6915ad5e..f98b823b 100644 --- a/src/components/Candidate/Candidate.js +++ b/src/components/Candidate/Candidate.js @@ -115,7 +115,7 @@ const Candidate = () => { {currentCandidateObj.vc_text ? currentCandidateObj.vc_text : 'Описание отсутствует...' }

)} - + diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js index 5da45005..d492fa30 100644 --- a/src/components/Form/Form.js +++ b/src/components/Form/Form.js @@ -2,9 +2,19 @@ import React, { useState } from 'react'; import style from './Form.module.css'; import { fetchForm } from '../../server/server'; import arrow from '../../images/right-arrow.png'; -import { useHistory } from 'react-router-dom'; +import { useHistory, useParams, Redirect } from 'react-router-dom'; +import PhoneInput from 'react-phone-input-2' +import 'react-phone-input-2/lib/style.css' +import './form.css'; + +import { withSwalInstance } from 'sweetalert2-react'; +import swal from 'sweetalert2'; + +const SweetAlert = withSwalInstance(swal); const Form = () => { + const urlParams = useParams(); + const [status, setStatus] = useState(null); const [data, setData] = useState({ email: '', phone: '', @@ -26,19 +36,32 @@ const Form = () => { e.preventDefault(); const formData = new FormData(); + formData.append('profile_id', urlParams.id); formData.append('email', data.email); formData.append('phone', data.phone); formData.append('comment', data.comment); - fetchForm(`${process.env.REACT_APP_API_URL}/api/profile/add-to-interview`, formData); + fetchForm(`${process.env.REACT_APP_API_URL}/api/profile/add-to-interview`, { + profile_id: urlParams.id, + ...data, + }).then( (res)=> res.json() + .then( resJSON => setStatus(resJSON)) + ) }; const goBack = () => { history.goBack(); }; + console.log('s',status) + return (
+ {status && {setStatus(null);} : () => {setStatus(null); history.push(`/candidate/${urlParams.id}`)}} + />}
goBack()}> @@ -61,14 +84,21 @@ const Form = () => { /> - handleChange({target: {value:e, id: 'phone' }})} + /> + {/* + /> */}