-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wishlist-carditem Functionality Partially completed - Gaurav
- Loading branch information
1 parent
ed429a4
commit 7dbd8d6
Showing
11 changed files
with
118 additions
and
92 deletions.
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
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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from "react"; | ||
import { Navigate , NavLink } from "react-router-dom"; | ||
import { AiOutlineLogout } from "react-icons/ai"; | ||
|
||
function LogOut() { | ||
const handleLogout = () => { | ||
localStorage.removeItem("token"); | ||
Navigate("/"); | ||
}; | ||
return ( | ||
<div> | ||
<div onClick={handleLogout} className="flex justify-center items-center"> | ||
<NavLink to="/" className="flex justify-center items-center gap-3 py-3 px-5 text-rose-600 bg-transparent border-[2px] border-rose-600 rounded-lg hover:bg-rose-600 hover:text-white"> | ||
<button > | ||
Log Out ! | ||
</button> | ||
<AiOutlineLogout size={25}/> | ||
</NavLink> | ||
|
||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default LogOut; |
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createContext , useState } from 'react'; | ||
|
||
export const CartContext = createContext(null); | ||
|
||
export const CartCountProvider = (props) => { | ||
const [numCartItem , setNumCartItem] = useState(Math.max( 0)) | ||
const addCartItemNumber = () => { | ||
setNumCartItem(Math.max(numCartItem + 1 , 0)) | ||
} | ||
const subCartItemNumber = () => { | ||
setNumCartItem(Math.max(numCartItem - 1 , 0)) | ||
} | ||
return ( | ||
<CartContext.Provider value={{ | ||
numCartItem , | ||
setNumCartItem, | ||
addCartItemNumber, | ||
subCartItemNumber | ||
}}> | ||
{props.children} | ||
</CartContext.Provider> | ||
) | ||
} |
Oops, something went wrong.