From 177427b5821a67e141236e6aeb4db12d76b050a0 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Wed, 7 Jul 2021 15:34:04 +0530 Subject: styled and added basic functionality to TransportForm --- src/components/Form/Form.scss | 24 +++++++++- src/components/Form/Transport/TransportForm.tsx | 64 +++++++++++++------------ 2 files changed, 56 insertions(+), 32 deletions(-) (limited to 'src/components/Form') diff --git a/src/components/Form/Form.scss b/src/components/Form/Form.scss index 06d15ea..7642f75 100644 --- a/src/components/Form/Form.scss +++ b/src/components/Form/Form.scss @@ -160,14 +160,34 @@ input { } .TransportForm { - padding: 2rem; + padding: 1rem; + font-size: $fontSize1 + 0.25; +} + +.TransportForm label { + display: flex; + flex-direction: row; + justify-content: space-between; + min-width: 90%; +} + +.TransportForm .inputs { + height: 80%; display: flex; flex-direction: column; - justify-content: center /*space-between*/; + justify-content: space-around; align-items: center; } +.TransportForm .menu { + position: absolute; + + right: 1rem; + bottom: 1rem; + //border: 1px solid gray; +} + /*.ClientInfoDisplay { font-size: $fontSize1; }*/ diff --git a/src/components/Form/Transport/TransportForm.tsx b/src/components/Form/Transport/TransportForm.tsx index 0611cc1..60dfee3 100644 --- a/src/components/Form/Transport/TransportForm.tsx +++ b/src/components/Form/Transport/TransportForm.tsx @@ -6,11 +6,12 @@ * Copyright (c) 2021 Vidhu Kant Sharma */ -import React, { useState } from "react"; +import React, { useState, Dispatch, SetStateAction } from "react"; import { Transport } from "./../../../interfaces" interface Props { - setVisibility: any // this component's visibility + setVisibility: Dispatch> // this component's visibility + setTransporter: Dispatch> } const TransportForm: React.FC = (props) => { @@ -23,7 +24,6 @@ const TransportForm: React.FC = (props) => { const hideSelf = () => props.setVisibility(false); - const closeOnBGClicked = (event: any) => event.target.className === "floatingMenuBG" && hideSelf(); @@ -37,7 +37,7 @@ const TransportForm: React.FC = (props) => { GSTIN: transporterGSTIN, Builty: builtyNumber } - console.log(newTransport); + props.setTransporter(newTransport); hideSelf(); } @@ -45,37 +45,41 @@ const TransportForm: React.FC = (props) => { return (
- +
+ - + - + - + - + +
- +
+ +
); -- cgit v1.2.3