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 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 Svg, { G, Path } from "react-native-svg";
import { Appearance, Platform, Dimensions } from "react-native"; 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 { NavigationContainer, DefaultTheme } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
@ -46,7 +46,7 @@ const ios = Platform.OS === "ios";
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const BottomTabNavigator = () => { const BottomTabNavigator = ({}) => {
const [headerShown, setHeaderShown] = React.useState(true); const [headerShown, setHeaderShown] = React.useState(true);
React.useEffect(() => { React.useEffect(() => {
setTimeout(() => { setTimeout(() => {
@ -62,8 +62,7 @@ const BottomTabNavigator = () => {
contentStyle: { contentStyle: {
backgroundColor: "white", backgroundColor: "white",
}, },
tabBarIconStyle : { tabBarIconStyle: {},
},
tabBarLabelPosition: "below-icon", tabBarLabelPosition: "below-icon",
tabBarActiveTintColor: Colors.theme1[colorScheme].green79, tabBarActiveTintColor: Colors.theme1[colorScheme].green79,
tabBarInactiveTintColor: "grey", tabBarInactiveTintColor: "grey",
@ -127,60 +126,55 @@ const BottomTabNavigator = () => {
name="ShoppingCartTab" name="ShoppingCartTab"
component={CARTStackScreen} component={CARTStackScreen}
options={{ options={{
// tabBarBadge: count,
// tabBarBadgeStyle: {
// color: "white",
// backgroundColor: Colors.theme1[colorScheme].green79,
// fontSize: fontSize.sm,
// },
title: "سبد خرید", title: "سبد خرید",
tabBarIcon: ({ focused, color }) => tabBarIcon: ({ focused, color }) =>
focused ? ( focused ? (
<Svg <Svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width={33.323} width={31.017}
height={32.317} height={31.017}
> >
<Path <G
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={Colors.theme1[colorScheme].green79} fill={Colors.theme1[colorScheme].green79}
/> stroke={"white"}
<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"
strokeLinecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
strokeWidth={1.5} 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>
) : ( ) : (
<Svg <Svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width={33.323} width={31.017}
height={32.317} height={31.017}
> >
<Path <G
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"
fill="none" fill="none"
stroke={Colors.theme1[colorScheme].green79} stroke={Colors.theme1[colorScheme].green79}
strokeLinecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
strokeWidth={1.5} 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 <Path
data-name="Vector" 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" 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"
fill="none"
stroke={Colors.theme1[colorScheme].green79}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/> />
</G>
</Svg> </Svg>
), ),
}} }}
@ -433,10 +427,10 @@ const PROFILEStackScreen = () => {
); );
}; };
const prefix = Linking.createURL('/') const prefix = Linking.createURL("/");
const Stack = createNativeStackNavigator(); const Stack = createNativeStackNavigator();
const Navigation = ({ getStatus, isLogin }) => { const Navigation = ({ getStatus, isLogin, userProducts }) => {
const linking = { const linking = {
prefixes: [prefix], prefixes: [prefix],
}; };
@ -453,11 +447,20 @@ const Navigation = ({ getStatus, isLogin }) => {
contentStyle: { backgroundColor: Colors.theme1[colorScheme].white }, contentStyle: { backgroundColor: Colors.theme1[colorScheme].white },
}} }}
> >
{/* <Stack.Screen name="Splash" component={Splash} /> */} <Stack.Screen name="Splash" component={Splash} />
{/* <Stack.Screen name="Login" component={Login} /> */} <Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Otp" component={Otp} /> <Stack.Screen name="Otp" component={Otp} />
<Stack.Screen name="QR" component={QR} /> <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="Orders" component={OrdersFollowUp} />
<Stack.Screen name="Order" component={OrderDetails} /> <Stack.Screen name="Order" component={OrderDetails} />
<Stack.Screen name="Faq" component={Faq} /> <Stack.Screen name="Faq" component={Faq} />
@ -475,6 +478,7 @@ const Navigation = ({ getStatus, isLogin }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isLogin: state.user.status, isLogin: state.user.status,
userProducts: state.userProduct.list,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
getStatus: user.getStatus, 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)" transform="translate(15 19)"
fontSize={14} fontSize={14}
// fontFamily="regular" // fontFamily="regular"
fontWeight={300}
> >
<TSpan x={-8.841} y={0}> <TSpan x={-8.841} y={0}>
{"AR"} {"AR"}

@ -20,7 +20,7 @@ function Pressable1({
<TouchableOpacity <TouchableOpacity
onPress={() => onPress()} onPress={() => onPress()}
style={[ 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, backgroundColor: backgroundColor,
borderWidth: border.width, borderWidth: border.width,
@ -33,7 +33,7 @@ function Pressable1({
<ActivityIndicator size="small" color={color} /> <ActivityIndicator size="small" color={color} />
) : ( ) : (
<Text <Text
style={{ fontSize: mobile ? fontSize.lg : fontSize.xl, color: color, fontFamily: "bold" }} style={{ fontSize: mobile ? fontSize.tiny : fontSize.xl, color: color, fontFamily: "bold" }}
> >
{title} {title}
</Text> </Text>

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

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

@ -32,14 +32,14 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF + "15" ? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44", : Colors.theme1[colorScheme].grayE3 + "44",
borderWidth: 2, borderWidth: 1.5,
borderColor: borderColor:
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3, : Colors.theme1[colorScheme].grayE3,
}, },
tw( 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={() => onPress={() =>
@ -74,8 +74,8 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
<Text <Text
style={[ style={[
{ {
fontFamily: "bold", fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 22, lineHeight: 22,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}, },
@ -104,10 +104,10 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
{ {
backgroundColor: Colors.theme1[colorScheme].grayE3 + "44", backgroundColor: Colors.theme1[colorScheme].grayE3 + "44",
borderColor: Colors.theme1[colorScheme].gray2077 + '55', borderColor: Colors.theme1[colorScheme].gray2077 + '55',
borderWidth: 1, borderWidth: 1.5,
}, },
tw( 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")} onPress={() => navigation.push("CreateAddress")}
@ -115,7 +115,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
<Text <Text
style={{ style={{
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].gray2077, color: Colors.theme1[colorScheme].gray2077,
}} }}
> >

@ -17,12 +17,12 @@ const TransportDate = ({ transportDate, mobile }) => {
return ( return (
<Pressable <Pressable
style={[ 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 backgroundColor: active
? Colors.theme1[colorScheme].greenCF + "15" ? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44", : Colors.theme1[colorScheme].grayE3 + "44",
borderWidth: 2, borderWidth: 1.5,
borderColor: active borderColor: active
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3, : Colors.theme1[colorScheme].grayE3,
@ -32,8 +32,8 @@ const TransportDate = ({ transportDate, mobile }) => {
> >
<Text <Text
style={{ style={{
fontFamily: "bold", fontFamily: "regular",
fontSize: mobile ? fontSize.lg : fontSize.xl, fontSize: mobile ? fontSize.tiny : fontSize.xl,
color: active color: active
? Colors.theme1[colorScheme].gray20 ? Colors.theme1[colorScheme].gray20
: Colors.theme1[colorScheme].gray20, : Colors.theme1[colorScheme].gray20,
@ -41,10 +41,22 @@ const TransportDate = ({ transportDate, mobile }) => {
> >
{time.time} {time.time}
</Text> </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 <Text
style={{ style={{
fontFamily: "bold", fontFamily: "regular",
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.base,
color: active color: active
? Colors.theme1[colorScheme].green20 ? Colors.theme1[colorScheme].green20
: Colors.theme1[colorScheme].gray20, : Colors.theme1[colorScheme].gray20,
@ -52,15 +64,16 @@ const TransportDate = ({ transportDate, mobile }) => {
> >
تکمیل ظرفیت تکمیل ظرفیت
</Text> </Text>
</View>
</Pressable> </Pressable>
); );
}, []); }, []);
return ( return (
<View style={tw(`w-full ${mobile ? "mt-0" : "mt-4"}`)}> <View style={tw(`w-full ${mobile ? "mt-4" : "mt-4"}`)}>
<Text <Text
style={{ style={{
fontSize: mobile ? fontSize.lg : fontSize.xl2, fontSize: mobile ? fontSize.base : fontSize.xl2,
fontFamily: "demi", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
textAlign : ios ? "right" : "auto", textAlign : ios ? "right" : "auto",
}} }}

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

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

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

@ -25,17 +25,15 @@ function Scroll({ books, mobile }) {
navigation.navigate("Product", { id: book?.id, type: "book" }) navigation.navigate("Product", { id: book?.id, type: "book" })
} }
style={[ 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, height: position === 0 ? mobile ? 245 : 350 : mobile ? 118 : 170,
}, },
]} ]}
onPress={() =>
navigation.navigate("Product", { id: book.id, type: "book" })
}
> >
<Image <Image
resizeMode="contain"
source={{ uri: `https://dnvn.ir/api/v1/file/${book.fileIds}` }} source={{ uri: `https://dnvn.ir/api/v1/file/${book.fileIds}` }}
style={{ width: "100%", height: "100%" }} style={{ width: "100%", height: "100%" }}
/> />

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save