reza added some change

master
Reza_ashrafi 3 years ago
parent 8e99adb956
commit 00fc4e93ed
  1. 84
      navigation/index.js
  2. 11
      navigation/vuesax-linear-bag-2.svg
  3. 1
      src/components/Navbar.js
  4. 4
      src/components/Pressable.js
  5. 2
      src/screens/AR/components/Book.js
  6. 2
      src/screens/Address/index.js
  7. 14
      src/screens/DeliveryForm/Address/index.js
  8. 31
      src/screens/DeliveryForm/TransportDate/index.js
  9. 43
      src/screens/DeliveryForm/TransportMethod/index.js
  10. 11
      src/screens/Home/components/Blogs.js
  11. 33
      src/screens/Home/components/MyBooks.js
  12. 8
      src/screens/Home/components/Scroll.js
  13. 22
      src/screens/Home/components/Videos.js
  14. 16
      src/screens/Home/index.js
  15. 4
      src/screens/Login/index.js
  16. 2
      src/screens/Otp/index.js
  17. 16
      src/screens/Profile/components/ProfileAddress/index.js
  18. 8
      src/screens/Profile/components/Trophy.js
  19. 42
      src/screens/Profile/components/User.js
  20. 25
      src/screens/ShoppingCart/components/Code.js
  21. 4
      src/screens/ShoppingCart/components/Product.js
  22. 6
      src/screens/ShoppingCart/index.js
  23. 43
      src/screens/Splash/index.js

@ -1,8 +1,8 @@
import React, { useEffect } from "react";
import * as Linking from 'expo-linking';
import * as Linking from "expo-linking";
import Svg, { G, Path } from "react-native-svg";
import { Appearance, Platform, Dimensions } from "react-native";
import {Entypo} from '@expo/vector-icons';
import { Entypo } from "@expo/vector-icons";
import { NavigationContainer, DefaultTheme } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
@ -46,7 +46,7 @@ const ios = Platform.OS === "ios";
const colorScheme = Appearance.getColorScheme();
const Tab = createBottomTabNavigator();
const BottomTabNavigator = () => {
const BottomTabNavigator = ({}) => {
const [headerShown, setHeaderShown] = React.useState(true);
React.useEffect(() => {
setTimeout(() => {
@ -62,8 +62,7 @@ const BottomTabNavigator = () => {
contentStyle: {
backgroundColor: "white",
},
tabBarIconStyle : {
},
tabBarIconStyle: {},
tabBarLabelPosition: "below-icon",
tabBarActiveTintColor: Colors.theme1[colorScheme].green79,
tabBarInactiveTintColor: "grey",
@ -127,60 +126,55 @@ const BottomTabNavigator = () => {
name="ShoppingCartTab"
component={CARTStackScreen}
options={{
// tabBarBadge: count,
// tabBarBadgeStyle: {
// color: "white",
// backgroundColor: Colors.theme1[colorScheme].green79,
// fontSize: fontSize.sm,
// },
title: "سبد خرید",
tabBarIcon: ({ focused, color }) =>
focused ? (
<Svg
xmlns="http://www.w3.org/2000/svg"
width={33.323}
height={32.317}
width={31.017}
height={31.017}
>
<Path
d="M20.852 29.624h-8.381c-6.984 0-9.778-2.693-9.778-9.426v-8.079c0-6.733 2.794-9.426 9.778-9.426h8.381c6.984 0 9.778 2.693 9.778 9.426v8.079c-.001 6.733-2.794 9.426-9.778 9.426Z"
<G
fill={Colors.theme1[colorScheme].green79}
/>
<Path
data-name="Vector"
d="M16.002 11.957H8.933M21.063 11.951l.9 1.01 2.684-3.03M16.002 21.383H8.933M21.063 21.377l.9 1.01 2.684-3.03"
fill="none"
stroke="#fff"
stroke={"white"}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
data-name="vuesax/linear/bag-2"
>
<Path d="M9.693 9.912V8.659a6.168 6.168 0 0 1 5.247-6.036 5.816 5.816 0 0 1 6.384 5.79v1.782" />
<Path
data-name="Vector"
d="M11.631 28.433h7.754c5.2 0 6.126-2.081 6.4-4.614l.969-7.754c.345-3.154-.555-5.726-6.076-5.726H10.339c-5.519 0-6.423 2.572-6.074 5.725l.969 7.754c.271 2.534 1.202 4.615 6.397 4.615ZM20.027 15.509h.011M10.979 15.509h.011"
/>
</G>
</Svg>
) : (
<Svg
xmlns="http://www.w3.org/2000/svg"
width={33.323}
height={32.317}
width={31.017}
height={31.017}
>
<Path
d="M16.002 11.957H8.933"
fill="none"
stroke={Colors.theme1[colorScheme].green79}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="m21.063 11.951.9 1.01 2.684-3.03M16.002 21.383H8.933M21.063 21.377l.9 1.01 2.684-3.03"
<G
fill="none"
stroke={Colors.theme1[colorScheme].green79}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
data-name="vuesax/linear/bag-2"
>
<Path d="M9.693 9.912V8.659a6.168 6.168 0 0 1 5.247-6.036 5.816 5.816 0 0 1 6.384 5.79v1.782" />
<Path
data-name="Vector"
d="M20.852 29.624h-8.381c-6.984 0-9.778-2.693-9.778-9.426v-8.079c0-6.733 2.794-9.426 9.778-9.426h8.381c6.984 0 9.778 2.693 9.778 9.426v8.079c-.001 6.733-2.794 9.426-9.778 9.426Z"
fill="none"
stroke={Colors.theme1[colorScheme].green79}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M11.631 28.433h7.754c5.2 0 6.126-2.081 6.4-4.614l.969-7.754c.345-3.154-.555-5.726-6.076-5.726H10.339c-5.519 0-6.423 2.572-6.074 5.725l.969 7.754c.271 2.534 1.202 4.615 6.397 4.615ZM20.027 15.509h.011M10.979 15.509h.011"
/>
</G>
</Svg>
),
}}
@ -433,10 +427,10 @@ const PROFILEStackScreen = () => {
);
};
const prefix = Linking.createURL('/')
const prefix = Linking.createURL("/");
const Stack = createNativeStackNavigator();
const Navigation = ({ getStatus, isLogin }) => {
const Navigation = ({ getStatus, isLogin, userProducts }) => {
const linking = {
prefixes: [prefix],
};
@ -453,11 +447,20 @@ const Navigation = ({ getStatus, isLogin }) => {
contentStyle: { backgroundColor: Colors.theme1[colorScheme].white },
}}
>
{/* <Stack.Screen name="Splash" component={Splash} /> */}
{/* <Stack.Screen name="Login" component={Login} /> */}
<Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Otp" component={Otp} />
<Stack.Screen name="QR" component={QR} />
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen
name="Root"
component={
BottomTabNavigator
// count={
// userProducts.filter((product) => product.condition < 2)
// .length
// }
}
/>
<Stack.Screen name="Orders" component={OrdersFollowUp} />
<Stack.Screen name="Order" component={OrderDetails} />
<Stack.Screen name="Faq" component={Faq} />
@ -475,6 +478,7 @@ const Navigation = ({ getStatus, isLogin }) => {
const mapStateToProps = (state) => ({
isLogin: state.user.status,
userProducts: state.userProduct.list,
});
const mapDispatchToProps = {
getStatus: user.getStatus,

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="31.017" height="31.017" viewBox="0 0 31.017 31.017">
<g id="vuesax_linear_bag-2" data-name="vuesax/linear/bag-2" transform="translate(-556 -188)">
<g id="bag-2" transform="translate(556 188)">
<path id="Vector" d="M0,7.317V6.064A6.168,6.168,0,0,1,5.247.028a5.816,5.816,0,0,1,6.384,5.79V7.6" transform="translate(9.693 2.595)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M7.432,18.094h7.754c5.2,0,6.126-2.081,6.4-4.614l.969-7.754C22.9,2.572,22,0,16.479,0H6.14C.621,0-.283,2.572.066,5.725l.969,7.754C1.306,16.013,2.237,18.094,7.432,18.094Z" transform="translate(4.199 10.339)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-3" data-name="Vector" d="M.495.5H.506" transform="translate(19.532 15.009)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-4" data-name="Vector" d="M.495.5H.506" transform="translate(10.484 15.009)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-5" data-name="Vector" d="M0,0H31.017V31.017H0Z" fill="none" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -218,7 +218,6 @@ const Navbar = ({ notification, setBoxPosition, headerOptions }) => {
transform="translate(15 19)"
fontSize={14}
// fontFamily="regular"
fontWeight={300}
>
<TSpan x={-8.841} y={0}>
{"AR"}

@ -20,7 +20,7 @@ function Pressable1({
<TouchableOpacity
onPress={() => onPress()}
style={[
tw("rounded-md py-3 flex flex-row justify-center mb-3"),
tw("rounded-sm py-3 flex flex-row justify-center mb-3"),
{
backgroundColor: backgroundColor,
borderWidth: border.width,
@ -33,7 +33,7 @@ function Pressable1({
<ActivityIndicator size="small" color={color} />
) : (
<Text
style={{ fontSize: mobile ? fontSize.lg : fontSize.xl, color: color, fontFamily: "bold" }}
style={{ fontSize: mobile ? fontSize.tiny : fontSize.xl, color: color, fontFamily: "bold" }}
>
{title}
</Text>

@ -36,7 +36,7 @@ const Book = ({ book, mobile }) => {
style={[
{
fontFamily: "bold",
fontSize: fontSize.lg,
fontSize: fontSize.tiny,
marginTop: 10,
color: Colors.theme1[colorScheme].green79,
},

@ -316,6 +316,7 @@ const Address = ({
regex={onInput.numberOnly}
/>
)}
<View style={tw("mt-4")}></View>
<Header
title="شماره تماس"
text="( شماره موبایل و شماره تلفن ثابت خود را
@ -353,6 +354,7 @@ const Address = ({
autoFocus={false}
regex={onInput.phonenumber}
/>
<View style={tw("mt-4")}></View>
<Header
title="آدرس"
text="( لطفا نام استان و شهرستان و آدرس

@ -32,14 +32,14 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44",
borderWidth: 2,
borderWidth: 1.5,
borderColor:
userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3,
},
tw(
`flex flex-row-reverse items-center w-full px-3 rounded-md mt-2 ${mobile ? "py-2" : "py-4"}`
`flex flex-row-reverse items-center w-full px-3 rounded-sm mt-2 ${mobile ? "py-2" : "py-4"}`
),
]}
onPress={() =>
@ -74,8 +74,8 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
<Text
style={[
{
fontFamily: "bold",
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 22,
textAlign: ios ? "right" : "auto",
},
@ -104,10 +104,10 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
{
backgroundColor: Colors.theme1[colorScheme].grayE3 + "44",
borderColor: Colors.theme1[colorScheme].gray2077 + '55',
borderWidth: 1,
borderWidth: 1.5,
},
tw(
`flex flex-row-reverse justify-center py-3 rounded-md items-center w-full mt-4`
`flex flex-row-reverse justify-center py-3 rounded-sm items-center w-full mt-4`
),
]}
onPress={() => navigation.push("CreateAddress")}
@ -115,7 +115,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
<Text
style={{
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].gray2077,
}}
>

@ -17,12 +17,12 @@ const TransportDate = ({ transportDate, mobile }) => {
return (
<Pressable
style={[
tw(`flex flex-col items-center w-full px-2 ${mobile ? "py-1.5" : "py-2"} rounded-md mt-3`),
tw(`flex flex-row-reverse justify-between items-center w-full px-3 ${mobile ? "py-3" : "py-2"} rounded-sm mt-3`),
{
backgroundColor: active
? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44",
borderWidth: 2,
borderWidth: 1.5,
borderColor: active
? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3,
@ -32,8 +32,8 @@ const TransportDate = ({ transportDate, mobile }) => {
>
<Text
style={{
fontFamily: "bold",
fontSize: mobile ? fontSize.lg : fontSize.xl,
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl,
color: active
? Colors.theme1[colorScheme].gray20
: Colors.theme1[colorScheme].gray20,
@ -41,10 +41,22 @@ const TransportDate = ({ transportDate, mobile }) => {
>
{time.time}
</Text>
<View style={tw("flex flex-row-reverse items-center")}>
<View
style={[
tw(`${active ? "bg-green-600" : "bg-gray-600"}`),
{
height: fontSize.base + 10,
width: 1,
marginLeft: 10,
},
]}
></View>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.base,
color: active
? Colors.theme1[colorScheme].green20
: Colors.theme1[colorScheme].gray20,
@ -52,15 +64,16 @@ const TransportDate = ({ transportDate, mobile }) => {
>
تکمیل ظرفیت
</Text>
</View>
</Pressable>
);
}, []);
return (
<View style={tw(`w-full ${mobile ? "mt-0" : "mt-4"}`)}>
<View style={tw(`w-full ${mobile ? "mt-4" : "mt-4"}`)}>
<Text
style={{
fontSize: mobile ? fontSize.lg : fontSize.xl2,
fontFamily: "demi",
fontSize: mobile ? fontSize.base : fontSize.xl2,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
textAlign : ios ? "right" : "auto",
}}

@ -5,7 +5,7 @@ import {
TouchableOpacity,
Appearance,
ActivityIndicator,
Platform
Platform,
} from "react-native";
import React, { useEffect, useCallback } from "react";
import { connect } from "react-redux";
@ -18,7 +18,6 @@ import tw from "tailwind-rn";
import Colors from "../../../constants/Colors";
import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios";
const TransportMethod = ({
@ -28,7 +27,7 @@ const TransportMethod = ({
factorInfo,
userId,
loading,
mobile
mobile,
}) => {
const colorScheme = Appearance.getColorScheme();
@ -41,12 +40,16 @@ const TransportMethod = ({
return (
<Pressable
style={[
tw(`flex flex-col items-center w-full px-2 rounded-md mt-3 ${mobile ? "py-1.5" : "py-2"}`),
tw(
`flex flex-row-reverse justify-between items-center w-full px-3 rounded-sm mt-3 ${
mobile ? "py-3" : "py-2"
}`
),
{
backgroundColor: active
? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44",
borderWidth: 2,
borderWidth: 1.5,
borderColor: active
? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3,
@ -74,8 +77,8 @@ const TransportMethod = ({
) : (
<Text
style={{
fontFamily: "bold",
fontSize: mobile ? fontSize.lg : fontSize.xl2,
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl2,
color: active
? Colors.theme1[colorScheme].gray20
: Colors.theme1[colorScheme].gray20,
@ -84,28 +87,40 @@ const TransportMethod = ({
{method.name}
</Text>
)}
<View style={tw("flex flex-row-reverse items-center")}>
<View
style={[
tw(`${active ? "bg-green-600" : "bg-gray-600"}`),
{
height: fontSize.base + 10,
width: 1,
marginLeft: 10,
},
]}
></View>
<Text
style={{
fontFamily: "bold",
fontSize: mobile ? fontSize.sm : fontSize.base,
fontFamily: "regular",
fontSize: mobile ? fontSize.base : fontSize.base,
color: active
? Colors.theme1[colorScheme].green20
: Colors.theme1[colorScheme].gray20,
}}
>
هزینه ارسال {separate(method.price)}
{separate(method.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
);
},
[factorInfo, loading]
);
return (
<View style={tw(`w-full ${mobile ? "mt-0" : "mt-4"}`)}>
<View style={tw(`w-full ${mobile ? "mt-4" : "mt-4"}`)}>
<Text
style={{
fontSize: mobile ? fontSize.lg : fontSize.xl,
fontFamily: "demi",
fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
textAlign: ios ? "right" : "auto",
}}
@ -130,7 +145,7 @@ const mapStateToProps = (state) => ({
factorInfo: state.userFactor.info,
userId: state.user.status?.id,
loading: state.userFactor.loading,
mobile: state.publicApi.mobile
mobile: state.publicApi.mobile,
});
const mapDispatchToProps = {

@ -34,26 +34,27 @@ function Blogs({ blogs, mobile }) {
<Pressable
style={[
tw("rounded-md ml-3 rounded-md relative"),
{ width: mobile ? width / 1.5 : width / 2.2 },
{ width: mobile ? 250 : width / 2.2 },
]}
// onPress={() => navigation.navigate('Product')}
>
<Image
source={{ uri: `https://dnvn.ir/api/v1/file/${blog.fileIds}` }}
resizeMode="contain"
style={[
tw("rounded-md"),
{
width: "100%",
height: ((mobile ? width / 1.5 : width / 2.2) * 9) / 16,
flex: 1,
height: mobile ? 180 : width / 2.2 * 9 / 16,
},
]}
/>
<View
style={[
{ transform: [{ translateY: -20 }], marginHorizontal: 10 },
{ transform: [{ translateY: -40 }], marginHorizontal: 10 },
tw("flex flex-col justify-between bg-white rounded-md p-2"),
{
shadowColor: "#000",
shadowColor: "#00000055",
shadowOffset: { width: 0, height: 1 },
shadowOpacity: 0.8,
shadowRadius: 2,

@ -7,17 +7,16 @@ import {
Appearance,
Platform,
} from "react-native";
import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
import { useNavigation } from "@react-navigation/native";
import { connect } from "react-redux";
import Progress from "../../../components/Progress";
//assets
//components
import Progress from "../../../components/Progress";
//Color
import Color from "../../../constants/Colors";
import Colors from "../../../constants/Colors";
import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios";
@ -31,25 +30,27 @@ function MyBooks({ books, grades }) {
style={tw(`flex flex-col ml-3 ${ios ? "items-end" : ""}`)}
onPress={() => {}}
>
<View style={{ height: 165 }}>
<Image
source={{
uri: `https://dnvn.ir/api/v1/file/${book.product.book.fileIds}`,
}}
resizeMode="contain"
style={[
tw("rounded-md"),
{
minHeight: 160,
minWidth: 110,
width: 110,
flex: 1,
},
]}
/>
</View>
<Text
style={[
tw("mt-2 pr-1"),
{
color: Colors.theme1[colorScheme].gray20,
fontFamily: "bold",
fontSize: fontSize.base,
fontSize: fontSize.sm,
},
]}
>
@ -61,7 +62,7 @@ function MyBooks({ books, grades }) {
{
color: Colors.theme1[colorScheme].gray20,
fontFamily: "light",
fontSize: fontSize.tiny,
fontSize: fontSize.sm,
},
]}
>
@ -78,8 +79,8 @@ function MyBooks({ books, grades }) {
style={[
tw(`w-full flex flex-col rounded-md pt-3 px-2 overflow-hidden`),
{
backgroundColor: Color.theme1[colorScheme].greenCF + "0F",
borderColor: Color.theme1[colorScheme].greenD9 + "",
backgroundColor: Colors.theme1[colorScheme].greenCF + "0F",
borderColor: Colors.theme1[colorScheme].greenD9 + "",
borderWidth: 1,
},
]}
@ -88,9 +89,9 @@ function MyBooks({ books, grades }) {
style={[
tw(`${ios ? "text-right" : ""} w-full`),
{
color: Color.theme1[colorScheme].green79,
fontFamily: "bold",
fontSize: fontSize.xl,
color: Colors.theme1[colorScheme].green79,
fontFamily: "demi",
fontSize: fontSize.lg,
},
]}
>

@ -25,17 +25,15 @@ function Scroll({ books, mobile }) {
navigation.navigate("Product", { id: book?.id, type: "book" })
}
style={[
tw("rounded-md mx-1 overflow-hidden rounded-md"),
tw("mx-1 overflow-hidden"),
{
width: position === 0 ? mobile ? 163 : 240 : mobile ? 79 : 125,
width: position === 0 ? mobile ? 163 : 240 : mobile ? 84 : 125,
height: position === 0 ? mobile ? 245 : 350 : mobile ? 118 : 170,
},
]}
onPress={() =>
navigation.navigate("Product", { id: book.id, type: "book" })
}
>
<Image
resizeMode="contain"
source={{ uri: `https://dnvn.ir/api/v1/file/${book.fileIds}` }}
style={{ width: "100%", height: "100%" }}
/>

@ -5,7 +5,7 @@ import {
Pressable,
FlatList,
Appearance,
Platform
Platform,
} from "react-native";
import { useNavigation } from "@react-navigation/native";
import tw from "tailwind-rn";
@ -27,22 +27,24 @@ function Videos({ videos, grades, mobile }) {
const navigation = useNavigation();
return (
<Pressable
style={tw(`flex flex-col ${mobile ? "ml-3" : "ml-5"}`)}
style={[
tw(`flex flex-col relative ${mobile ? "ml-3" : "ml-5"}`),
{ width: mobile ? 130 : 200, height: mobile ? 280 : 280 },
]}
onPress={() => navigation.navigate("Video", { id: video.id })}
>
<Image
source={{ uri: `https://dnvn.ir/api/v1/file/${video.fileIds}` }}
resizeMode="contain"
style={[
tw("rounded-md"),
{
height: mobile ? 160 : 280,
width: mobile ? 110 : 200,
height: mobile ? 184 : 280,
},
]}
/>
<Text
style={[
tw("mt-2 pr-1"),
tw("mt-2 px-1"),
{
color: Colors.theme1[colorScheme].gray20,
fontFamily: "bold",
@ -51,7 +53,7 @@ function Videos({ videos, grades, mobile }) {
},
]}
>
{'دوره ویدئویی' + ' ' + video.name}
{"دوره ویدئویی" + " " + video.name}
</Text>
<Text
style={[
@ -64,9 +66,11 @@ function Videos({ videos, grades, mobile }) {
},
]}
>
{'پایه' + ' ' + grades[video.gradeId]}
{"پایه" + " " + grades[video.gradeId]}
</Text>
<View style={tw("absolute bottom-0 left-0 w-full")}>
<Progress percent={60} alignItems={"items-end"} />
</View>
</Pressable>
);
};
@ -94,7 +98,7 @@ function Videos({ videos, grades, mobile }) {
const mapStateToProps = (state) => ({
grades: state.publicApi.grades,
mobile : state.publicApi.mobile
mobile: state.publicApi.mobile,
});
export default connect(mapStateToProps, {})(Videos);

@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
import { blog, book, userProduct } from "../../redux/actions";
import {
View,
StyleSheet,
@ -27,21 +26,12 @@ import tw from "tailwind-rn";
// Within your render function
const Home = ({
blogs,
getBlogs,
books,
getBooks,
userProducts,
getUserProducts,
mobile,
}) => {
const [position, setPosition] = useState("100%");
useEffect(() => {
getBlogs();
getBooks({ vod: true });
getUserProducts();
}, []);
const setBoxPosition = () => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setPosition(position === "100%" ? "0%" : "100%");
@ -74,7 +64,7 @@ const Home = ({
style={[styles.container]}
>
{!mobile && <View style={tw("mt-5")}></View>}
{userProduct?.length > 0 && <MyBooks books={userProducts} />}
{userProducts?.length > 0 && <MyBooks books={userProducts} />}
<View style={tw("px-4 w-full")}>
<Header title={"فروشگاه"} route={"Products"} />
</View>
@ -109,9 +99,7 @@ const mapStateToProps = (state) => ({
});
const mapDispatchToProps = {
getBlogs: blog.list,
getBooks: book.list,
getUserProducts: userProduct.list,
// getVideos: product.listVOD
};

@ -161,8 +161,8 @@ function Login(props) {
<Text
style={{
color: "white",
fontSize: fontSize.xl,
fontWeight: "regular",
fontSize: fontSize.lg,
fontFamily: "regular",
}}
>
{"تایید شماره"}

@ -281,7 +281,7 @@ function Otp(props) {
<Text
style={{
color: "white",
fontSize: fontSize.xl,
fontSize: fontSize.lg,
fontFamily: "regular",
}}
>

@ -77,7 +77,7 @@ const ProfileAddress = ({
<View style={tw("flex flex-row-reverse items-center")}>
<Text
style={{
fontSize: fontSize.xl,
fontSize: fontSize.base,
fontFamily: "bold",
color: Colors.theme1[colorScheme].gray20,
}}
@ -86,7 +86,7 @@ const ProfileAddress = ({
</Text>
<Text
style={{
fontSize: fontSize.sm,
fontSize: fontSize.xs,
fontFamily: "regular",
color: Colors.theme1[colorScheme].gray20,
marginRight: 10,
@ -116,7 +116,7 @@ const ProfileAddress = ({
style={[
{
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 22,
textAlign: ios ? "right" : "auto",
},
@ -129,7 +129,7 @@ const ProfileAddress = ({
{
marginTop: mobile ? 4 : 8,
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 22,
textAlign: ios ? "right" : "auto",
},
@ -142,7 +142,7 @@ const ProfileAddress = ({
{
marginTop: mobile ? 4 : 8,
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 22,
textAlign: ios ? "right" : "auto",
},
@ -155,7 +155,7 @@ const ProfileAddress = ({
{
marginTop: mobile ? 4 : 8,
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 22,
textAlign: ios ? "right" : "auto",
},
@ -249,7 +249,7 @@ const ProfileAddress = ({
borderWidth: 1.5,
},
tw(
`flex flex-row-reverse self-end justify-center py-3 rounded-md items-center mt-4 w-full`
`flex flex-row-reverse self-end justify-center py-2 rounded-md items-center mt-4 w-full`
),
]}
onPress={() => navigation.push("CreateAddress")}
@ -257,7 +257,7 @@ const ProfileAddress = ({
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.lg,
fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].greenCF,
}}
>

@ -17,7 +17,7 @@ const Trophy = ({}) => {
<View
style={[
tw(
`w-full flex py-4 px-3 justify-between flex-row-reverse`
`w-full flex py-3 px-3 justify-between flex-row-reverse`
),
{ backgroundColor: Colors.theme1[colorScheme].yellow2 },
]}
@ -54,8 +54,8 @@ const Trophy = ({}) => {
</Svg>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.lg,
fontFamily: "regular",
fontSize: fontSize.tiny,
marginRight: 10,
color: Colors.theme1[colorScheme].green79,
}}
@ -67,7 +67,7 @@ const Trophy = ({}) => {
<Text
style={{
fontFamily: "light",
fontSize: fontSize.tiny,
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
}}
>

@ -93,47 +93,7 @@ const User = ({ user, mobile }) => {
}`
)}
>
<View
style={[
tw(`flex items-center w-full pb-3 mb-4 flex-row-reverse`),
{
borderBottomWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3,
},
]}
>
{user?.picFileIds ? (
<Image
source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }}
style={[
tw("rounded-full"),
{ width: mobile ? 30 : 60, height: mobile ? 30 : 60 },
]}
/>
) : (
<View
style={[
tw("rounded-full"),
{
width: mobile ? 30 : 60,
height: mobile ? 30 : 60,
zIndex: 1,
backgroundColor: "#ddd",
},
]}
></View>
)}
<Text
style={{
fontSize: mobile ? fontSize.base : fontSize.xl,
color: Colors.theme1[colorScheme].gray20,
fontFamily: "bold",
marginRight: 5,
}}
>
{user?.firstName + " " + user?.lastName}
</Text>
</View>
<View
style={[
tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse`),

@ -6,14 +6,14 @@ import {
TextInput,
Dimensions,
KeyboardAvoidingView,
Appearance
Appearance,
} from "react-native";
import { connect } from "react-redux";
import { userFactor } from "../../../redux/actions";
//style
import fontSize from '../../../constants/fontSize';
import Colors from '../../../constants/Colors';
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
import tw from "tailwind-rn";
function Code({ codeId, setCodeId, userId, factorId }) {
@ -30,18 +30,19 @@ function Code({ codeId, setCodeId, userId, factorId }) {
style={tw("flex w-full flex-col items-end mt-5 overflow-hidden")}
>
<View
style={[tw(
"flex w-full flex-row-reverse rounded-md mt-3"
), {borderWidth : 1, borderColor : Colors.theme1[colorScheme].greenCF }]}
style={[
tw("flex w-full flex-row-reverse rounded-sm mt-3"),
{ borderWidth: 1.5, borderColor: Colors.theme1[colorScheme].greenCF },
]}
>
<TextInput
onChaneText={(text) => setValue(text)}
style={[
tw("border-0 flex-1 text-right pr-4"),
{ fontSize: fontSize.lg, fontFamily: "regular" },
tw("border-0 flex-1 text-right pr-3"),
{ fontSize: fontSize.tiny, fontFamily: "regular" },
]}
placeholder={"کد تخفیف دارید ؟"}
placeholderTextColor={Colors.theme1[colorScheme].gray20}
placeholderTextColor={Colors.theme1[colorScheme].gray20 + 'aa'}
/>
<Pressable
onClick={() => setOff()}
@ -49,15 +50,15 @@ function Code({ codeId, setCodeId, userId, factorId }) {
tw("py-3 px-5"),
{
backgroundColor: Colors.theme1[colorScheme].greenCF,
borderTopLeftRadius: 5,
borderBottomLeftRadius: 5,
borderTopLeftRadius: 1,
borderBottomLeftRadius: 1,
},
]}
>
<Text
style={[
tw("text-white"),
{ fontSize: fontSize.lg, fontFamily: "bold" },
{ fontSize: fontSize.tiny, fontFamily: "bold" },
]}
>
ثبت کد

@ -67,7 +67,7 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
</Text>
<Text
style={{
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].gray2077,
marginBottom: 3,
fontFamily: "regular",
@ -77,7 +77,7 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
</Text>
<Text
style={{
fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].gray2077,
fontFamily: "regular",
}}

@ -41,7 +41,7 @@ const PriceStatus = ({ name, value, type }) => {
style={[
tw(""),
{
fontSize: fontSize.lg,
fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].gray20,
fontFamily: "bold",
},
@ -103,7 +103,9 @@ function ShoppingCart({
.length !== 0;
useEffect(() => {
if(list.length === 0){
getList();
}
getFactorInfo({ userId });
}, []);
@ -178,7 +180,7 @@ function ShoppingCart({
style={[
{
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.xl,
fontSize: fontSize.base,
fontFamily: "bold",
},
]}

@ -1,21 +1,39 @@
import React, { useEffect } from "react";
import { View, Image, ActivityIndicator, Dimensions } from "react-native";
import { connect } from "react-redux";
import { blog, book, userProduct } from "../../redux/actions";
import Logo from "../../assets/images/logo.png";
const { width } = Dimensions.get("window");
function Splash({ navigation, isLogin }) {
function Splash({
navigation,
isLogin,
blogs,
getBlogs,
books,
getBooks,
userProducts,
getUserProducts,
}) {
useEffect(() => {
if (isLogin !== null) {
setTimeout(() => {
isLogin === false
? navigation.navigate("Login")
: navigation.navigate("Root");
}, 3000);
if (isLogin === false) {
navigation.navigate("Login");
} else {
if (blogs.length === 0) {
getBlogs();
} else if (books.length === 0) {
getBooks({ vod: true });
} else if (userProducts.length === 0) {
getUserProducts();
} else {
navigation.navigate("Root");
}
}, [isLogin]);
}
}
}, [isLogin, userProducts, books, blogs]);
return (
<View
@ -26,7 +44,7 @@ function Splash({ navigation, isLogin }) {
display: "flex",
}}
>
<View style={{ height: width * 0.7 * 2 / 3 }}>
<View style={{ height: (width * 0.7 * 2) / 3 }}>
<Image
source={Logo}
resizeMode="contain"
@ -44,8 +62,15 @@ function Splash({ navigation, isLogin }) {
const mapStateToProps = (state) => ({
isLogin: state.user.status,
blogs: state.blog.list,
books: state.book.list,
userProducts: state.userProduct.list,
});
const mapDispatchToProps = {};
const mapDispatchToProps = {
getBlogs: blog.list,
getBooks: book.list,
getUserProducts: userProduct.list,
};
export default connect(mapStateToProps, mapDispatchToProps)(Splash);

Loading…
Cancel
Save