|
|
import React from "react"; |
|
|
import { connect } from "react-redux"; |
|
|
import { Link } from "react-router-dom"; |
|
|
import { useNavigate } from "react-router-dom"; |
|
|
|
|
|
//assets |
|
|
import userGreenIcon from "../../../../assets/icons/user-green.svg"; |
|
|
import videoGreenIcon from "../../../../assets/icons/video-green.svg"; |
|
|
import cartGreenIcon from "../../../../assets/icons/cart-green.svg"; |
|
|
import bookmarkGreenIcon from "../../../../assets/icons/bookmark-green.svg"; |
|
|
import bookGreenIcon from "../../../../assets/icons/book-green.svg"; |
|
|
import addressGreenIcon from "../../../../assets/icons/address-green.svg"; |
|
|
|
|
|
const List = ({ mobile }) => { |
|
|
const pages = [ |
|
|
{ |
|
|
icon: <img src={userGreenIcon} alt="" />, |
|
|
name: "اطلاعات حساب کاربری", |
|
|
link: "/editProfile", |
|
|
}, |
|
|
{ |
|
|
icon: <img src={cartGreenIcon} />, |
|
|
name: "سفارشات", |
|
|
link: "/Orders", |
|
|
}, |
|
|
{ |
|
|
icon: <img src={bookGreenIcon} />, |
|
|
name: "کتابهای من", |
|
|
link: "/AR", |
|
|
}, |
|
|
{ |
|
|
icon: <img src={videoGreenIcon} />, |
|
|
name: "دورههای من", |
|
|
link: "#", |
|
|
}, |
|
|
{ |
|
|
icon: <img src={bookmarkGreenIcon} />, |
|
|
name: "لیست علاقهمندیها", |
|
|
link: "/favorites", |
|
|
}, |
|
|
{ |
|
|
icon: <img src={addressGreenIcon} />, |
|
|
name: "آدرسها", |
|
|
link: "/addresses", |
|
|
}, |
|
|
]; |
|
|
|
|
|
return ( |
|
|
<div className={`w-full mt-7`}> |
|
|
{pages.map((page, index) => ( |
|
|
<Link |
|
|
key={index} |
|
|
to={page.link} |
|
|
className={`w-full flex items-center justify-between mb-6 pb-4 flex-row shadow-sm`} |
|
|
> |
|
|
<div className={`flex items-center flex-row`}> |
|
|
{page.icon} |
|
|
<span className={`mt-1 mr-2.5 text-gray1 text-base font-medium`}> |
|
|
{page.name} |
|
|
</span> |
|
|
</div> |
|
|
<svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}> |
|
|
<path |
|
|
d="M15.002 19.92 8.479 13.4a1.986 1.986 0 0 1 0-2.8l6.523-6.52" |
|
|
fill="none" |
|
|
stroke="#c6c6c6" |
|
|
strokeLinecap="round" |
|
|
strokeLinejoin="round" |
|
|
strokeWidth={1.5} |
|
|
/> |
|
|
</svg> |
|
|
</Link> |
|
|
))} |
|
|
</div> |
|
|
); |
|
|
}; |
|
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
mobile: state.publicApi.mobile, |
|
|
}); |
|
|
|
|
|
export default connect(mapStateToProps)(List);
|
|
|
|