Router for both login and sigup also home page redirect :)
This commit is contained in:
parent
f530d1481e
commit
adad73c48f
@ -3,6 +3,9 @@ import reactLogo from "./assets/react.svg";
|
|||||||
import viteLogo from "/vite.svg";
|
import viteLogo from "/vite.svg";
|
||||||
import SignInUp from "./components/login-logout/signInup";
|
import SignInUp from "./components/login-logout/signInup";
|
||||||
import LandingPage from "./components/landing-page/homePage.jsx";
|
import LandingPage from "./components/landing-page/homePage.jsx";
|
||||||
|
import SignUp from "./components/login-logout/signUp.jsx";
|
||||||
|
import LogIn from "./components/login-logout/logIn.jsx";
|
||||||
|
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
|
|
||||||
// routing
|
// routing
|
||||||
@ -10,7 +13,14 @@ import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|||||||
|
|
||||||
const router = createBrowserRouter([
|
const router = createBrowserRouter([
|
||||||
{ path: "/", element: <LandingPage /> },
|
{ path: "/", element: <LandingPage /> },
|
||||||
{ path: "/open", element: <SignInUp /> },
|
{
|
||||||
|
path: "/",
|
||||||
|
element: <SignInUp />,
|
||||||
|
children: [
|
||||||
|
{ path: "sign-up", element: <SignUp /> },
|
||||||
|
{ path: "log-in", element: <LogIn /> },
|
||||||
|
],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ section {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
margin-bottom: 4rem;
|
margin-bottom: 15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro-page {
|
.intro-page {
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import LogIn from "./logIn";
|
|||||||
import "./form_styling.css";
|
import "./form_styling.css";
|
||||||
import "./logo_and_text.css";
|
import "./logo_and_text.css";
|
||||||
// admin signup
|
// admin signup
|
||||||
|
// outlet is here displays the child routs
|
||||||
|
import { Outlet } from "react-router-dom";
|
||||||
|
|
||||||
export default function SignInUp() {
|
export default function SignInUp() {
|
||||||
// user signup
|
// user signup
|
||||||
@ -15,8 +17,9 @@ export default function SignInUp() {
|
|||||||
</div>
|
</div>
|
||||||
<section>
|
<section>
|
||||||
<div className="LHS">
|
<div className="LHS">
|
||||||
<SignUp />
|
{/* <SignUp />
|
||||||
<LogIn />
|
<LogIn /> */}
|
||||||
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
<div className="RHS">
|
<div className="RHS">
|
||||||
<h1>Description</h1>
|
<h1>Description</h1>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user