mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-23 01:46:39 +00:00
Adds a Main component
This commit is contained in:
parent
f81728fbce
commit
ab8da062af
11
React/src/pages/components/Main.js
Normal file
11
React/src/pages/components/Main.js
Normal file
@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
const Main = ({ Component }) => {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-3/4">
|
||||
<Component />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Main;
|
||||
@ -1,28 +1,26 @@
|
||||
import React from 'react'
|
||||
import { signinRedirect } from '../services/userService'
|
||||
import { Redirect } from 'react-router-dom'
|
||||
import { useSelector } from 'react-redux'
|
||||
import Navbar from './components/Navbar'
|
||||
import VehicleRegisterForm from './components/VehicleRegisterForm'
|
||||
import React from 'react';
|
||||
import { signinRedirect } from '../services/userService';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { useSelector } from 'react-redux';
|
||||
import Navbar from './components/Navbar';
|
||||
import Main from './components/Main';
|
||||
import VehicleRegisterForm from './components/VehicleRegisterForm';
|
||||
|
||||
function Login() {
|
||||
const user = useSelector(state => state.auth.user)
|
||||
const user = useSelector((state) => state.auth.user);
|
||||
|
||||
function login() {
|
||||
signinRedirect()
|
||||
signinRedirect();
|
||||
}
|
||||
|
||||
return (
|
||||
(user) ?
|
||||
(<Redirect to={'/'} />)
|
||||
:
|
||||
(
|
||||
<div>
|
||||
return user ? (
|
||||
<Redirect to={'/'} />
|
||||
) : (
|
||||
<div className="h-screen">
|
||||
<Navbar />
|
||||
<VehicleRegisterForm />
|
||||
<Main Component={VehicleRegisterForm} />
|
||||
</div>
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default Login
|
||||
export default Login;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user