-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: login page #446 #450
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import photo from '../../assets/login.png'; | ||
import photo from '../../assets/login-opt.png'; | ||
import { Link, useNavigate } from 'react-router-dom'; | ||
import { message } from 'antd'; | ||
import Cookies from 'js-cookie'; | ||
|
@@ -55,28 +55,29 @@ const Login = () => { | |
}, []); | ||
|
||
return ( | ||
<div className="w-screen h-screen dark:bg-black flex items-center justify-center lg:pt-10 px-4"> | ||
<div className="w-screen h-screen pt-10 flex flex-col lg:flex-row items-center justify-center lg:space-x-10 px-4 dark:bg-black"> | ||
{/* Background Image */} | ||
<img | ||
src={photo} | ||
alt="login" | ||
loading="lazy" | ||
className="absolute w-3/4 lg:w-auto lg:opacity-100 opacity-10 object-cover" | ||
className="w-3/4 max-w-xs lg:max-w-2xl lg:w-1/2 object-contain mb-6 lg:mb-0" | ||
Comment on lines
+66
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance image loading and responsiveness. While the current implementation addresses overflow issues, consider these improvements: <img
src={photo}
alt="login"
loading="lazy"
- className="w-3/4 max-w-xs lg:max-w-2xl lg:w-1/2 object-contain mb-6 lg:mb-0"
+ className="w-3/4 max-w-xs lg:max-w-2xl lg:w-1/2 object-contain mb-6 lg:mb-0 aspect-auto"
+ onError={(e) => {
+ e.target.onerror = null;
+ e.target.src = 'fallback-image.png';
+ }}
/>
|
||
/> | ||
|
||
{/* Login Form */} | ||
<form | ||
onSubmit={handleSubmit} | ||
className="z-10 p-8 lg:p-16 bg-[#f1e9dc] dark:bg-amber-800 dark:text-white flex flex-col gap-6 rounded-lg border-2 border-black shadow-[4px_4px_0px_0px_black] w-full max-w-md lg:max-w-xl" | ||
className="z-10 p-8 lg:p-16 bg-[#f1e9dc] dark:bg-amber-800 dark:text-white flex flex-col gap-6 rounded-lg border-2 border-black shadow-[4px_4px_0px_0px_black] w-full max-w-md lg:max-w-lg" | ||
> | ||
<div className="text-[#323232] dark:text-white font-black text-4xl lg:text-7xl mb-2"> | ||
<div className="text-[#323232] dark:text-white font-black text-3xl lg:text-5xl mb-2"> | ||
Welcome, | ||
<span className="block text-[#666] dark:text-gray-400 font-semibold text-lg lg:text-2xl mt-1"> | ||
Log in to continue | ||
</span> | ||
</div> | ||
|
||
<input | ||
className="w-full h-12 rounded-md border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] text-[15px] font-semibold text-[#323232] p-2.5 focus:outline-none focus:border-[#2d8cf0] placeholder-[#666]" | ||
className="w-full h-12 rounded-md border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] dark:shadow-[4px_4px_0px_0px_grey] text-[15px] font-semibold text-[#323232] p-2.5 focus:outline-none focus:border-[#2d8cf0] placeholder-[#666] dark:bg-slate-800 dark:placeholder-white" | ||
name="email" | ||
placeholder="Email" | ||
type="email" | ||
|
@@ -85,7 +86,7 @@ const Login = () => { | |
|
||
<div className="relative w-full"> | ||
<input | ||
className="w-full h-12 rounded-md border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] text-[15px] font-semibold text-[#323232] p-2.5 focus:outline-none focus:border-[#2d8cf0] placeholder-[#666]" | ||
className="w-full h-12 rounded-md border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] dark:shadow-[4px_4px_0px_0px_grey] text-[15px] font-semibold text-[#323232] p-2.5 focus:outline-none focus:border-[#2d8cf0] placeholder-[#666] dark:bg-slate-800 dark:placeholder-white" | ||
name="password" | ||
placeholder="Password" | ||
type={hidden ? 'password' : 'text'} | ||
|
@@ -134,7 +135,7 @@ const Login = () => { | |
> | ||
<button | ||
type="button" | ||
className="w-full h-12 rounded-md border-2 dark:text-white border-black bg-beige shadow-[4px_4px_0px_0px_black] text-[17px] font-semibold text-[#323232] transition active:translate-x-[3px] active:translate-y-[3px]" | ||
className="w-full h-12 rounded-md border-2 dark:text-white border-black bg-beige shadow-[4px_4px_0px_0px_black] dark:shadow-[4px_4px_0px_0px_grey] text-[17px] font-semibold text-[#323232] transition active:translate-x-[3px] active:translate-y-[3px]" | ||
> | ||
Sign in with Google | ||
</button> | ||
|
@@ -144,7 +145,7 @@ const Login = () => { | |
|
||
<button | ||
type="submit" | ||
className="w-full h-12 rounded-md dark:text-white border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] text-[17px] font-semibold text-[#323232] transition active:translate-x-[3px] active:translate-y-[3px]" | ||
className="w-full h-12 rounded-md dark:text-white border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] dark:shadow-[4px_4px_0px_0px_grey] text-[17px] font-semibold text-[#323232] transition active:translate-x-[3px] active:translate-y-[3px]" | ||
> | ||
{isLoading ? 'Loading...' : 'Let’s Log you in →'} | ||
</button> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on contributor updates, but please check for duplicates.
The contributor updates look good, but there are duplicate entries for some contributors:
Please remove the duplicate entries to maintain a clean contributors list.
Also applies to: 270-273, 293-296, 300-303, 365-368, 374-377, 388-414, 488-493