mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-23 03:36:52 +00:00
Creates Navbar component
This commit is contained in:
parent
b3165438f7
commit
4be5f49f38
@ -6,7 +6,8 @@
|
|||||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<title>We Want Doughnuts</title>
|
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
||||||
|
<title>Traffic Police</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
BIN
React/src/images/logo.png
Normal file
BIN
React/src/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
11
React/src/pages/components/Navbar.jsx
Normal file
11
React/src/pages/components/Navbar.jsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import logo from '../../images/logo.png'
|
||||||
|
|
||||||
|
const Navbar = ()=>(
|
||||||
|
<div className="w-100 bg-blue-400 flex justify-center items-center" style={{height: "90px"}}>
|
||||||
|
<div className="flex items-center w-4/5">
|
||||||
|
<img src={logo} alt="logo" className="h-28"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
export default Navbar
|
||||||
9
React/src/pages/components/VehicleRegisterForm.jsx
Normal file
9
React/src/pages/components/VehicleRegisterForm.jsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
const VehicleRegisterForm = ()=> (
|
||||||
|
<form className="w-64 flex flex-col justify-center shadow">
|
||||||
|
<h3>Register A Vehicle</h3>
|
||||||
|
</form>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default VehicleRegisterForm
|
||||||
@ -2,6 +2,8 @@ import React from 'react'
|
|||||||
import { signinRedirect } from '../services/userService'
|
import { signinRedirect } from '../services/userService'
|
||||||
import { Redirect } from 'react-router-dom'
|
import { Redirect } from 'react-router-dom'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
|
import Navbar from './components/Navbar'
|
||||||
|
import VehicleRegisterForm from './components/VehicleRegisterForm'
|
||||||
|
|
||||||
function Login() {
|
function Login() {
|
||||||
const user = useSelector(state => state.auth.user)
|
const user = useSelector(state => state.auth.user)
|
||||||
@ -16,15 +18,9 @@ function Login() {
|
|||||||
:
|
:
|
||||||
(
|
(
|
||||||
<div>
|
<div>
|
||||||
<h1>Hello!</h1>
|
<Navbar />
|
||||||
<p>Welcome to We Want Doughnuts.</p>
|
<VehicleRegisterForm />
|
||||||
<p>A demo of using React and Identity Server 4 to authenticate a user via OpenID Connect to gain access to a web API (and some lovely doughnuts).</p>
|
</div>
|
||||||
<p>Start by signing in.</p>
|
|
||||||
<p>💡 <strong>Tip: </strong><em>User: 'spiderman', Pass: 'spiderman'</em></p>
|
|
||||||
|
|
||||||
<button onClick={() => login()}>Login</button>
|
|
||||||
<p><a target='_blank' rel='noopener noreferrer' href='https://github.com/tappyy/react-IS4-auth-demo'>Github Repo</a></p>
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user