Skip to content
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

Fixed::[Bug]: want to fix ui of review us and other screens in darkmode + Ui of 4rth Year #161 #166

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Server_Base_url="http://localhost:4000" #it is example replace it with your server Url
6 changes: 3 additions & 3 deletions src/components/login/LoginSignup.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
color: white !important;
}
.active div , .active button{
background-color: #000016 !important;
/* background-color: #000016 !important; */
color: white !important;

}
.active .card , .active .book ,.active .box , .active .ag-courses-item_title, .active .ag-courses_item {
.active .card , .active .book ,.active .box , .active .ag-courses_item {
background-color: #000000 !important;
color: white !important;
box-shadow: 0px 0px 15px lightblue;

}
.active .text-box-in , .active div{
.active .text-box-in {
color: white !important;
}
.active .ag-courses-item_bg{
Expand Down
97 changes: 33 additions & 64 deletions src/components/login/LoginSignup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,17 @@ const LoginSignup = () => {
password: "",
email: "",
});

const [errors, setErrors] = useState({
username: "",
password: "",
email: "",
});

const handleSignInWithGoogle = () => {
window.location.href = 'http://localhost:4000/auth/google'; // Redirect to the server route for Google OAuth login
window.location.href = `${process.env.Server_Base_url}/auth/google`; // Redirect to the server route for Google OAuth login
};

const ChangeHandler = (e) => {
setFormData({ ...formData, [e.target.name]: e.target.value });
setErrors({ ...errors, [e.target.name]: "" });
};

const validate = () => {
let isValid = true;
const newErrors = {
username: "",
password: "",
email: "",
};

if (state === "Sign Up" && !formData.username) {
newErrors.username = "Please enter your name.";
isValid = false;
}
if (!formData.email) {
newErrors.email = "Please enter your email.";
isValid = false;
}
if (!formData.password) {
newErrors.password = "Please enter your password.";
isValid = false;
}

setErrors(newErrors);
return isValid;
};

const login = async () => {
if (!validate()) return;
console.log("login");
let responseData;
await fetch("http://localhost:4000/login", {
await fetch(`${process.env.Server_Base_url}/login`, {
method: "POST",
headers: {
Accept: 'application/form-data',
Expand All @@ -76,73 +41,77 @@ const LoginSignup = () => {
}
};
const signup = async () => {
if (!validate()) return;
console.log("Sign up");
let responseData;
await fetch("http://localhost:4000/signup", {
await fetch(`${process.env.Server_Base_url}/signup`, {
method: "POST",
headers: {
Accept: 'application/form-data',
'content-Type': 'application/json'
},
body: JSON.stringify(formData)
}).then((response) => response.json()).then((data) => responseData = data);
}).then((response) => response.json()).then((data) => responseData = data)
if (responseData.success) {
localStorage.setItem('auth-token', responseData.token);
window.location.replace("/");
} else {
window.location.replace("/")
}
else {
alert(responseData.errors);
}
};

return (
<div className={`${theme=='dark'?"active":""} loginsignup`}>

<Link to="/" className="back-icon" style={{ position: 'absolute', top: '15px', left: '35px', fontSize: '42px' }}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="42"
height="42"
fill="currentColor"
viewBox="0 0 16 16"
style={{
<Link to="/" className="back-icon" style={{ position: 'absolute', top: '15px', left: '35px', fontSize: '42px' }}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="42"
height="42"
fill="currentColor"
viewBox="0 0 16 16"
style={{
fontWeight: 'bold',
position: 'fixed',
top: 20,
position: 'fixed',
top: 20,
left: 20
}}
>
<path
fillRule="evenodd"
<path
fillRule="evenodd"
d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-4.5-.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5z"
/>
</svg>
</Link>

<div className="loginsignup-cointainer">



<h1>{state}</h1>
<div className="loginsignup-fields">
{state === "Sign Up" ? (
<>
<p className="label-login">Name</p>
<input type="text" name="username" value={formData.username} onChange={ChangeHandler} placeholder="Your Name" /> {errors.username && <div className="error-message">{errors.username}</div>}</>
<input type="text" name="username" value={formData.username} onChange={ChangeHandler} placeholder="Your Name" /></>
) : (
<></>
)}
<p className="label-login">Email</p>
<input type="email" name="email" value={formData.email} onChange={ChangeHandler} placeholder="Email Address" />
{errors.email && <div className="error-message ">{errors.email}</div>}

<p className="label-login">Password</p>
<input type={`${isVisible ? "text" : "password"}`} name="password" value={formData.password} onChange={ChangeHandler} placeholder="Password" /> {errors.password && <div className="error-message">{errors.password}</div>}
{isVisible ? <FaEye color="white" className={`${state == 'Sign Up' ? "eye1" : "eye"}`} onClick={() => setIsVisible(false)} /> : <FaEyeSlash className={`${state == 'Sign Up' ? "eye1" : "eye"}`} color="white" onClick={() => setIsVisible(true)} />}
</div>
<input type={`${isVisible?"text":"password"}`} name="password" value={formData.password} onChange={ChangeHandler} placeholder="Password" />
{isVisible?<FaEye color="white" className={`${state=='Sign Up'?"eye1":"eye"}`} onClick={()=>setIsVisible(false)} />:<FaEyeSlash className={`${state=='Sign Up'?"eye1":"eye"}`} color="white" onClick={()=>setIsVisible(true)}/>}
</div>
<button
onClick={() => {
state === "Login" ? login() : signup();
}}
>


{state === "Login" ? "Login" : "Sign Up"}
{state === "Login" ? "Login" : "Sign Up"}
</button>
{state === "Sign Up" ? (
<p className="loginsignup-login">
Expand Down Expand Up @@ -176,4 +145,4 @@ const LoginSignup = () => {
</div>
);
};
export default LoginSignup;
export default LoginSignup;
4 changes: 2 additions & 2 deletions src/components/page1/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ background-color: #000016 !important;
color: white !important;
}

.active div , .active button{
.active button{
background-color: #000016 !important;
color: white !important;

}
.active .card , .active .book ,.active .box , .active .ag-courses-item_title, .active .ag-courses_item {
.active .card , .active .book ,.active .box , .active .ag-courses_item {
background-color: #000000 !important;
color: white !;
box-shadow: 0px 0px 15px lightblue;
Expand Down
4 changes: 3 additions & 1 deletion src/components/page2/notice.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
padding: 10px;
font-size: 12px;
}

.active .notices{
background-color: #000016;
}
@media only screen and (max-width : 767px) {
.notices{
font-size: 16px;
Expand Down
18 changes: 9 additions & 9 deletions src/components/page3/4Year.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from 'react'
import {Link} from 'react-router-dom';
import Header from '../../pages/header';
import '../page3/1Year.css';

import syllabus from '../../assets/icons8-syllabus-80 (1).png';

import quantumImage from '../../assets/5th.png';
import youtube from '../../assets/ytt.png'
import timetable from '../../assets/sec-3A.jpg';
import syllabus from '../../assets/syllabuswt.jpg';


import ComingSoon from '../../pages/cs.js'

Expand All @@ -27,14 +27,14 @@ function fothYear() {
<div className="content">
<div className="cards">

<Link class="link" to='/frthsyllabus'>
<div class="card pink">
<img src={syllabus} alt="" />
<p class="second-text">Syllabus</p>
</div>
</Link>


<Link to='/frthsyllabus'>
<div className="card pink">
<img src={syllabus} alt="" />
<p className="second-text">Syllabus</p>
</div>
</Link>




Expand Down
6 changes: 5 additions & 1 deletion src/components/page4/syllabus.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

border-radius: 28px;
}

.ag-courses-item_link {
display: block;
padding: 30px 20px;
Expand All @@ -48,10 +49,13 @@
-ms-transform: scale(10);
transform: scale(10);
}
.active .ag-courses-item_link{
background-color: black;
}
.ag-courses-item_title {
min-height: 87px;
margin: 0 0 25px;

background-color: transparent !important;
overflow: hidden;

font-weight: bold;
Expand Down
Loading
Loading