Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-027
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-27
2021-027
Commits
1aa1b9e0
Commit
1aa1b9e0
authored
Oct 24, 2021
by
Rifana F.N.F_IT16141902
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Design UI of Login page
parent
6b4f15a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
vehiclepark/Login.js
vehiclepark/Login.js
+68
-0
No files found.
vehiclepark/Login.js
0 → 100644
View file @
1aa1b9e0
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Link
,
useHistory
}
from
"
react-router-dom
"
;
import
{
auth
,
signInWithEmailAndPassword
,
signInWithGoogle
}
from
"
./firebase
"
;
import
{
useAuthState
}
from
"
react-firebase-hooks/auth
"
;
import
"
./style.css
"
import
logo
from
'
./images/login.jpg
'
;
function
Login
()
{
const
[
email
,
setEmail
]
=
useState
(
""
);
const
[
password
,
setPassword
]
=
useState
(
""
);
const
[
user
,
loading
,
error
]
=
useAuthState
(
auth
);
const
history
=
useHistory
();
useEffect
(()
=>
{
if
(
loading
)
{
// maybe trigger a loading screen
return
;
}
if
(
user
)
history
.
replace
(
"
/Home
"
);
},
[
user
,
loading
]);
return
(
<
div
className
=
"
login
"
>
<
div
className
=
"
login__container
"
>
<
img
src
=
{
logo
}
className
=
'
img-fluid shadow-2-strong
'
alt
=
''
style
=
{{
maxWidth
:
'
24rem
'
,
paddingBottom
:
'
25px
'
,
paddingLeft
:
'
5px
'
,
paddingRight
:
'
5px
'
,
paddingTop
:
'
5px
'
}}
/
>
<
h1
className
=
"
register__title
"
>
Login
<
/h1
>
<
input
type
=
"
text
"
className
=
"
login__textBox
"
value
=
{
email
}
onChange
=
{(
e
)
=>
setEmail
(
e
.
target
.
value
)}
placeholder
=
"
E-mail Address
"
/>
<
input
type
=
"
password
"
className
=
"
login__textBox
"
value
=
{
password
}
onChange
=
{(
e
)
=>
setPassword
(
e
.
target
.
value
)}
placeholder
=
"
Password
"
/>
<
button
className
=
"
login__btn
"
onClick
=
{()
=>
signInWithEmailAndPassword
(
email
,
password
)}
>
Login
<
/button
>
<
div
className
=
"
login__btn login__google
"
>
<
span
class
=
"
input-group-addon
"
><
i
class
=
"
fa fa-google
"
style
=
{{
paddingBottom
:
'
0px
'
,
paddingLeft
:
'
5px
'
,
paddingRight
:
'
15px
'
,
paddingTop
:
'
0px
'
}}
><
/i></
span
>
<
button
className
=
"
login__btn login__google
"
onClick
=
{
signInWithGoogle
}
>
Login
with
Google
<
/button
>
<
/div
>
<
div
>
<
Link
to
=
"
/reset
"
>
Forgot
Password
<
/Link
>
<
/div
>
<
div
>
Not
registered
yet
?
<
Link
to
=
"
/register
"
>
Register
<
/Link> now
.
<
/div
>
<
/div
>
<
/div
>
);
}
export
default
Login
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment