You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

254 lines
7.8 KiB

import {
View,
Text,
Platform,
TouchableOpacity,
Dimensions,
} from "react-native";
import React from "react";
import { connect } from "react-redux";
import Svg, { Path, G } from "react-native-svg";
import { useNavigation } from "@react-navigation/native";
//components
//style
import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
const ios = Platform.OS === "ios";
const List = ({ mobile, theme }) => {
const navigation = useNavigation();
const pages = [
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}>
<Path
d="M17 7a5 5 0 1 1-5-5 5 5 0 0 1 5 5Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="M20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
),
name: "اطلاعات حساب کاربری",
onPress: () => navigation.push("CreateAddress", { type: "profile" }),
},
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}>
<Path
d="M7.5 7.67V6.7a4.773 4.773 0 0 1 4.06-4.67 4.5 4.5 0 0 1 4.94 4.478v1.38"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="M9 22h6c4.02 0 4.74-1.61 4.95-3.57l.75-6C20.97 9.99 20.27 8 16 8H8c-4.27 0-4.97 1.99-4.7 4.43l.75 6C4.26 20.39 4.98 22 9 22Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="M15.496 12h.005M8.495 12H8.5"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
/>
</Svg>
),
name: "سفارشات",
onPress: () => navigation.push("Orders"),
},
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={23.746}>
<Path
d="M22 16.548V4.642a1.959 1.959 0 0 0-2.17-1.963h-.06a19.029 19.029 0 0 0-7.07 2.338l-.17.109a1.121 1.121 0 0 1-1.06 0l-.25-.148a18.935 18.935 0 0 0-7.06-2.309A1.957 1.957 0 0 0 2 4.632v11.916a2.036 2.036 0 0 0 1.74 1.953l.29.039a25.941 25.941 0 0 1 7.44 2.407l.04.02a1.094 1.094 0 0 0 .96 0 25.705 25.705 0 0 1 7.46-2.427l.33-.039A2.036 2.036 0 0 0 22 16.548Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="M12 5.236v15M19.955 8.4h-2.25M19.918 11.369h-3"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
),
name: "کتابهای من",
onPress: () => navigation.push("AR"),
},
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}>
<G data-name="Group 2005">
<Path
d="M18.085 20.769H6.528c-3.467 0-5.778-2-5.778-6.673V7.423C.75 2.75 3.061.75 6.528.75h11.557c3.467 0 5.778 2 5.778 6.673v6.673c0 4.671-2.313 6.673-5.778 6.673Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
data-name="vuesax/linear/music-playlist"
/>
<Path
data-name="Vector"
d="M8.954 10.76V9.296c0-1.878 1.329-2.646 2.951-1.708l1.268.732 1.268.732c1.622.939 1.622 2.476 0 3.415l-1.267.732-1.268.732c-1.623.938-2.952.17-2.952-1.708V10.76Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</G>
</Svg>
),
name: "دورههای من",
onPress: () => {},
},
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={25.5} height={25.5}>
<Path
d="M15.407 11.316h-5.313"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="M12.75 8.723v5.313M17.872 2.125H7.628a4.111 4.111 0 0 0-4.1 4.1v14.972c0 1.912 1.371 2.72 3.049 1.8l5.185-2.879a2.251 2.251 0 0 1 1.987 0l5.185 2.879c1.679.935 3.049.128 3.049-1.8V6.225a4.127 4.127 0 0 0-4.111-4.1Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
),
name: "لیست علاقهمندیها",
onPress: () => navigation.push("ProfileBookmark"),
},
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}>
<G
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
>
<Path d="M12.14 15.07v-1.96a4.569 4.569 0 0 1 4.57-4.57h1.96" />
<Path
data-name="Vector"
d="M5.62 8.55h1.96a4.569 4.569 0 0 1 4.57 4.57v4.13"
/>
<Path
data-name="Vector"
d="m7.14 6.75-1.8 1.8 1.8 1.8M16.86 6.75l1.8 1.8-1.8 1.8"
/>
</G>
<Path
data-name="Vector"
d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z"
fill="none"
stroke="#37a865"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
),
name: "آدرسها",
onPress: () => navigation.push("ProfileAddress"),
},
];
return (
<View
style={tw(
`w-full ${mobile ? "mt-8" : "mt-12"} ${ios ? "items-end" : ""}`
)}
>
{pages.map((page, index) => (
<TouchableOpacity
key={index}
style={[
tw(
`w-full flex items-center justify-between mb-4 pb-4 flex-row-reverse`
),
{
borderBottomWidth: 1,
borderColor: Colors.theme1[theme].grayE3 + "aa",
},
]}
onPress={() => page.onPress()}
>
<View style={tw(`flex items-center flex-row-reverse`)}>
{page.icon}
<Text
style={{
fontFamily: "regular",
marginTop: 5,
marginRight: mobile ? 10 : 20,
color: Colors.theme1[theme].gray20,
fontSize: mobile ? fontSize.tiny : fontSize.lg,
}}
>
{page.name}
</Text>
</View>
<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>
</TouchableOpacity>
))}
</View>
);
};
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
});
export default connect(mapStateToProps)(List);