diff --git a/client/src/components/layout/Spinner.js b/client/src/components/layout/Spinner.js index 2adddb5..9c57868 100644 --- a/client/src/components/layout/Spinner.js +++ b/client/src/components/layout/Spinner.js @@ -1,6 +1,6 @@ import spinner from './spinner.gif'; -export default () => ( +const Spinner = () => ( <> ( /> ); + +export default Spinner; diff --git a/client/src/components/profile-form/AddEducation.js b/client/src/components/profile-form/AddEducation.js index 3b77bac..c2e3570 100644 --- a/client/src/components/profile-form/AddEducation.js +++ b/client/src/components/profile-form/AddEducation.js @@ -20,13 +20,14 @@ const AddEducation = ({ addEducation }) => { const { school, degree, fieldofstudy, from, to, current, description } = formData; - const handleOnChange = (e) => - setFormData({ ...formData, [e.target.name]: e.target.value }); + const handleOnChange = (e) => { + setFormData({ + ...formData, + [e.target.name]: e.target.value, + }); + }; const handleCheckboxOnChange = (e) => { - console.log(e.target.name); - console.log(e.target.checked); - console.log(e.target.value); setFormData({ ...formData, current: !current }); }; @@ -47,7 +48,7 @@ const AddEducation = ({ addEducation }) => { * = required field
-
+
{ />
-
+
{ />
-
+
{ const { company, title, location, from, to, current, description } = formData; const handleOnChange = (e) => - setFormData({ ...formData, [e.target.name]: e.target.value }); + setFormData({ + ...formData, + [e.target.name]: e.target.value, + }); const handleCheckboxOnChange = (e) => { - console.log(e.target.name); - console.log(e.target.checked); - console.log(e.target.value); setFormData({ ...formData, current: !current }); }; diff --git a/client/src/components/profile-form/ProfileForm.js b/client/src/components/profile-form/ProfileForm.js index 3672685..148a37d 100644 --- a/client/src/components/profile-form/ProfileForm.js +++ b/client/src/components/profile-form/ProfileForm.js @@ -5,6 +5,7 @@ import { connect } from 'react-redux'; import { createProfile, getCurrentProfile } from '../../actions/profile'; +// TODO: Optimize code /* NOTE: declare initialState outside of component so that it doesn't trigger a useEffect