-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from atlp-rwanda/fix-nav-side-icons
Finishes fixing homepage sign in links
- Loading branch information
Showing
11 changed files
with
340 additions
and
61 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 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 |
---|---|---|
@@ -1,27 +1,54 @@ | ||
import React from 'react' | ||
import { Link } from 'react-router-dom'; | ||
|
||
import React from 'react'; | ||
import { BiLoader } from 'react-icons/bi'; | ||
import { LuUser } from 'react-icons/lu'; | ||
import { useDispatch } from 'react-redux'; | ||
import { Link, useNavigate } from 'react-router-dom'; | ||
import { clearUserData } from '../../../redux/slices/userSlice'; | ||
interface WishNav { | ||
setWish: React.Dispatch<React.SetStateAction<boolean>> | ||
setWish: React.Dispatch<React.SetStateAction<boolean>>; | ||
isLoading: boolean; | ||
userInfo: string[]; | ||
} | ||
|
||
const WishNav: React.FC<WishNav> = () => { | ||
return ( | ||
<> | ||
<div className='absolute w-[280px] right-20 md:right-24 top-12 md:top-14 mt-2 bg-whiteColor text-blackColor rounded-md border border-grayColor shadow-customShadow p-3 px-4 flex flex-col gap-3 z-50'> | ||
<div className='flex justify-center items-center gap-1'> | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1} stroke="currentColor" className="size-6 md:size-8"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /> | ||
</svg> | ||
<Link to="/" className='hover:underline font-light text-base'>My Account</Link> | ||
</div> | ||
<div className='flex flex-col justify-center items-center gap-2 font-light'> | ||
<span>Not Ange?</span> | ||
<button className='rounded-full py-1 px-2 font-normal text-center select-none border border-greenColor cursor-pointer w-full'>Sign Out</button> | ||
</div> | ||
const WishNav: React.FC<WishNav> = ({ isLoading, userInfo }) => { | ||
const navigate = useNavigate(); | ||
const dispatch = useDispatch(); | ||
const [firstName, lastName] = userInfo; | ||
const handleSignOut = () => { | ||
dispatch(clearUserData()); | ||
navigate('/'); | ||
}; | ||
return ( | ||
<> | ||
<div className='absolute w-[280px] right-20 md:right-24 top-12 md:top-14 mt-2 bg-whiteColor text-blackColor rounded-md border border-grayColor shadow-customShadow p-3 px-4 flex flex-col gap-3 z-50'> | ||
{isLoading ? ( | ||
<div className='min-h-20 flex flex-col items-center justify-center'> | ||
<BiLoader className='animate-spin w-full h-full max-h-12' /> | ||
</div> | ||
) : ( | ||
<> | ||
<div className='flex flex-col justify-center items-center gap-1'> | ||
<p className='text-xl font-medium '>{firstName + ' ' + lastName}</p> | ||
<div className='flex items-center gap-3 mt-5 mb-2'> | ||
<LuUser className='size-6 md:size-8' strokeWidth={1} stroke='currentColor' />{' '} | ||
<Link to='/' className='hover:underline font-light text-base'> | ||
Account Settings | ||
</Link> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
<div className='flex flex-col justify-center items-center gap-2 font-light'> | ||
<button | ||
className='rounded-full text-blackColor py-1 px-2 font-normal text-center select-none border border-greenColor cursor-pointer w-full transition-all hover:bg-greenColor hover:text-whiteColor' | ||
onClick={handleSignOut} | ||
> | ||
Sign Out | ||
</button> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default WishNav | ||
export default WishNav; |
Oops, something went wrong.