-
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.
bugFix(Navbar): correct the navabar and dashboard
- Loading branch information
1 parent
f6cfec4
commit e194c20
Showing
10 changed files
with
137 additions
and
123 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
Empty file.
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,64 +1,70 @@ | ||
"use client"; | ||
'use client'; | ||
import React, { useEffect } from 'react'; | ||
import { User, Cake, Award } from 'lucide-react'; | ||
import { FaUser, FaEnvelope } from "react-icons/fa"; | ||
import { FaLocationDot, FaPhone } from "react-icons/fa6"; | ||
import { FaUser, FaEnvelope } from 'react-icons/fa'; | ||
import { FaLocationDot, FaPhone } from 'react-icons/fa6'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { AppDispatch, RootState } from '@/redux/store'; | ||
import { getUserProfile } from '@/redux/slices/profileSlice'; | ||
import request from '@/utils/axios'; | ||
|
||
function About() { | ||
const dispatch = useDispatch<AppDispatch>(); | ||
const { user, loading, error } = useSelector((state: RootState) => state.userProfile); | ||
const dispatch = useDispatch<AppDispatch>(); | ||
const { user, loading, error } = useSelector( | ||
(state: RootState) => state.userProfile, | ||
); | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
await dispatch(getUserProfile()); | ||
}; | ||
fetchData(); | ||
}, [dispatch]); | ||
useEffect(() => { | ||
const fetchData = async () => { | ||
await dispatch(getUserProfile()); | ||
}; | ||
fetchData(); | ||
}, [dispatch]); | ||
|
||
|
||
if (error) return <div>Error: {error}</div>; | ||
if (!user) return <div>No user found</div>; | ||
|
||
if (loading) return <div>Loading...</div>; | ||
if (error) return <div>Error: {error}</div>; | ||
if (!user) return <div>No user found</div>; | ||
const items: any = [ | ||
{ | ||
icon: <Cake className="text-green-500" />, | ||
details: `${user.User?.birthDate}`, | ||
}, | ||
{ | ||
icon: <FaLocationDot className="text-green-500" />, | ||
details: `${user.User?.whereYouLive}`, | ||
}, | ||
{ | ||
icon: <FaEnvelope className="text-green-500" />, | ||
details: `${user.User?.email}`, | ||
}, | ||
{ | ||
icon: <FaPhone className="text-green-500" />, | ||
details: `${user.User?.phone}`, | ||
}, | ||
]; | ||
|
||
const items: any = [ | ||
{ | ||
icon: <Cake className='text-green-500' />, | ||
details: `${user.User?.birthDate}`, | ||
}, | ||
{ | ||
icon: <FaLocationDot className='text-green-500' />, | ||
details: `${user.User?.whereYouLive}`, | ||
}, | ||
{ | ||
icon: <FaEnvelope className='text-green-500' />, | ||
details: `${user.User?.email}`, | ||
}, | ||
{ | ||
icon: <FaPhone className='text-green-500' />, | ||
details: `${user.User?.phone}`, | ||
} | ||
]; | ||
|
||
return ( | ||
<div className='bg-white shadow-md pl-5 pr-2 p-6 rounded-lg max-h-72'> | ||
<h3 className='font-semibold text-secondaryBlue text-[1rem] pr-5'>About</h3> | ||
<div> | ||
{items?.map((item: any, index: number) => ( | ||
<div key={index} className={`flex flex-col ${index === items.length - 1 ? "" : "border-b-[1px]"} py-3 pl-3 pr-0`}> | ||
<div className='flex items-center gap-2'> | ||
{item.icon} | ||
<span className='text-secondaryBlue font-extralight text-[0.7rem]'>{item.details}</span> | ||
</div> | ||
</div> | ||
))} | ||
return ( | ||
<div className="bg-white shadow-md pl-5 pr-2 p-6 rounded-lg max-h-72"> | ||
<h3 className="font-semibold text-secondaryBlue text-[1rem] pr-5"> | ||
About | ||
</h3> | ||
<div> | ||
{items?.map((item: any, index: number) => ( | ||
<div | ||
key={index} | ||
className={`flex flex-col ${index === items.length - 1 ? '' : 'border-b-[1px]'} py-3 pl-3 pr-0`} | ||
> | ||
<div className="flex items-center gap-2"> | ||
{item.icon} | ||
<span className="text-secondaryBlue font-extralight text-[0.7rem]"> | ||
{item.details} | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default About; | ||
export default About; |
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,59 +1,51 @@ | ||
"use client"; | ||
import React, { useEffect, useState } from 'react' | ||
'use client'; | ||
import React, { useEffect, useState } from 'react'; | ||
import request from '@/utils/axios'; | ||
|
||
|
||
|
||
|
||
function Order() { | ||
// const [orderss, setOrders] = useState<Orders[]>([]); | ||
// useEffect(() => { | ||
// const fetchData = async () => { | ||
// const response: any = await request.get('/orders'); | ||
// setOrders(response.orders); | ||
// }; | ||
// fetchData(); | ||
// }, []) | ||
const orders: any = [ | ||
{ | ||
name: "Sneakers N12", | ||
desc: "Men's Shoes" | ||
}, | ||
{ | ||
name: "Toyota", | ||
desc: "Best car in city" | ||
}, | ||
{ | ||
name: "Girl Dress", | ||
desc: "tkacheanton dress" | ||
} | ||
] | ||
useEffect(() => { | ||
|
||
}, []) | ||
return ( | ||
<div className='bg-white shadow-md rounded-lg pl-10 pb-4'> | ||
<div className='w-[100%] py-4 '> | ||
<h3 className='font-semibold text-primaryBlue'>Orders</h3> | ||
// const [orderss, setOrders] = useState<Orders[]>([]); | ||
// useEffect(() => { | ||
// const fetchData = async () => { | ||
// const response: any = await request.get('/orders'); | ||
// setOrders(response.orders); | ||
// }; | ||
// fetchData(); | ||
// }, []) | ||
const orders: any = [ | ||
{ | ||
name: 'Sneakers N12', | ||
desc: "Men's Shoes", | ||
}, | ||
{ | ||
name: 'Toyota', | ||
desc: 'Best car in city', | ||
}, | ||
{ | ||
name: 'Girl Dress', | ||
desc: 'tkacheanton dress', | ||
}, | ||
]; | ||
useEffect(() => {}, []); | ||
return ( | ||
<div className="bg-white shadow-md rounded-lg pl-10 pb-4"> | ||
<div className="w-[100%] py-4 "> | ||
<h3 className="font-semibold text-primaryBlue">Orders</h3> | ||
</div> | ||
<div className="flex flex-col gap-4"> | ||
{orders?.map((order: any, index: any) => { | ||
return ( | ||
<div className="flex flex-col"> | ||
<span className="text-secondaryBlue text-[.8rem]"> | ||
{order.name} | ||
</span> | ||
<span className="text-greenMain text-[.7rem] opacity-65"> | ||
{order.desc} | ||
</span> | ||
</div> | ||
<div className='flex flex-col gap-4'> | ||
{ | ||
orders?.map((order: any, index: any) => { | ||
return ( | ||
<div className='flex flex-col'> | ||
<span className='text-secondaryBlue text-[.8rem]'>{order.name}</span> | ||
<span className='text-greenMain text-[.7rem] opacity-65'>{order.desc}</span> | ||
</div> | ||
) | ||
}) | ||
} | ||
</div> | ||
</div> | ||
) | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
} | ||
export default Order | ||
|
||
|
||
|
||
|
||
|
||
export default Order; |
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