From 395b4449f8a6fbf037aa471defb3d7525138e2e6 Mon Sep 17 00:00:00 2001 From: Karthik Date: Fri, 11 Nov 2022 19:29:38 +0530 Subject: [PATCH] router update signupform add --- package.json | 4 +- src/App.css | 62 ++++++++++++++++++++++++++++++- src/App.js | 33 ++++++++--------- src/components/Navbar.js | 2 +- src/components/pages/SignUp.js | 68 ++++++++++++++++++++++++++++++++-- src/index.js | 15 ++++++-- 6 files changed, 156 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 279c2e93ac..0ce2d6ea0a 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "@testing-library/user-event": "^7.1.2", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-router-dom": "^5.2.0", - "react-scripts": "3.4.1" + "react-router-dom": "^6.4.3", + "react-scripts": "^3.4.1" }, "scripts": { "start": "react-scripts start", diff --git a/src/App.css b/src/App.css index 379ff2d417..2f03dcaf06 100644 --- a/src/App.css +++ b/src/App.css @@ -34,11 +34,71 @@ font-size: 100px; } -.sign-up { +.sign-up-card { background-image: url('/images/img-8.jpg'); background-position: center; background-size: cover; background-repeat: no-repeat; color: #fff; + height: 90vh; +padding: 2rem; font-size: 100px; } + +.sign-up-form { + border-radius: 7px; + border: 1px solid grey; + max-width: 600px; + width: 30%; + margin: 0 auto; + background-color: white; + padding: 20px; + box-shadow: 0 2px 4px 4px rgba(0,0,0,0.09); + /* margin-top: 2rem; */ +} + +.sign-up-form h2 { + font-size: 30px; + color:black; + font-weight: 500; + margin-bottom: 30px; + text-align: center; +} + +.each-input { + display: flex; + flex-direction: column; + gap: 8px; + margin-bottom: 20px; + font-weight: 100; +} + +.each-input label { + font-size: 18px; + color: black; +} + +.each-input input { + font-size: 20px; + padding: 10px; + border-radius: 6px; + border: 1px solid grey; + +} + +.submit-button button{ + background-color:black; + color: white; + border-radius: 40rem; + width: 60%; + margin: 0 auto; + font-size: 25px; + padding: 8px; + text-align: center; + cursor: pointer; +} + +.submit-button { + text-align: center; + margin: 0 auto; +} \ No newline at end of file diff --git a/src/App.js b/src/App.js index ee4ec23bdf..27493626be 100644 --- a/src/App.js +++ b/src/App.js @@ -1,24 +1,23 @@ -import React from 'react'; -import Navbar from './components/Navbar'; -import './App.css'; -import Home from './components/pages/Home'; -import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; -import Services from './components/pages/Services'; -import Products from './components/pages/Products'; -import SignUp from './components/pages/SignUp'; +import React from "react"; +import Navbar from "./components/Navbar"; +import "./App.css"; +import Services from "./components/pages/Services"; +import Products from "./components/pages/Products"; +import SignUp from "./components/pages/SignUp"; +import { Routes, Route } from "react-router-dom"; +import Home from "./components/pages/Home"; function App() { return ( <> - - - - - - - - - + + + } /> + } /> + } /> + } /> + Not Found} /> + ); } diff --git a/src/components/Navbar.js b/src/components/Navbar.js index eff37ca3e1..35790df5d4 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -30,7 +30,7 @@ function Navbar() {
TRVL - +
diff --git a/src/components/pages/SignUp.js b/src/components/pages/SignUp.js index c170b80ecc..1b97208f74 100644 --- a/src/components/pages/SignUp.js +++ b/src/components/pages/SignUp.js @@ -1,6 +1,68 @@ -import React from 'react'; -import '../../App.css'; +import React, { useState } from "react"; +import "../../App.css"; +import { Button } from "../Button"; export default function SignUp() { - return

LIKE & SUBSCRIBE

; + const [name, setName] = useState(""); + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + + const [details, setDetails] = useState(true); + + const submitHandler = (e) => { + e.preventDefault(); + if (name && email && password) { + setDetails(true); + const details = { + name, + email, + password, + }; + + console.log(details); + } else { + setDetails(false); + } + }; + + return ( +
+
+

Sign Up form

+
+ + setName(e.target.value)} + type="text" + /> +
+
+ + setEmail(e.target.value)} + type="text" + /> +
+
+ + setPassword(e.target.value)} + type="text" + /> +
+ {!details && ( +

+ fill proper details +

+ )} + +
+ +
+
+
+ ); } diff --git a/src/index.js b/src/index.js index b597a44232..3d0a6c4469 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,12 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App"; +import { BrowserRouter } from "react-router-dom"; -ReactDOM.render(, document.getElementById('root')); +ReactDOM.render( + + + , + + document.getElementById("root") +);