Skip to content
Open
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
13 changes: 9 additions & 4 deletions frontend/src/Componets/LoginPopup/LoginPopup.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
width: max(23vw, 330px);
max-width: 90vw; /* ✅ Ensures it doesn’t overflow on small screens */
color: #808080;
background-color: white;
background-color: var(--bg-color);
display: flex;
flex-direction: column;
gap: 40px;
gap: 25px;
padding: 25px 30px;
border-radius: 8px;
font-size: 14px;
Expand All @@ -29,7 +29,7 @@
display: flex;
justify-content: space-between;
align-items: center;
color: black;
color: var(--text-color);
font-size: 18px;
}

Expand All @@ -42,6 +42,7 @@
display: flex;
flex-direction: column;
gap: 20px;
margin-bottom: 15px;
}

.login-popup-inputs input {
Expand All @@ -50,9 +51,13 @@
padding: 10px;
border-radius: 4px;
font-size: 15px;
background-color: var(--bg-color);
color: var(--text-color);
}

.login-popup-container button {
width: 100%;
margin: 8px 0;
border: none;
padding: 12px;
border-radius: 4px;
Expand All @@ -71,7 +76,7 @@
display: flex;
align-items: flex-start;
gap: 8px;
margin-top: -10px;
margin: 13px 0;
font-size: 13px;
}

Expand Down
10 changes: 4 additions & 6 deletions frontend/src/Componets/LoginPopup/LoginPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ const LoginPopup = ({ setShowLogin }) => {
? `${url}/api/users/login`
: `${url}/api/users/register`;

const payload =
current === "Login"
? { email: data.email, password: data.password }
: { name: data.name, email: data.email, password: data.password };
const payload = current === "Login"
? { email: data.email, password: data.password }
: { name: data.name, email: data.email, password: data.password };

try {
const response = await axios.post(newUrl, payload);
Expand All @@ -66,7 +65,6 @@ const LoginPopup = ({ setShowLogin }) => {
const googleLogin = () => {
window.location.href = `${import.meta.env.VITE_API_URL}/auth/google`;
};

return (
<div className="login-popup" onClick={() => setShowLogin(false)}>
<motion.div
Expand Down Expand Up @@ -184,6 +182,6 @@ const LoginPopup = ({ setShowLogin }) => {
</motion.div>
</div>
);
};
}

export default LoginPopup;