From 6a69e3be38edd2339cdf706b75a2c8063e7f9b3b Mon Sep 17 00:00:00 2001 From: syamkumar Date: Tue, 24 Mar 2020 10:29:55 +0530 Subject: [PATCH 1/2] router link to logo --- src/Components/Common/Header.tsx | 2 +- src/Components/Common/TopBar.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/Common/Header.tsx b/src/Components/Common/Header.tsx index e40c338b888..d95bc43baa5 100644 --- a/src/Components/Common/Header.tsx +++ b/src/Components/Common/Header.tsx @@ -126,7 +126,7 @@ const Header = () => { - care logo + care logo
diff --git a/src/Components/Common/TopBar.tsx b/src/Components/Common/TopBar.tsx index a04f66c8e4a..7e9849f434a 100644 --- a/src/Components/Common/TopBar.tsx +++ b/src/Components/Common/TopBar.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { AppBar, Toolbar, Typography, } from '@material-ui/core'; +import {A} from "hookrouter"; const img = 'https://care-staging-coronasafe.s3.amazonaws.com/static/images/logos/black-logo.svg'; const TopBar = () => { @@ -7,7 +8,7 @@ const TopBar = () => { - care logo + care logo From d58fbf2d53cc143bd0becf669e2205735f246590 Mon Sep 17 00:00:00 2001 From: Puvikaran Date: Tue, 24 Mar 2020 11:52:24 +0530 Subject: [PATCH 2/2] form fix --- .../Ambulance/AmbulanceOnboarding.tsx | 1 - .../Ambulance/DriverDetailsForm.tsx | 19 +++++++++++++------ .../Ambulance/VehicleDetailsForm.tsx | 11 +++++++---- src/Components/Common/HelperInputFields.tsx | 3 ++- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/Components/Ambulance/AmbulanceOnboarding.tsx b/src/Components/Ambulance/AmbulanceOnboarding.tsx index 3df2b4a3c0a..1a5a980f49f 100644 --- a/src/Components/Ambulance/AmbulanceOnboarding.tsx +++ b/src/Components/Ambulance/AmbulanceOnboarding.tsx @@ -86,7 +86,6 @@ export default function AmbulanceOnboarding() { setVehicleObj(val); setValue(1); }; - console.log('vehicleObj: ', vehicleObj); return ( diff --git a/src/Components/Ambulance/DriverDetailsForm.tsx b/src/Components/Ambulance/DriverDetailsForm.tsx index 92d23218646..9a0e052c733 100644 --- a/src/Components/Ambulance/DriverDetailsForm.tsx +++ b/src/Components/Ambulance/DriverDetailsForm.tsx @@ -4,6 +4,7 @@ import { TextInputField } from '../Common/HelperInputFields'; import { useDispatch } from "react-redux"; import { postAmbulance } from "../../Redux/actions"; import { isEmpty, get } from "lodash"; +import { navigate } from 'hookrouter'; export const DriverDetailsForm = (props:any) => { @@ -43,7 +44,7 @@ export const DriverDetailsForm = (props:any) => { }; const validateData = () => { - const err = Object.assign({}); + const err:any = {}; Object.keys(form).forEach((key) => { const value = form[key]; switch (key) { @@ -76,6 +77,7 @@ export const DriverDetailsForm = (props:any) => { }); if (!isEmpty(err)) { setErrors(err); + return false; } return form; }; @@ -122,8 +124,9 @@ export const DriverDetailsForm = (props:any) => { const statusCode = get(resp, 'status', ''); if (res && statusCode === 401) { alert('Something went wrong..!'); - } else if (res && statusCode === 200) { + } else if (res && statusCode === 201) { alert('Ambulance Added Successfully'); + navigate("/") } }) } @@ -140,7 +143,8 @@ export const DriverDetailsForm = (props:any) => {

Driver 1

{ {

Driver 2

{ { }; const validateData = () => { - const err = Object.assign({}, errors); + const err:any = {}; Object.keys(form).forEach(key => { const value = form[key]; switch (key) { @@ -126,8 +126,9 @@ export const VehicleDetailsForm = (props: any) => { { />
{ errors={errors.nameOfOwner} /> { - const { placeholder, onChange, value, name, variant, type, margin, errors } = props; + const { placeholder, onChange, value, name, variant, type, margin, errors, label } = props; return (