reza added some change

master
Reza_ashrafi 3 years ago
parent 1fbe8fae3e
commit 3310d24429
  1. 6
      app.json
  2. BIN
      assets/appLogo.png
  3. 2
      navigation/index.js
  4. 2
      src/components/CustomTextInput.js
  5. 1
      src/components/MapSelector.js
  6. 3
      src/components/MusicPlayer.js
  7. 11
      src/redux/proxy.js
  8. 2
      src/redux/reducers/activation.js
  9. 6
      src/redux/reducers/user.js
  10. 1
      src/redux/store.js
  11. 1
      src/screens/DeliveryForm/index.js
  12. 3
      src/screens/Login/index.js
  13. 12
      src/screens/Otp/index.js
  14. 256
      src/screens/Product/components/Book.js
  15. 8
      src/screens/Product/components/LinkBox.js
  16. 18
      src/screens/Product/components/Sample.js
  17. 205
      src/screens/Product/components/Video.js
  18. 26
      src/screens/Product/index.js
  19. 2
      src/screens/Profile/components/ProfileAddress/index.js
  20. 2
      src/screens/QRContent/Tab/index.js
  21. 2
      src/screens/QRContent/index.js

@ -1,11 +1,11 @@
{
"expo": {
"name": "RnDanovinExpo",
"slug": "RnDanovinExpo",
"name": "Danovin",
"slug": "Danovin",
"version": "1.0.0",
"orientation": "portrait",
"userInterfaceStyle": "automatic",
"icon": "",
"icon": "./assets/appLogo.png",
"scheme": "danovin",
"splash": {
"image": "",

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

@ -51,7 +51,7 @@ const BottomTabNavigator = () => {
React.useEffect(() => {
setTimeout(() => {
setHeaderShown(false);
}, 500);
}, 600);
}, []);
return (
<Tab.Navigator

@ -30,6 +30,7 @@ const FloatingLabelInput = ({
autoFocus,
regex,
mobile,
keyboardType,
...props
}) => {
const colorScheme = useColorScheme();
@ -95,6 +96,7 @@ const FloatingLabelInput = ({
maxLength={maxLength}
value={value}
onBlur={() => (value ? {} : setIsFocused(() => false))}
keyboardType={keyboardType}
/>
</View>
);

@ -6,7 +6,6 @@ const X_API_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkyODE4ODI0N2FhM
export default function MapSelector() {
onRegionDidChange = (e) => {
console.log('onRegionDidChange', e.geometry.coordinates);
};
return (
<View style={styles.container}>

@ -6,19 +6,16 @@ export default function VoicePlayer({fileIds}) {
const [sound, setSound] = React.useState();
async function playSound() {
console.log('Loading Sound');
const { sound } = await Audio.Sound.createAsync(
{uri : `https://dnvn.ir/api/v1/file/${fileIds}`}
);
setSound(sound);
console.log('Playing Sound');
await sound.playAsync(); }
React.useEffect(() => {
return sound
? () => {
console.log('Unloading Sound');
sound.unloadAsync(); }
: undefined;
}, [sound]);

@ -27,7 +27,6 @@ class Proxy {
data || params
);
} catch (error) {
console.log("proxy get error! : ", error);
}
};
@ -35,7 +34,6 @@ class Proxy {
try {
this.check(url, opt, () => Axios.post(url, params, opt), data || params);
} catch (error) {
console.log("proxy post error! : ", error);
}
};
@ -43,7 +41,6 @@ class Proxy {
try {
this.check(url, opt, () => Axios.put(url, params, opt), data || params);
} catch (error) {
console.log("proxy put error! : ", error);
}
};
@ -56,7 +53,6 @@ class Proxy {
data || params
);
} catch (error) {
console.log("proxy delete error! : ", error);
}
};
@ -72,7 +68,6 @@ class Proxy {
case 401:
if (this.refresh()) {
let response = fetch();
console.log('check 401', response )
dispatch({ type: url, data: response.data.data, params });
return response.data.data;
}
@ -86,7 +81,6 @@ class Proxy {
}
return false;
} catch (error) {
console.log("proxy check error! : ", error);
}
};
@ -102,12 +96,10 @@ class Proxy {
);
return login ? true : false;
} catch (error) {
console.log("proxy refresh error! : ", error);
}
};
login = (url, params, { dispatch }) => {
console.log('login called');
try {
this.post(url, params, {
dispatch: (obj) => {
@ -125,7 +117,6 @@ class Proxy {
},
});
} catch (error) {
console.log("proxy login error! : ", error);
}
};
@ -139,7 +130,6 @@ class Proxy {
},
});
} catch (error) {
console.log("proxy logout error : ", error);
}
};
status = async () => {
@ -154,7 +144,6 @@ class Proxy {
}
return userData || null;
} catch (error) {
console.log("proxy status error : ", error);
return nulll;
}
};

@ -17,14 +17,12 @@ export default function activation(state = initialState, action) {
asyncAwesomeAlert("نتیجه", data.message, {
showCancelButton: false,
});
console.log(data.message);
return { ...state, loading: false, error: null };
case "activation/delete":
return { ...state, loading: false, error: null };
case "loading":
return { ...state, loading: true };
case "error":
console.log(data.message);
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
});

@ -1,5 +1,6 @@
import proxy from "../proxy";
import AsyncStorage from "@react-native-async-storage/async-storage";
import {asyncAwesomeAlert} from '../../utils/AsyncWrappers';
let initialState = {
status: null,
@ -41,7 +42,7 @@ const user = (state = initialState, action) => {
try {
AsyncStorage.setItem("userData", myData);
} catch (error) {
console.log("user/getProfile", error);
("user/getProfile", error);
}
return {
...state,
@ -61,6 +62,9 @@ const user = (state = initialState, action) => {
case "loading":
return { ...state, loading: true };
case "error":
asyncAwesomeAlert("خظا", data.message, {
showCancelButton: false,
});
return { ...state, loading: false, error: data.message };
default:
return state;

@ -62,7 +62,6 @@ try {
ReactNative.I18nManager.allowRTL(false);
// enableScreens();
} catch (e) {
console.log(e);
}

@ -37,7 +37,6 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f
getList();
}, []);
console.log(userFactor);
return (
<SafeAreaView
style={{

@ -57,7 +57,7 @@ function Login(props) {
behavior={ios ? "padding" : "height"}
style={[
tw(
`flex flex-col flex-1 justify-center items-center bg-white mx-auto px-4`
`flex flex-col flex-1 justify-center items-center bg-white px-4`
),
]}
>
@ -118,6 +118,7 @@ function Login(props) {
maxLength={11}
value={phone}
onChange={onChangePhone}
keyboardType="numeric"
autoFocus={true}
direction="ltr"
regex={(text) => onInput.phonenumber(text)}

@ -123,6 +123,12 @@ function Otp(props) {
}
}, [props.isLogin]);
const goBack = () => {
timer = 60;
props.navigation.navigate("Login");
}
return (
<View style={[tw("px-4 flex-1 justify-center items-center bg-white")]}>
<Image
@ -171,6 +177,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "1")}
regex={onInput.numberOnly}
direction="ltr"
keyboardType="numeric"
/>
<TextInput
style={[
@ -189,6 +196,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "2")}
regex={onInput.numberOnly}
direction="ltr"
keyboardType="numeric"
/>
<TextInput
style={[
@ -207,6 +215,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "3")}
regex={onInput.numberOnly}
direction="ltr"
keyboardType="numeric"
/>
<TextInput
style={[
@ -225,6 +234,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "4")}
regex={onInput.numberOnly}
direction="ltr"
keyboardType="numeric"
/>
</View>
<TouchableOpacity
@ -274,7 +284,7 @@ function Otp(props) {
style={{
marginTop: 20,
}}
onPress={() => props.navigation.navigate("Login")}
onPress={() => goBack()}
>
<Text
style={{

@ -8,11 +8,14 @@ import {
Dimensions,
Appearance,
Pressable,
Platform,
} from "react-native";
import { useNavigation } from "@react-navigation/native";
import { product, userProduct } from "../../../redux/actions";
import { connect } from "react-redux";
import { Entypo } from "@expo/vector-icons";
import separate from "../../../utils/separate";
//components
import CustomPressable from "../../../components/Pressable";
import Description from "./Description";
@ -29,7 +32,8 @@ import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
const { height } = Dimensions.get("window");
const { height, width } = Dimensions.get("window");
const ios = Platform.OS === "ios";
function Book({ book, grades, pushToCart, userId, loading, mobile }) {
const colorScheme = Appearance.getColorScheme();
@ -44,6 +48,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
setPageLoading(false);
}, 500);
}, [type]);
return (
<ScrollView style={[tw("flex flex-col flex-1 relative")]}>
{!mobile && <View style={tw("mt-5")}></View>}
@ -64,18 +69,11 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
)}
{imageSlider && <ImageSlider />}
<View style={tw("flex flex-row-reverse")}>
<Pressable
style={[
tw("rounded-md"),
{ height: mobile ? 160 : 300, width: mobile ? 110 : 210 },
]}
// onPress={() => setImageSlider(true)}
>
<Image
source={{ uri: `https://dnvn.ir/api/v1/file/${book.fileIds}` }}
style={[tw("rounded-md h-full w-full")]}
source={{ uri: `https://dnvn.ir/api/v1/file/${book?.fileIds}` }}
style={[tw("rounded-md"), { height : height / 4, width : height / 4 * 3 / 4}]}
/>
</Pressable>
<View
style={[
@ -89,21 +87,22 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
<Text
style={{
color: Colors.theme1[colorScheme].green79,
fontSize: mobile ? fontSize.xl : fontSize.xl3,
fontSize: mobile ? fontSize.lg : fontSize.xl3,
marginBottom: 5,
fontFamily: "demi",
textAlign: ios ? "right" : "auto",
}}
>
{book.product[type].name}
{book?.name}
</Text>
<Text
style={{
color: Colors.theme1[colorScheme].green79,
fontSize: mobile ? fontSize.lg : fontSize.xl,
fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "regular",
}}
>
{"پایه" + " " + grades[book.gradeId]}
{"پایه" + " " + grades[book?.gradeId]}
</Text>
</View>
<Text
@ -112,7 +111,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
{ color: "#323232", fontSize: fontSize.sm, fontFamily: "light" },
]}
>
{book.text}
{book?.text}
</Text>
</View>
</View>
@ -129,7 +128,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
}}
>
{" "}
{book.pagesNum + "\n" + "صفحه"}
{book?.pagesNum + "\n" + "صفحه"}
</Text>
</View>
<View
@ -189,88 +188,199 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
<View style={tw("flex justify-between")}></View>
</View>
<View style={tw("flex flex-row-reverse justify-between flex-wrap py-3")}>
<CustomPressable
title={"نسخه فیزیکی"}
onPress={() => setType(1)}
backgroundColor={
type === 0 ? "transparent" : Colors.theme1[colorScheme].greenCF
}
color={type === 0 ? Colors.theme1[colorScheme].greenCF : "white"}
border={{ color: Colors.theme1[colorScheme].greenCF, width: 1 }}
width={"49%"}
/>
<CustomPressable
onPress={() => setType(0)}
title={"نسخه دیجیتال"}
backgroundColor={
type === 1 ? "transparent" : Colors.theme1[colorScheme].greenCF
<Pressable
style={[
tw("flex flex-row-reverse w-full justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
},
]}
onPress={() =>
pushToCart({
productId: book?.product[1]?.id,
userId: userId,
count: 1,
})
}
color={type === 1 ? Colors.theme1[colorScheme].greenCF : "white"}
border={{ color: Colors.theme1[colorScheme].greenCF, width: 1 }}
width={"49%"}
/>
<CustomPressable
title={`خرید با قیمت ${book.product[type].price} تومان`}
backgroundColor={Colors.theme1[colorScheme].greenCF}
color={"white"}
border={{ color: "#196EC0", width: 0 }}
width={"65%"}
loading={loading}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
paddingVertical: 4,
}}
>
خرید نسخه فیزیکی کتاب
</Text>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View>
<Text
style={[
tw("py-1 pr-2"),
{
borderLeftWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
},
]}
>
{separate(book?.product[1]?.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
<Pressable
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
pushToCart({
productId: book?.product[type]?.id,
productId: book?.product[0]?.id,
userId: userId,
count: 1,
})
}
/>
<CustomPressable
title={"مشاهده نمونه"}
backgroundColor="transparent"
color={Colors.theme1[colorScheme].redFF1}
border={{ color: Colors.theme1[colorScheme].redFF1, width: 1 }}
width={"33%"}
onPress={() => navigation.push('Sample')}
/>
<TouchableOpacity
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
paddingVertical: 4,
}}
>
خرید نسخه دیجیتال کتاب
</Text>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View>
<Text
style={[
tw("py-1 pr-2"),
{
borderLeftWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
},
]}
>
{separate(book?.product[0]?.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
<Pressable
style={[
tw(
"w-full rounded-md flex flex-row justify-center items-center py-3 mt-4"
),
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{
backgroundColor: Colors.theme1[colorScheme].greenCF + "1a",
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].green79 + "33",
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: fontSize.sm * 6 + 18,
},
]}
onPress={() => navigation.navigate("Video", { id: book.id })}
onPress={() => navigation.push("Sample", { id: book?.sampleFileId })}
>
<Entypo
name="chevron-small-left"
size={20}
color={Colors.theme1[colorScheme].green79}
/>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
paddingVertical: 4,
}}
>
مشاهده نمونه
</Text>
</Pressable>
<Pressable
style={[
tw(""),
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
pushToCart({
productId: book?.product[2]?.id,
userId: userId,
count: 1,
})
}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
fontSize: mobile ? fontSize.base : fontSize.lg,
paddingVertical: 4,
}}
>
خرید دوره ویدئویی کتاب
</Text>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View>
<Text
style={[
tw("py-1 pr-2"),
{
borderLeftWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
},
]}
>
{separate(book?.product[2]?.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
<Pressable
style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: fontSize.sm * 6 + 18,
},
]}
onPress={() => navigation.navigate("Video", { id: book?.id })}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
paddingVertical: 4,
}}
>
مشاهده دوره ویدئویی این محصول
پیش نمایش
</Text>
</TouchableOpacity>
</Pressable>
</View>
{book.product[type].description && (
<Description description={book.description} />
{book?.product[type]?.description && (
<Description description={book?.description} />
)}
<LinkBox
title="مشخصات محصول"
key={"0"}
component={<ProductSpecifications list={book.product[type].properties} />}
component={
<ProductSpecifications list={book?.product[type]?.properties} />
}
height={height - height / 4}
/>
<LinkBox
@ -306,7 +416,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
)}
{/* <Rates rates={book.rates} /> */}
<Comments comments={book.comments} />
<Comments comments={book?.comments} />
</ScrollView>
);
}

@ -21,7 +21,7 @@ function Description({ title, component, height, mobile }) {
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-5 ${mobile ? "py-3" : "py-4"}`
),
{
backgroundColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenCF + '15',
// borderWidth : 1,
},
]}
@ -29,8 +29,8 @@ function Description({ title, component, height, mobile }) {
<Text
style={[
{
fontSize: mobile ? fontSize.tiny : fontSize.lg,
color: "white",
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "demi",
},
tw(""),
@ -38,7 +38,7 @@ function Description({ title, component, height, mobile }) {
>
{title}
</Text>
<Entypo name="chevron-small-left" size={20} color="white" />
<Entypo name="chevron-small-left" size={20} color={Colors.theme1[colorScheme].green79} />
</TouchableOpacity>
<RBSheet
ref={refRBSheet}

@ -2,7 +2,9 @@ import { WebView } from "react-native-webview";
import {SafeAreaView, Platform, StatusBar} from "react-native";
import React from "react";
const Sample = () => {
import Navbar from "../../../components/Navbar";
const Sample = ({route}) => {
return (
<SafeAreaView
style={{
@ -11,9 +13,21 @@ const Sample = () => {
flex : 1
}}
>
<Navbar
// setBoxPosition={setBoxPosition}
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: "",
bookmark: false,
qr: false,
back: true,
}}
/>
<WebView
source={{
uri: "https://github.com/facebook/react-native",
uri: `https://dnvn.ir/xpdf/${route.params.id}`,
}}
style={{ flex: 1 }}
></WebView>

@ -1,205 +0,0 @@
import {t} from 'i18next';
import React from 'react';
import {
View,
Text,
Image,
Dimensions,
ScrollView,
Pressable,
} from 'react-native';
import {Entypo} from '@expo/vector-icons';
import CustomPressable from '../../../components/Pressable';
import Description from './Description';
import LinkBox from './LinkBox';
import Comments from './Comments';
import Rates from './Rates';
import tw from 'tailwind-rn';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
export default function Video({product}) {
return (
<ScrollView style={[tw('flex flex-col flex-1')]}>
<View style={tw('flex flex-col')}>
<View
style={[
tw(
'w-full flex flex-row flex-1 justify-between items-center relative overflow-hidden',
),
{height: height / 3.8},
]}>
{/* <View
style={[
tw('rounded-full bg-black bg-opacity-20 z-50'),
{width: 50, height: 50},
]}></View> */}
<Image
source={product.poster}
style={tw('w-full rounded-md h-full absolute left-0 top-0')}
/>
<Image
source={{uri: product.imageUrl}}
style={[
tw('rounded-md h-full rounded-md ml-2'),
{width: 70, height: 100},
]}
/>
</View>
<View
style={[
tw('flex flex-col flex-1 justify-between'),
{
paddingRight: 10,
},
]}>
<View style={tw('flex flex-col')}>
<Text
style={{
marginTop : 5,
color: '#05335F',
fontSize: width / 18,
marginBottom: 5,
fontFamily : 'bold'
}}>
{product.name}
</Text>
<Text style={{color: '#196EC0', fontSize: width / 37, marginBottom: 10, fontFamily : 'light'}}>
{product.grade}
</Text>
</View>
<Text
style={[
tw('text-right w-full'),
{color: '#323232', fontSize: width / 38, fontFamily : 'light'},
]}>
{product.text}
</Text>
</View>
</View>
<View
style={tw(
'flex flex-row-reverse items-center justify-around py-6',
)}>
<View>
<Text
style={{
color: '#196EC0',
textAlign: 'center',
fontSize: width / 37,
fontFamily: 'light'
}}>
{' '}
{473 + '\n' + 'صفحه'}
</Text>
</View>
<View
style={{backgroundColor: '#196EC055', height: 20, width: 2}}></View>
<View>
<Text
style={{
color: '#196EC0',
textAlign: 'center',
fontSize: width / 37,
fontFamily: 'light'
}}>
{' '}
{'فیزیکی- دیجیتالی - ویدئو' + '\n' + 'در دسترس'}
</Text>
</View>
<View
style={{backgroundColor: '#196EC055', height: 20, width: 2}}></View>
<View>
<Text
style={{
color: '#196EC0',
textAlign: 'center',
fontSize: width / 37,
fontFamily: 'light'
}}>
{' '}
{4.8 + '\n' + 'امتیاز'}
</Text>
</View>
</View>
<View style={'flex flex-col mt-3'}>
<Text
style={[
tw('w-full text-right font-medium'),
{color: '#196EC0', fontSize: width / 36, fontFamily: 'regular'},
]}>
نسخه محصول را انتخاب کنید
</Text>
<View style={tw('flex justify-between')}></View>
</View>
<View
style={tw(
'flex flex-row justify-between flex-wrap py-3',
)}>
<CustomPressable
title={'نسخه فیزیکی'}
backgroundColor="transparent"
color={'#196EC0'}
border={{color: '#196EC0', width: 1}}
width={'49%'}
/>
<CustomPressable
title={'نسخه دیجیتال'}
backgroundColor="transparent"
color={'#196EC0'}
border={{color: '#196EC0', width: 1}}
width={'49%'}
/>
<CustomPressable
title={'خرید با قیمت 245.000 تومان'}
backgroundColor="#196EC0"
color={'white'}
border={{color: '#196EC0', width: 0}}
width={'65%'}
/>
<CustomPressable
title={'مشاهده نمونه'}
backgroundColor="transparent"
color={'#196EC0'}
border={{color: '#196EC0', width: 1}}
width={'33%'}
/>
<Pressable
style={[
tw(
'w-full rounded-md flex flex-row justify-center items-center py-3.5',
),
{backgroundColor: '#196EC01a'},
]}>
<Entypo name="chevron-small-left" size={20} color="#196EC0" />
<Text
style={[tw(''), {color: '#275077', fontSize: width / 36, fontFamily : 'light'}]}>
مشاهده دوره ویدئویی این محصول
</Text>
</Pressable>
</View>
<Description description={product.description} />
<LinkBox title="مشخصات محصول" path="" />
<LinkBox title="نقد بررسی و توضیحات تکمیلی محصول" path="" />
<LinkBox title="پرسش و پاسخ" path="" />
<View
style={tw(
'flex flex-row-reverse justify-between items-center my-6',
)}>
<Text
style={[
{fontSize: width / 36, color: '#275077', fontFamily: 'regular'},
]}>
امتیازات و نظرات
</Text>
<Entypo name="chevron-small-left" size={20} color="#196EC0" />
</View>
<Rates rates={product.rates} />
<Comments comments={product.comments} />
</ScrollView>
);
}

@ -8,20 +8,14 @@ import {
StatusBar,
} from "react-native";
import Book from "./components/Book";
import Video from "./components/Video";
import {book} from "../../redux/actions";
import { book } from "../../redux/actions";
import { connect } from "react-redux";
import Navbar from "../../components/Navbar";
function Product({
route,
book,
getBook,
grades,
}) {
function Product({ route, book, getBook, grades }) {
useEffect(() => {
getBook({id : route.params.id});
},[]);
getBook({ id: route.params.id, vod : true });
}, []);
return (
<SafeAreaView
@ -46,11 +40,7 @@ function Product({
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
{book && (route.params.type === 'video' ? (
<Video />
) : (
<Book book={book} grades={grades} />
))}
</ScrollView>
</SafeAreaView>
);
@ -69,12 +59,12 @@ const styles = StyleSheet.create({
});
const mapStateToProps = (state) => ({
book : state.book.info,
grades : state.publicApi.grades
book: state.book.info,
grades: state.publicApi.grades,
});
const mapDispatchToProps = {
getBook : book.info
}
getBook: book.info,
};
export default connect(mapStateToProps, mapDispatchToProps)(Product);

@ -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 mx-auto w-full`
`flex flex-row-reverse self-end justify-center py-3 rounded-md items-center mt-4 w-full`
),
]}
onPress={() => navigation.push("CreateAddress")}

@ -14,7 +14,7 @@ const { width} = Dimensions.get("window");
export default function Tab({ data }) {
const [dataType, setDataType] = useState("all");
console.log(data);
return (
<View
style={[

@ -21,7 +21,7 @@ function QRContent({ route, getQrData, data, grades }) {
useEffect(() => {
if (data) {
// console.log(data.qr.content);
// (data.qr.content);
}
}, [data]);
return (

Loading…
Cancel
Save