From ea74a092e586f567fa13f3e932ca2054ae2c6595 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Thu, 14 Mar 2024 11:44:16 +0100 Subject: [PATCH] made login page responsive --- src/components/Login/Login.tsx | 81 ++++++++++++----------- src/components/shared/FloatLabelInput.tsx | 42 ++++++++++++ src/components/shared/index.ts | 3 +- 3 files changed, 88 insertions(+), 38 deletions(-) create mode 100644 src/components/shared/FloatLabelInput.tsx diff --git a/src/components/Login/Login.tsx b/src/components/Login/Login.tsx index 52381d5..a3a669a 100644 --- a/src/components/Login/Login.tsx +++ b/src/components/Login/Login.tsx @@ -1,66 +1,73 @@ -import { Button, Footer } from '../../components' +import {useState} from 'react' +import { Button, Footer, FloatLabelInput } from '../../components' import { Link } from 'react-router-dom' +type FormType = { + email:string, + password:string +} + +type HandleChange = { + name:string, + value:string + } + export default function Login() { + let [formDetails, setFormDetails] = useState({ + email: '', + password: '' + }) + + const handleFormChange = ({target:{name, value}}:{target:HandleChange}):void => { + setFormDetails(prev => ({...prev, [name]:value})) + } + return (
-
-
+
+

Welcome!

-

Please login to admin dashboard

+

Please login to admin dashboard

{/* INPUTS */} - {/* THIS INPUTS WILL BE MADE A COMPONENT LATER, TO AVOID REPEATINGS THINGS */}
- -
- -
@@ -69,7 +76,7 @@ export default function Login() {
{/* FOOTER SECTION */} -
+
diff --git a/src/components/shared/FloatLabelInput.tsx b/src/components/shared/FloatLabelInput.tsx new file mode 100644 index 0000000..a512bd3 --- /dev/null +++ b/src/components/shared/FloatLabelInput.tsx @@ -0,0 +1,42 @@ + +type Props = { + id?:string, + name?:string, + type?:string, + placeHolder?:string, + labelName?:string, + inputClass?:string, + value:string, + onChange:()=>void +} + +export default function FloatLabelInput({ + id, + name, + type, + placeHolder, + labelName, + value, + inputClass, + onChange +}:Props) { + return ( +
+ + +
+ ) +} diff --git a/src/components/shared/index.ts b/src/components/shared/index.ts index 4f733f4..3b0f127 100644 --- a/src/components/shared/index.ts +++ b/src/components/shared/index.ts @@ -1,3 +1,4 @@ import Button from "./Button"; +import FloatLabelInput from "./FloatLabelInput"; -export {Button} \ No newline at end of file +export {Button, FloatLabelInput} \ No newline at end of file -- 2.34.1