Skip to content

Commit

Permalink
Merge pull request #127 from arjunmishraaa/main
Browse files Browse the repository at this point in the history
upadting the changes
  • Loading branch information
Mujtabaa07 authored Jan 2, 2025
2 parents 41e7edf + 07aacfa commit bb4c248
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/Pages/Shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,21 @@ const ProductPrice = styled.p`
`;

const StyledButton = styled.button`
background: linear-gradient(145deg, #6b4f4f, #7d5858);
background: linear-gradient(145deg, #7c2214, #7c2216);
color: white;
border: none;
padding: 0.6rem 1.2rem;
font-size: 1rem;
border-radius: 20px;
border-radius: 4px;
cursor: pointer;
letter-spacing: 0.6px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
transition: background 0.3s ease, transform 0.2s ease;
&:hover {
background: linear-gradient(145deg, #7d5858, #8e6a6a);
background: linear-gradient(145deg,rgb(241, 231, 231),rgb(255, 250, 250));
color : #7c2214;
border : 2px solid #651d14;
transform: scale(1.05);
}
Expand Down
16 changes: 10 additions & 6 deletions src/Pages/login.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import { login } from '../Store/authSlice';
Expand Down Expand Up @@ -70,12 +69,17 @@ function Login() {

const handleSubmit = (e) => {
e.preventDefault();
const storedUser = JSON.parse(localStorage.getItem('user'));
if (storedUser && storedUser.username === username && storedUser.email === email && storedUser.password === password) {
dispatch(login({ username, email }));
navigate('/profile'); // Redirect to home page
const storedUser = localStorage.getItem('user');
if (storedUser) {
const parsedUser = JSON.parse(storedUser);
if (parsedUser.username === username && parsedUser.email === email && parsedUser.password === password) {
dispatch(login({ username, email }));
navigate('/profile'); // Redirect to profile page
} else {
setError('Invalid credentials');
}
} else {
setError('Invalid credentials');
setError('No user data found');
}
};

Expand Down
1 change: 1 addition & 0 deletions src/componets/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled from 'styled-components';

const StyledButton = styled(motion.button)`
padding: 0.5rem 1rem;
margin: 1rem 1rem;
font-size: 1rem;
background-color: ${props => props.primary ? '#7c2214' : '#7c2214'};
color: ${props => props.primary ? 'white' : 'white'};
Expand Down
9 changes: 9 additions & 0 deletions src/componets/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,31 @@ function Navbar() {
<Link to="/">MsCafe</Link>
</Logo>
<NavLinks>

{/* <!-- ------NavLink:::::Home-------------------> */}
<NavLink className={location.pathname === '/' ? 'active' : ''}
whileHover={{ scale: 1.05 }}>
<Link to="/">Home</Link>
</NavLink>
{/* <!-- ------NavLink:::::Shop-------------------> */}
<NavLink className={location.pathname === '/shop' ? 'active' : ''}
whileHover={{ scale: 1.05 }}>
<Link to="/shop">Shop</Link>
</NavLink>

{/* <!-- ------NavLink:::::About-------------------> */}
<NavLink className={location.pathname === '/about' ? 'active' : ''}
whileHover={{ scale: 1.05 }}>
<Link to="/about">About</Link>
</NavLink>

{/* <!-- ------NavLink::::Testinomial-------------------> */}
<NavLink className={location.pathname === '/testimonial' ? 'active' : ''}
whileHover={{ scale: 1.05 }}>
<Link to="/testimonial">Testimonial</Link>
</NavLink>

{/* <!-- ------NavLink:::::Contacts-------------------> */}
<NavLink className={location.pathname === '/contact' ? 'active' : ''}
whileHover={{ scale: 1.05 }}>
<Link to="/contact">Contact</Link>
Expand Down

0 comments on commit bb4c248

Please sign in to comment.