diff --git a/src/assets/icons/address-green.svg b/src/assets/icons/address-green.svg new file mode 100644 index 0000000..4f3637a --- /dev/null +++ b/src/assets/icons/address-green.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/icons/book-green.svg b/src/assets/icons/book-green.svg new file mode 100644 index 0000000..eab305b --- /dev/null +++ b/src/assets/icons/book-green.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/icons/bookmark-green.svg b/src/assets/icons/bookmark-green.svg new file mode 100644 index 0000000..49037b2 --- /dev/null +++ b/src/assets/icons/bookmark-green.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/icons/cart-green.svg b/src/assets/icons/cart-green.svg new file mode 100644 index 0000000..85aec57 --- /dev/null +++ b/src/assets/icons/cart-green.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/icons/user-green.svg b/src/assets/icons/user-green.svg new file mode 100644 index 0000000..4974c3f --- /dev/null +++ b/src/assets/icons/user-green.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/icons/video-green.svg b/src/assets/icons/video-green.svg new file mode 100644 index 0000000..51c1ea6 --- /dev/null +++ b/src/assets/icons/video-green.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/views/Dashboard/index.js b/src/views/Dashboard/index.js index ef69802..dc82c8b 100644 --- a/src/views/Dashboard/index.js +++ b/src/views/Dashboard/index.js @@ -5,12 +5,15 @@ import { publicApi } from "../../redux/actions"; //components import Sidebar from "./layouts/SidebarMenu"; import Main from "./layouts/Main"; +import User from "./layouts/Mobile/User"; +import Trophy from "./layouts/Mobile/Trophy"; +import List from "./layouts/Mobile/List"; export const Dashboard = ({ isMobile, headerOptions, setHeaderOptions }) => { const [page, setPage] = useState( localStorage?.getItem("dashboard") || "userItems" ); - + useEffect(() => { setHeaderOptions(headerOptions); }, []); @@ -19,10 +22,12 @@ export const Dashboard = ({ isMobile, headerOptions, setHeaderOptions }) => { localStorage.setItem("dashboard", page); }, [page]); - - return isMobile ? ( -
+
+ + + +
) : (
diff --git a/src/views/Dashboard/layouts/Mobile/List.js b/src/views/Dashboard/layouts/Mobile/List.js new file mode 100644 index 0000000..8cdb123 --- /dev/null +++ b/src/views/Dashboard/layouts/Mobile/List.js @@ -0,0 +1,82 @@ +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: , + name: "اطلاعات حساب کاربری", + link: "/CreateAddress", + }, + { + icon: , + name: "سفارشات", + link: "/Orders", + }, + { + icon: , + name: "کتاب‌های من", + link: "/AR", + }, + { + icon: , + name: "دوره‌های من", + link: "#", + }, + { + icon: , + name: "لیست علاقه‌مندی‌ها", + link: "/ProfileBookmark", + }, + { + icon: , + name: "آدرس‌ها", + link: "/ProfileAddress", + }, + ]; + + return ( +
+ {pages.map((page, index) => ( + +
+ {page.icon} + + {page.name} + +
+ + + + + ))} +
+ ); +}; + +const mapStateToProps = (state) => ({ + mobile: state.publicApi.mobile, +}); + +export default connect(mapStateToProps)(List); diff --git a/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js b/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js new file mode 100644 index 0000000..da5ed4f --- /dev/null +++ b/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js @@ -0,0 +1,311 @@ +import { + View, + Text, + Pressable, + TouchableOpacity, + Appearance, + ActivityIndicator, + SafeAreaView, + ScrollView, + StyleSheet, + Platform, + Dimensions, + StatusBar, +} from "react-native"; +import React from "react"; +import { connect } from "react-redux"; +import { useNavigation } from "@react-navigation/native"; +import { userAddress, userFactor } from "../../../../redux/actions"; +import Svg, { G, Path } from "react-native-svg"; + +//components +import Navbar from "../../../../components/Navbar"; +import CustomPressable from "../../../../components/Pressable"; +import Empty from "../../../../components/Empty"; + +//style +import tw from "tailwind-rn"; +import Colors from "../../../../constants/Colors"; +import fontSize from "../../../../constants/fontSize"; + +const { height, width } = Dimensions.get("window"); +const ios = Platform.OS === "ios"; + +const ProfileAddress = ({ + addresses, + update, + getList, + userId, + userAddressId, + getFactorInfo, + loading, + closeBottomSheet, + mobile, +}) => { + const colorScheme = Appearance.getColorScheme(); + const navigation = useNavigation(); + const [height, setHeight] = React.useState(Dimensions.get("window").height); + const Location = ({ address, active }) => { + return ( + + userAddressId === address?.id + ? {} + : update({ userAddressId: address.id, userId }) + } + > + + {active && ( + + + + آدرس انتخابی شما + + + فعال + + + + + + + + + + )} + + + + {"آدرس:" + " " + address.address} + + + {"نام:" + " " + address.firstName + " " + address.lastName} + + + {"کد پستی:" + " " + address.postalCode} + + + {"شماره تماس:" + " " + address.cellphone} + + + {!active && ( + + + + + + + )} + + + {}} + /> + + + ); + }; + + React.useEffect(() => { + getFactorInfo({ userId }); + getList(); + }, []); + + return ( + + + {addresses.length > 0 ? ( + setHeight(Dimensions.get("window").height)} + > + + + {addresses.map((address, index) => ( + + ))} + + + + ) : ( + + )} + + navigation.push("CreateAddress")} + > + + یک آدرس جدید اضافه کنید + + + + + + + + + ); +}; + +const mapStateToProps = (state) => ({ + userId: state.user.status?.id, + userAddressId: state.userFactor.info?.userAddressId, + loading: state.userFactor.loading, + addresses: state.userAddress.list, + mobile: state.publicApi.mobile, +}); + +const mapDispatchToProps = { + getFactorInfo: userFactor.info, + update: userFactor.update, + getList: userAddress.list, +}; + +export default connect(mapStateToProps, mapDispatchToProps)(ProfileAddress); + +const styles = StyleSheet.create({ + contentContainerStyle: { + paddingBottom: 100, + position: "relative", + }, + container: { + backgroundColor: "white", + flexDirection: "column", + paddingVertical: 0, + paddingHorizontal: 0, + }, +}); diff --git a/src/views/Dashboard/layouts/Mobile/ProfileBookmark/index.js b/src/views/Dashboard/layouts/Mobile/ProfileBookmark/index.js new file mode 100644 index 0000000..5ae16a6 --- /dev/null +++ b/src/views/Dashboard/layouts/Mobile/ProfileBookmark/index.js @@ -0,0 +1,182 @@ +import { + View, + Text, + Pressable, + Appearance, + SafeAreaView, + ScrollView, + StyleSheet, + Platform, + Dimensions, + StatusBar, + Image, + mobile, +} from "react-native"; +import React from "react"; +import { connect } from "react-redux"; +import { useNavigation } from "@react-navigation/native"; +import Svg, { Path } from "react-native-svg"; +import { userFavorite } from "../../../../redux/actions"; + +//components +import Navbar from "../../../../components/Navbar"; +import Empty from "../../../../components/Empty"; + +//style +import tw from "tailwind-rn"; +import Colors from "../../../../constants/Colors"; +import fontSize from "../../../../constants/fontSize"; + +//assets +import bookImage from "../../..//OrdersFollowUp/assets/b1.png"; + +const { height, width } = Dimensions.get("window"); +const ios = Platform.OS === "ios"; + +const ProfileBookmark = ({ bookmarkList, getList }) => { + React.useEffect(() => { + getList(); + }, []); + + return ( + + + {bookmarkList?.length > 0 ? ( + + + + {bookmarkList?.map((bookmark, index) => ( + + ))} + + + + ) : ( + + )} + + ); +}; + +const Bookmark = ({ bookmark }) => { + const colorScheme = Appearance.getColorScheme(); + + return ( + + + + + + {bookmark.name} + + + {bookmark.grade} + + + + + + + + + ); +}; + +const mapStateToProps = (state) => ({ + loading: state.userFactor.loading, + mobile: state.publicApi.mobile, + bookmarkList: state.userFavorite.list, +}); + +const mapDispatchToProps = { + getList: userFavorite.list, +}; + +export default connect(mapStateToProps, mapDispatchToProps)(ProfileBookmark); + +const styles = StyleSheet.create({ + contentContainerStyle: { + paddingBottom: 100, + position: "relative", + }, + container: { + backgroundColor: "white", + flexDirection: "column", + paddingVertical: 0, + paddingHorizontal: 0, + }, +}); + +// ProfileBookmark.defaultProps = { +// bookmarkList: [ +// { +// name: "کتاب آموزشی علوم تجربی", +// grade: "پایه ششم ابتدایی", +// image: bookImage, +// }, +// ], +// }; diff --git a/src/views/Dashboard/layouts/Mobile/Trophy.js b/src/views/Dashboard/layouts/Mobile/Trophy.js new file mode 100644 index 0000000..8510991 --- /dev/null +++ b/src/views/Dashboard/layouts/Mobile/Trophy.js @@ -0,0 +1,54 @@ +import React from "react"; +import { connect } from "react-redux"; +import { Link } from "react-router-dom"; + +const Trophy = ({}) => { + const [dropdown, setDropdown] = React.useState(true); + return ( +
+
+ + + + + + + + + + {"امتیاز شما" + " " + 14560} + +
+ + مشاهده جوایز + +
+ ); +}; + +const mapStateToProps = (state) => ({}); + +export default connect(mapStateToProps)(Trophy); diff --git a/src/views/Dashboard/layouts/Mobile/User.js b/src/views/Dashboard/layouts/Mobile/User.js new file mode 100644 index 0000000..f20bb9d --- /dev/null +++ b/src/views/Dashboard/layouts/Mobile/User.js @@ -0,0 +1,72 @@ +import React from "react"; +import { connect } from "react-redux"; + +const User = ({ user, mobile }) => { + const [dropdown, setDropdown] = React.useState(true); + return ( +
+ +
+
+ + افزودن حساب کاربری جدید + + + +
+
+
+ ); +}; + +const mapStateToProps = (state) => ({ + user: state.user.status, + mobile: state.publicApi.mobile, +}); + +export default connect(mapStateToProps)(User); diff --git a/src/views/Product/Desktop/ProductOverAll/index.js b/src/views/Product/Desktop/ProductOverAll/index.js index 10dda72..66aa50a 100644 --- a/src/views/Product/Desktop/ProductOverAll/index.js +++ b/src/views/Product/Desktop/ProductOverAll/index.js @@ -77,7 +77,13 @@ export const ProductOverAll = ({ book, grades, isDark, loading }) => { radius={false} twPaddings="py-4 px-12" /> -
diff --git a/src/views/Product/index.js b/src/views/Product/index.js index c7dc34b..606b873 100644 --- a/src/views/Product/index.js +++ b/src/views/Product/index.js @@ -114,7 +114,7 @@ export const Product = ({ onClick={() => setType("digital")} />
-
+
{}, []); -export const Profile = ({}) => { return ( -
Profile
- ) +
+ + + +
+ ); } -const mapStateToProps = (state) => ({}) +const mapStateToProps = (state) => ({}); -const mapDispatchToProps = {} +const mapDispatchToProps = {}; -export default connect(mapStateToProps, mapDispatchToProps)(Profile) \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(Profile); \ No newline at end of file