Skip to content

Commit

Permalink
Merge pull request #119 from Athaxv/css-input-error-#98
Browse files Browse the repository at this point in the history
Css input error #98
  • Loading branch information
Anuj3553 authored Oct 16, 2024
2 parents 289e1e1 + d151370 commit a61248d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 13 deletions.
1 change: 1 addition & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions client/src/component/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./css/Login.css";

const host = "http://localhost:5000";

const Login = (props) => {
const Login = ({mode}) => {
const [credentials, setCredentials] = useState({ email: "", password: "" });
const [forgotPasswordModalVisible, setForgotPasswordModalVisible] =
useState(false);
Expand Down Expand Up @@ -84,7 +84,11 @@ const Login = (props) => {
name="email"
aria-describedby="emailHelp"
autoComplete="on"
style={{ backgroundColor: props.mode === 'dark' ? '#333' : '#fff', color: props.mode === 'dark' ? '#fff' : '#000' }}
style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}

/>
<i className="fa-solid fa-user"></i>
</div>
Expand All @@ -98,9 +102,15 @@ const Login = (props) => {
onChange={onChange}
name="password"
autoComplete="on"
style={{ backgroundColor: props.mode === 'dark' ? '#333' : '#fff', color: props.mode === 'dark' ? '#fff' : '#000' }}
style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}
/>
<i className="fa-solid fa-lock"></i>
<i className="fa-solid fa-lock" style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}></i>
</div>
<Button className="submit" type="submit">
Login
Expand Down
37 changes: 31 additions & 6 deletions client/src/component/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { Eye, EyeOff} from "lucide-react";
import PropTypes from "prop-types";
import { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { Input } from "antd";
import "./css/Login.css";
import { registerValidation } from "../validations/validation";

// import { signInWithPopup, GoogleAuthProvider } from 'firebase/auth';
// import { auth } from '../component/Firebase/Setup';
const host = "http://localhost:5000";

const Signup = (props) => {
const Signup = ({mode}) => {
// const [value, setValue] = useState('');
const [showPassword, setShowPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
Expand Down Expand Up @@ -263,7 +264,7 @@ const Signup = (props) => {
<h1 className="title">Sign Up</h1>
<span className="title-line"></span>
<div className="inp">
<input
<Input
type="text"
className="input"
placeholder="Name"
Expand All @@ -273,9 +274,16 @@ const Signup = (props) => {
id="name"
autoComplete="on"
value={name}
style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}
/>
{errors.name && <div className="text-danger">{errors.name}</div>}
<i className="fa-solid fa-user"></i>
<i className="fa-solid fa-user" style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}></i>
</div>
<div className="inp">
<input
Expand All @@ -288,11 +296,18 @@ const Signup = (props) => {
aria-describedby="emailHelp"
autoComplete="on"
value={email}
style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}
/>
{errors.email && <div className="text-danger">{errors.email}</div>}
<i className="fa-solid fa-user"></i>
</div>
<div className="inp">
<div className="inp" style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}>
<input
type={showPassword ? "text" : "password"}
className="input"
Expand All @@ -303,9 +318,16 @@ const Signup = (props) => {
minLength={5}
autoComplete="on"
value={password}
style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}
/>
{errors.password && (
<div className="text-danger">{errors.password}</div>
<div className="text-danger" style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}>{errors.password}</div>
)}
<button
type="button"
Expand All @@ -318,7 +340,10 @@ const Signup = (props) => {
<Eye className="w-5 h-5" />
)}
</button>
<i className="fa-solid fa-user"></i>
<i className="fa-solid fa-user" style={{
backgroundColor: mode === 'dark' ? 'black' : 'white',
color: mode === 'dark' ? 'white' : 'black',
}}></i>
</div>
<div className="inp">
<input
Expand Down
9 changes: 6 additions & 3 deletions client/src/component/css/Login.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ body{
font-size: 17px;
}



/*Changed this for dark-mode input toggle (by anothercoder-nik)*/
.dark-mode .input {
/* .dark-mode .input {
color: #ffffff; /* White text for dark mode */
background: #000000; /* Black background for dark mode */
}
/* background: #000000; /* Black background for dark mode */
/* } */

.submit{
border: none;
outline: none;
Expand Down

0 comments on commit a61248d

Please sign in to comment.