reza fixed one toxmi bug

master
Reza_ashrafi 2 years ago
parent 9b2b46d3dc
commit 5e1bece2f3
  1. 2
      navigation/index.js
  2. 13
      src/components/BottomSheet.js
  3. 38
      src/components/CustomTextInput.js
  4. 14
      src/components/Drawer.js
  5. 6
      src/components/Empty.js
  6. 65
      src/components/Navbar.js
  7. 16
      src/components/Scanner.js
  8. 1
      src/redux/reducers/activation.js
  9. 1
      src/redux/reducers/book.js
  10. 2
      src/redux/reducers/comment.js
  11. 1
      src/redux/reducers/product.js
  12. 1
      src/redux/reducers/user.js
  13. 1
      src/redux/reducers/userFavorite.js
  14. 1
      src/redux/reducers/userProduct.js
  15. 1
      src/redux/reducers/vote.js
  16. 7
      src/screens/AR/index.js
  17. 6
      src/screens/Address/index.js
  18. 26
      src/screens/Blog/index.js
  19. 8
      src/screens/Contact/layouts/Ticket.js
  20. 66
      src/screens/DeliveryForm/Address/index.js
  21. 4
      src/screens/Faq/components/Instance.js
  22. 5
      src/screens/Faq/index.js
  23. 4
      src/screens/Home/components/MyBooks.js
  24. 2
      src/screens/Home/index.js
  25. 2
      src/screens/Login/index.js
  26. 16
      src/screens/Product/components/Book.js
  27. 30
      src/screens/Products/components/Main.js
  28. 8
      src/screens/Profile/components/ProfileAddress/index.js
  29. 109
      src/screens/Profile/components/ProfileBookmark/index.js
  30. 7
      src/screens/Profile/components/User.js
  31. 35
      src/screens/QRContent/Tab/index.js
  32. 2
      src/screens/QRContent/index.js
  33. 10
      src/screens/ShoppingCart/components/Code.js
  34. 419
      src/screens/ShoppingCart/components/Product.js
  35. 9
      src/screens/ShoppingCart/index.js
  36. 22
      src/screens/Video/components/Season.js
  37. 6
      src/screens/Video/index.js
  38. 8
      src/screens/VideoDisplay/index.js
  39. 8
      src/screens/Videos/index.js

@ -446,6 +446,8 @@ const PROFILEStackScreen = () => {
<PROFILEStack.Screen name="ProfileBookmark" component={ProfileBookmark} />
<ProductsStack.Screen name="Products" component={Products} />
<PROFILEStack.Screen name="Product" component={Product} />
<HomeStack.Screen name="Blogs" component={Blogs} />
<HomeStack.Screen name="Blog" component={Blog} />
<PROFILEStack.Screen name="MyCourses" component={MyCourses} />
</PROFILEStack.Navigator>
);

@ -1,13 +0,0 @@
import { View, Text } from 'react-native';
import React from 'react';
const BottomSheet = () => {
return (
<View>
<Text></Text>
</View>
);
};
export default BottomSheet;

@ -1,12 +1,6 @@
import React, { useState } from "react";
import {
TextInput,
View,
Text,
Dimensions,
StyleSheet,
} from "react-native";
import {connect} from 'react-redux';
import React from "react";
import { TextInput, View, Text, StyleSheet } from "react-native";
import { connect } from "react-redux";
import tw from "tailwind-rn";
import Colors from "../constants/Colors";
@ -20,7 +14,7 @@ const FloatingLabelInput = ({
onChange,
name,
value,
color,
textColor,
placeholder,
maxLength,
autoFocus,
@ -31,7 +25,10 @@ const FloatingLabelInput = ({
theme,
...props
}) => {
const [isFocused, setIsFocused] = useState(false);
const [isFocused, setIsFocused] = React.useState(false);
const color = React.useMemo(() => {
return Colors.theme1[theme];
}, [theme]);
const styles = StyleSheet.create({
labelStyle: {
@ -47,17 +44,13 @@ const FloatingLabelInput = ({
: -Math.floor(fontSize.sm),
},
],
color: !isFocused
? Colors.theme1[theme].gray2077
: Colors.theme1[theme].green79,
color: !isFocused ? color.gray2077 : color.green79,
},
inputStyle: {
fontSize: fontSize.lg,
color: Colors.theme1[theme].black,
color: color.black,
borderWidth: 1,
borderColor: isFocused
? Colors.theme1[theme].greenC8
: Colors.theme1[theme].gray2077 + "66",
borderColor: isFocused ? color.greenC8 : color.gray2077 + "66",
textAlign: textAlign,
fontFamily: "regular",
direction: direction ? direction : "rtl",
@ -83,7 +76,10 @@ const FloatingLabelInput = ({
{label}
</Text>
<TextInput
style={[styles.inputStyle, tw(`rounded-sm ${mobile ? "py-2" : "py-3"} px-4`)]}
style={[
styles.inputStyle,
tw(`rounded-sm ${mobile ? "py-2" : "py-3"} px-4`),
]}
onChangeText={(text) => onChange(name, (text = regex(text)))}
placeholder={placeholder}
onFocus={() => setIsFocused(true)}
@ -101,7 +97,7 @@ const FloatingLabelInput = ({
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
})
theme: state.publicApi.theme,
});
export default connect(mapStateToProps)(FloatingLabelInput);

@ -44,6 +44,10 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
const [dropdownHeight, setDropdownHeight] = useState(0);
const navigation = useNavigation();
const color = React.useMemo(() => {
return Colors.theme1[theme];
}, [theme]);
const routes = React.useMemo(() => {
return [
{
@ -338,7 +342,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
<View
style={[
tw("flex items-end pt-12 px-4"),
{ backgroundColor: Colors.theme1[theme].greenCF },
{ backgroundColor: color.greenCF },
]}
>
<View style={tw("flex flex-row-reverse w-full justify-between")}>
@ -346,7 +350,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
<AntDesign
name="close"
size={mobile ? 20 : 30}
color={Colors.theme1[theme].white}
color={color.white}
onPress={() => setBoxPosition()}
/>
</View>
@ -409,7 +413,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
),
{
borderBottomWidth: 1,
borderColor: Colors.theme1[theme].grayE3,
borderColor: color.grayE3,
height: dropdownHeight,
},
]}
@ -424,7 +428,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
style={{
fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "regular",
color: Colors.theme1[theme].gray20,
color: color.gray20,
}}
>
افزودن حساب کاربری جدید
@ -435,7 +439,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
marginTop: 3,
fontSize: fontSize.xl4,
fontFamily: "bold",
color: Colors.theme1[theme].gray20 + "77",
color: color.gray20 + "77",
}}
>
+

@ -16,13 +16,13 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => {
fontFamily: "regular",
fontSize: fontSize.tiny,
transform: [{ translateY: -50 }],
color : Colors.theme1[theme].gray20
color: Colors.theme1[theme].gray20,
},
]}
>
{text + " " + ":("}
</Text>
{buttonText && (
{buttonText ? (
<Pressable
style={[
tw("py-2 px-5 rounded-sm"),
@ -42,7 +42,7 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => {
{buttonText}
</Text>
</Pressable>
)}
) : null}
</View>
);
};

@ -81,14 +81,16 @@ const Navbar = ({
},
]}
>
{!headerOptions?.title && headerOptions?.back ? (
<Ionicons
name="arrow-forward"
style={tw("mr-2")}
size={24}
color={"#52796F"}
onPress={() => navigation.goBack()}
/>
{!headerOptions?.title ? (
headerOptions?.back ? (
<Ionicons
name="arrow-forward"
style={tw("mr-2")}
size={24}
color={"#52796F"}
onPress={() => navigation.goBack()}
/>
) : null
) : null}
{headerOptions?.title ? (
<Text
@ -102,7 +104,7 @@ const Navbar = ({
{headerOptions?.title}
</Text>
) : null}
{headerOptions?.hamburgerMenu && (
{headerOptions?.hamburgerMenu ? (
<Pressable style={tw("relative mr-4")} onPress={() => setBoxPosition()}>
<Svg
xmlns="http://www.w3.org/2000/svg"
@ -123,15 +125,15 @@ const Navbar = ({
/>
</G>
</Svg>
{notification && (
{notification ? (
<View
style={tw("h-2.5 w-2.5 absolute -left-1 -top-1 rounded-full")}
></View>
)}
) : null}
</Pressable>
)}
) : null}
{headerOptions?.logo && (
{headerOptions?.logo ? (
<Pressable
onPress={() => navigation.navigate("Home")}
style={tw("absolute right-1/2 top-1/2")}
@ -141,7 +143,7 @@ const Navbar = ({
xmlnsXlink="http://www.w3.org/1999/xlink"
width={19.644}
height={30.908}
style={{ transform: [{ translateY: -15.454 }, {scale: 1.3}] }}
style={{ transform: [{ translateY: -15.454 }, { scale: 1.3 }] }}
>
<Defs>
<Pattern
@ -161,19 +163,21 @@ const Navbar = ({
<Path fill="url(#a)" d="M0 0h19.644v28.908H0z" />
</Svg>
</Pressable>
)}
) : null}
<View style={tw("flex flex-row items-center ml-4")}>
{headerOptions?.back && headerOptions?.title ? (
<Ionicons
name="arrow-back"
style={tw("mr-2")}
size={24}
color={"#52796F"}
onPress={() => navigation.goBack()}
/>
{headerOptions?.back ? (
headerOptions?.title ? (
<Ionicons
name="arrow-back"
style={tw("mr-2")}
size={24}
color={"#52796F"}
onPress={() => navigation.goBack()}
/>
) : null
) : null}
{headerOptions?.qr && (
{headerOptions?.qr ? (
<>
<Button
icon={
@ -393,9 +397,9 @@ const Navbar = ({
state={"AR"}
/>
</>
)}
{headerOptions?.bookmark &&
(bookmarkLoading ? (
) : null}
{headerOptions?.bookmark ? (
bookmarkLoading ? (
<ActivityIndicator size={20} color={Color.theme1[theme].green79} />
) : isActiveBookmark ? (
<Ionicons
@ -437,10 +441,11 @@ const Navbar = ({
})
}
/>
))}
{headerOptions?.menu && (
)
) : null}
{headerOptions?.menu ? (
<Entypo name="dots-three-vertical" size={24} color="#52796F" />
)}
) : null}
</View>
</View>
);

@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import { Text, View, StyleSheet, Button } from 'react-native';
import { BarCodeScanner } from 'expo-barcode-scanner';
import React, { useState, useEffect } from "react";
import { Text, View, StyleSheet, Button } from "react-native";
import { BarCodeScanner } from "expo-barcode-scanner";
export default function App() {
const [hasPermission, setHasPermission] = useState(null);
@ -9,7 +9,7 @@ export default function App() {
useEffect(() => {
(async () => {
const { status } = await BarCodeScanner.requestPermissionsAsync();
setHasPermission(status === 'granted');
setHasPermission(status === "granted");
})();
}, []);
@ -29,9 +29,11 @@ export default function App() {
<>
<BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={{width : '100%', height : 300}}
style={{ width: "100%", height: 300 }}
/>
{scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />}
{scanned ? (
<Button title={"Tap to Scan Again"} onPress={() => setScanned(false)} />
) : null}
</>
);
}
}

@ -25,6 +25,7 @@ export default function activation(state = initialState, action) {
case "error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return {
...state,

@ -87,6 +87,7 @@ export default function book(state = initialState, action) {
case "book/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, loading: false, error: data.message };
default:

@ -27,6 +27,8 @@ export default function comment(state = initialState, action) {
case "comment/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, loading: false, error: data.message };
default:

@ -22,6 +22,7 @@ export default function product(state = initialState, action) {
case "product/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, loading: false, error: data.message };
default:

@ -64,6 +64,7 @@ const user = (state = initialState, action) => {
case "user/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, error : true };
default:

@ -32,6 +32,7 @@ export default function userFavorite(state = initialState, action) {
case "userFavorite/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, loading: false, error: data.message };
default:

@ -50,6 +50,7 @@ export default function userFactor(state = initialState, action) {
case "userProduct/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, loading: false, error: data.message };
default:

@ -18,6 +18,7 @@ export default function vote(state = initialState, action) {
case "userVote/error":
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
confirmText: "باشه"
});
return { ...state, loading: false, error: data.message };
default:

@ -38,7 +38,7 @@ function AR({ getArList, arList, mobile }) {
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
backgroundColor: "white",
flex : 1
flex: 1,
}}
>
<Navbar
@ -69,8 +69,9 @@ function AR({ getArList, arList, mobile }) {
}`
)}
>
{arList.length > 0 &&
arList.map((book, index) => <Book book={book} key={index} />)}
{arList.length
? arList.map((book, index) => <Book book={book} key={index} />)
: null}
</View>
</ScrollView>
</SafeAreaView>

@ -273,7 +273,7 @@ const Address = ({
title="اطلاعات هویتی"
text="( لطفا نام و نام خانوادگی خود را به طور کامل وارد نمایید )"
/>
{!profilePage && <MapSelector />}
{!profilePage ? <MapSelector /> : null}
<CustomTextInput
label="نام"
placeholder=""
@ -310,7 +310,7 @@ const Address = ({
autoFocus={false}
regex={(val) => val}
/>
{profilePage && (
{profilePage ? (
<CustomTextInput
keyboardType="numeric"
label="کد ملی"
@ -325,7 +325,7 @@ const Address = ({
autoFocus={false}
regex={(text) => onInput.numberOnly(text)}
/>
)}
) : null}
<View style={tw("mt-4")}></View>
<Header
title="شماره تماس"

@ -44,8 +44,6 @@ const renderNode = (node, index, siblings, parent, defaultRenderer) => {
}
};
export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => {
useEffect(() => {
getInfo({ id: route.params.id });
@ -54,8 +52,6 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => {
}
}, []);
return (
<SafeAreaView
style={{
@ -170,10 +166,22 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => {
>
{blog?.title}
</Text>
<HTMLView value={blog?.text} renderNode={renderNode} />
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
}}
>
<HTMLView
value={blog?.text}
renderNode={renderNode}
stylesheet={styles.font}
/>
</View>
</View>
<Header title={"پیشنهادی "} />
{blogs.length && (
{blogs.length ? (
<FlatList
showsHorizontalScrollIndicator={false}
horizontal={true}
@ -185,7 +193,7 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => {
return item.id;
}}
/>
)}
) : null}
</View>
</ScrollView>
</SafeAreaView>
@ -220,4 +228,8 @@ const styles = StyleSheet.create({
paddingVertical: 0,
paddingHorizontal: 0,
},
font: {
textAlign: "center",
fontFamily: "render",
},
});

@ -93,7 +93,7 @@ export const Ticket = ({
}}
/>
<ScrollView style={tw("flex-1 px-4")}>
{!status && (
{!status ? (
<>
<CustomTextInput
label="نام و نام خانوادگی"
@ -111,7 +111,7 @@ export const Ticket = ({
maxLength={11}
/>
</>
)}
) : null}
<Select
defaultValue={ticket?.unit || opt[0]}
options={myProductList.length ? opt : opt.slice(0, 3)}
@ -119,7 +119,7 @@ export const Ticket = ({
onChange={(name, value) => setTicket({ name, value })}
width={"100%"}
/>
{ticket?.unit === "واحد محتوایی" && (
{ticket?.unit === "واحد محتوایی" ? (
<Select
name="bookId"
defaultValue={ticket?.subject}
@ -136,7 +136,7 @@ export const Ticket = ({
onChange={(name, value) => setTicket({ name, value })}
width={"100%"}
/>
)}
) : null}
<CustomTextInput
name="subject"
onChange={(name, value) => setTicket({ name, value })}

@ -4,7 +4,7 @@ import {
Pressable,
TouchableOpacity,
ActivityIndicator,
Platform
Platform,
} from "react-native";
import React from "react";
import { connect } from "react-redux";
@ -18,7 +18,15 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios";
const Address = ({ addresses, update, userId, userAddressId, loading, mobile, theme }) => {
const Address = ({
addresses,
update,
userId,
userAddressId,
loading,
mobile,
theme,
}) => {
const navigation = useNavigation();
const Location = ({ address, active }) => {
@ -37,7 +45,9 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile, th
: Colors.theme1[theme].grayE3,
},
tw(
`flex flex-row-reverse items-center w-full px-3 rounded-sm 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={() =>
@ -46,28 +56,30 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile, th
: update({ userAddressId: address.id, userId })
}
>
{loading && userAddressId !== address?.id ? (
<ActivityIndicator
size="small"
color={Colors.theme1[theme].greenC8}
/>
) : (
<View
style={[
tw("w-5 h-5 rounded-full"),
{
backgroundColor: active
? Colors.theme1[theme].greenCF
: "white",
borderWidth: userAddressId === address?.id ? 4 : 1,
borderColor:
userAddressId === address?.id
? Colors.theme1[theme].black
: Colors.theme1[theme].gray20 + "33",
},
]}
></View>
)}
{loading ? (
userAddressId !== address?.id ? (
<ActivityIndicator
size="small"
color={Colors.theme1[theme].greenC8}
/>
) : (
<View
style={[
tw("w-5 h-5 rounded-full"),
{
backgroundColor: active
? Colors.theme1[theme].greenCF
: "white",
borderWidth: userAddressId === address?.id ? 4 : 1,
borderColor:
userAddressId === address?.id
? Colors.theme1[theme].black
: Colors.theme1[theme].gray20 + "33",
},
]}
></View>
)
) : null}
<View style={tw(`flex flex-1 ${mobile ? "mr-2" : "mr-5"}`)}>
<Text
style={[
@ -101,7 +113,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile, th
style={[
{
backgroundColor: Colors.theme1[theme].grayE3 + "44",
borderColor: Colors.theme1[theme].gray2077 + '55',
borderColor: Colors.theme1[theme].gray2077 + "55",
borderWidth: 1.5,
},
tw(
@ -138,7 +150,7 @@ const mapStateToProps = (state) => ({
userAddressId: state.userFactor.info?.userAddressId,
loading: state.userFactor.loading,
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
theme: state.publicApi.theme,
});
const mapDispatchToProps = {

@ -43,7 +43,7 @@ function Instance({ question, selectFaq, mobile, theme }) {
<Entypo name="plus" size={18} color={Colors.theme1[theme].green79} />
)}
</View>
{question.active && (
{question.active ? (
<View style={tw("w-full flex flex-row-reverse pt-2")}>
<Text
style={[
@ -58,7 +58,7 @@ function Instance({ question, selectFaq, mobile, theme }) {
{question.description}
</Text>
</View>
)}
) : null}
</TouchableOpacity>
);
}

@ -27,7 +27,7 @@ import bgFaq from "./assets/faq.png";
const { width, height } = Dimensions.get("window");
function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) {
function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq, theme }) {
useEffect(() => {
if (list.length === 0) {
getFaq();
@ -85,7 +85,7 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) {
<Text
style={[
tw("w-full px-4 mt-10 text-center"),
{ fontFamily: "bold" },
{ fontFamily: "bold", color : Colors.theme1[theme].gray20 + '77' },
]}
>
موردی یافت نشد.
@ -113,6 +113,7 @@ const mapStateToProps = (state) => ({
list: state.faq.list,
searchResult: state.faq.searchResult,
search: state.faq.search,
theme : state.publicApi.theme
});
const mapDispatchToProps = {

@ -12,7 +12,7 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios";
function MyBooks({ books, grades, theme }) {
return books.length && (
return books.length ? (
<View style={[tw("flex w-full mb-5")]}>
<View
style={[
@ -50,7 +50,7 @@ function MyBooks({ books, grades, theme }) {
/>
</View>
</View>
);
) : null;
}
const Book = ({ book, grades, theme }) => {

@ -61,7 +61,7 @@ const Home = ({ route, blogs, books, userProducts, mobile }) => {
contentContainerStyle={styles.contentContainerStyle}
style={[styles.container]}
>
{!mobile && <View style={tw("mt-5")}></View>}
{!mobile ? <View style={tw("mt-5")}></View> : null}
<MyBooks books={userProducts} />
<View style={tw("px-4 w-full")}>
<Header title={"فروشگاه"} route={"Products"} />

@ -143,7 +143,7 @@ function Login(props) {
regex={(text) => onInput.phonenumber(text)}
/>
</View>
{!props.mobile && <View style={tw("mt-10")}></View>}
{!props.mobile ? <View style={tw("mt-10")}></View> : null}
<TouchableHighlight
disabled={loading}
underlayColor={Colors.theme1[props.theme].greenC8}

@ -113,8 +113,8 @@ function Book({
return (
<ScrollView style={[tw("flex flex-1 relative")]}>
{!mobile && <View style={tw("mt-5")}></View>}
{(!book) && (
{!mobile ? <View style={tw("mt-5")}></View> : null}
{!book ? (
<View
style={[
tw("absolute left-0 top-0 rounded-md overflow-hidden"),
@ -128,8 +128,8 @@ function Book({
>
<Blur />
</View>
)}
{imageSlider && <ImageSlider />}
) : null}
{imageSlider ? <ImageSlider /> : null}
<View style={[tw("flex flex-row-reverse")]}>
<Image
source={{ uri: `https://dnvn.ir/api/v1/file/${book?.fileIds}` }}
@ -487,9 +487,9 @@ function Book({
</Text>
</TouchableHighlight>
</View>
{book?.product[type]?.description && (
{book?.product[type]?.description ? (
<Description description={book?.description} />
)}
) : null}
<LinkBox
title="مشخصات محصول"
key={"0"}
@ -517,7 +517,7 @@ function Book({
})
}
/>
{(product.rate || 4) && (
{product.rate || 4 ? (
<>
<View
style={tw(
@ -543,7 +543,7 @@ function Book({
productId={book?.product[1]?.id}
/>
</>
)}
) : null}
</ScrollView>
);
}

@ -133,9 +133,11 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
))
: bySearchFilter?.map((product, index) => (
<React.Fragment key={index}>
{(productType
? productType === ("کتاب دیجیتال" || "همه محصولات")
: true) && (
{(
productType
? productType === ("کتاب دیجیتال" || "همه محصولات")
: true
) ? (
<Pressable
key={product?.product[0]?.id}
style={[
@ -223,10 +225,12 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
</Text>
</View>
</Pressable>
)}
{(productType
? productType === ("کتاب فیزیکی" || "همه محصولات")
: true) && (
) : null}
{(
productType
? productType === ("کتاب فیزیکی" || "همه محصولات")
: true
) ? (
<Pressable
key={product?.product[1]?.id}
style={[
@ -314,7 +318,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
</Text>
</View>
</Pressable>
)}
) : null}
</React.Fragment>
));
};
@ -330,10 +334,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
),
]}
>
{filterOptions?.productType === "دوره ویدئویی" && Items(2)}
{filterOptions?.productType === "کتاب دیجیتال" && Items(0)}
{filterOptions?.productType === "کتاب فیزیکی" && Items(1)}
{!filterOptions?.productType && Items(0)}
{filterOptions?.productType === "دوره ویدئویی" ? Items(2) : null}
{filterOptions?.productType === "کتاب دیجیتال" ? Items(0) : null}
{filterOptions?.productType === "کتاب فیزیکی" ? Items(1) : null}
{!filterOptions?.productType ? Items(0) : null}
{/* {filterLoading && (
<View style="w-full h-screen flex justify-center items-center bg-white bg-opacity-20 backdrop-filter backdrop-blur-xl fixed left-0 top-0">
<Loading size={4} color="bg-green-400" />
@ -346,7 +350,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => {
const mapStateToProps = (state) => ({
filterOptions: state.book.filterOptions,
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
theme: state.publicApi.theme,
});
const mapDispatchToProps = {};

@ -66,7 +66,7 @@ const ProfileAddress = ({
}
>
<View style={tw("flex flex-1 mr-2")}>
{active && (
{active ? (
<View
style={tw("w-full flex flex-row-reverse justify-between mb-3")}
>
@ -101,7 +101,7 @@ const ProfileAddress = ({
</G>
</Svg>
</View>
)}
) : null}
<View style={tw(`flex w-full ${active ? "" : "flex-row-reverse"}`)}>
<View style={tw("flex flex-1 mb-4")}>
<Text
@ -156,7 +156,7 @@ const ProfileAddress = ({
{"شماره تماس:" + " " + address.cellphone}
</Text>
</View>
{!active && (
{!active ? (
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}>
<G
fill={Colors.theme1[theme].gray20}
@ -169,7 +169,7 @@ const ProfileAddress = ({
/>
</G>
</Svg>
)}
) : null}
</View>
<CustomPressable

@ -9,7 +9,7 @@ import {
Dimensions,
StatusBar,
Image,
Appearance,
ActivityIndicator,
} from "react-native";
import React from "react";
import { connect } from "react-redux";
@ -32,24 +32,19 @@ const ios = Platform.OS === "ios";
const ProfileBookmark = ({
bookmarkList,
getList,
deleteItem,
loading,
mobile,
grades,
theme
theme,
}) => {
React.useEffect(() => {
getList();
}, []);
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
backgroundColor: "white",
flex: 1,
}}
>
<Navbar
@ -63,21 +58,6 @@ const ProfileBookmark = ({
back: true,
}}
/>
{loading && (
<View
style={[
tw("absolute left-0 top-0 rounded-md overflow-hidden"),
{
width: Dimensions.get("window").width,
height: height,
zIndex: 1,
backgroundColor: Colors.theme1[theme].white + "60",
},
]}
>
<Blur />
</View>
)}
{bookmarkList.length ? (
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
@ -93,25 +73,38 @@ const ProfileBookmark = ({
mobile={mobile}
grades={grades}
theme={theme}
loading={loading}
/>
))}
</View>
</View>
</ScrollView>
) : (
<Empty text="لیست علاقهمندیها خالی است." />
<Empty text="هیچ موردی برای شما یافت نشد." />
)}
</SafeAreaView>
);
};
const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme }) => {
const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => {
const navigation = useNavigation();
const [selectedBookmark, setSelectedBookmark] = React.useState(null);
const isContent = React.useMemo(() => {
return bookmark?.content;
return bookmark?.contentId;
}, [bookmark]);
const deleteAction = async (action) => {
setSelectedBookmark(bookmark);
await action();
};
React.useEffect(() => {
if (!loading) {
setSelectedBookmark(null);
}
}, [loading]);
return (
<Pressable
style={[
@ -123,7 +116,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme }) => {
]}
onPress={() =>
navigation.push(isContent ? "Blog" : "Product", {
id: isContent ? bookmark?.id : bookmark?.id,
id: isContent ? bookmark?.contentId : bookmark?.product?.bookId,
})
}
>
@ -164,46 +157,55 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme }) => {
fontSize: fontSize.tiny,
color: Colors.theme1[theme].gray20,
width: width / 3,
textAlign: "right",
}}
>
{isContent ? bookmark?.content?.name : bookmark.product.book.name}
{isContent
? bookmark?.content?.name
: bookmark?.product?.book?.name}
</Text>
{!isContent && (
{!isContent ? (
<Text
style={{
marginTop: 5,
fontFamily: "regular",
fontSize: fontSize.base,
fontSize: fontSize.sm,
color: Colors.theme1[theme].gray20,
}}
>
{"پایه" + " " + grades[bookmark?.product?.book?.gradeId]}
</Text>
)}
) : null}
</View>
</View>
<Pressable onPress={() => deleteItem({ id: bookmark.id })}>
<Svg
data-name="vuesax/linear/archive-add"
xmlns="http://www.w3.org/2000/svg"
width={29.778}
height={29.778}
{selectedBookmark === bookmark ? (
<ActivityIndicator color={Colors.theme1[theme].greenCF} size={30} />
) : (
<Pressable
onPress={() => deleteAction(deleteItem({ id: bookmark.id }))}
>
<Path
d="M20.869 2.482H8.908a4.8 4.8 0 0 0-4.789 4.789v17.483c0 2.233 1.6 3.176 3.561 2.1l6.055-3.362a2.628 2.628 0 0 1 2.32 0l6.055 3.362c1.96 1.092 3.561.149 3.561-2.1V7.271a4.819 4.819 0 0 0-4.802-4.789Z"
fill="#37a865"
/>
<Path
data-name="Vector"
d="M17.987 13.214h-6.2"
fill="none"
stroke="#fff"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
</Pressable>
<Svg
data-name="vuesax/linear/archive-add"
xmlns="http://www.w3.org/2000/svg"
width={29.778}
height={29.778}
>
<Path
d="M20.869 2.482H8.908a4.8 4.8 0 0 0-4.789 4.789v17.483c0 2.233 1.6 3.176 3.561 2.1l6.055-3.362a2.628 2.628 0 0 1 2.32 0l6.055 3.362c1.96 1.092 3.561.149 3.561-2.1V7.271a4.819 4.819 0 0 0-4.802-4.789Z"
fill="#37a865"
/>
<Path
data-name="Vector"
d="M17.987 13.214h-6.2"
fill="none"
stroke="#fff"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
</Pressable>
)}
</Pressable>
);
};
@ -214,11 +216,10 @@ const mapStateToProps = (state) => ({
bookmarkList: state.userFavorite.list,
loading: state.userFavorite.loading,
grades: state.publicApi.grades,
theme: state.publicApi.theme
theme: state.publicApi.theme,
});
const mapDispatchToProps = {
getList: userFavorite.list,
deleteItem: userFavorite.del,
};

@ -16,8 +16,7 @@ import Colors from "../../../constants/Colors";
//variables
const ios = Platform.OS === "ios";
const {width} = Dimensions.get("window");
const { width } = Dimensions.get("window");
const User = ({ user, mobile, theme }) => {
const [dropdown, setDropdown] = React.useState(true);
@ -75,7 +74,7 @@ const User = ({ user, mobile, theme }) => {
/>
</Svg>
</Pressable>
{dropdown && (
{dropdown ? (
<View style={tw(`flex flex-col pr-16 ${ios ? "items-end" : " "}`)}>
<Pressable
style={tw(`flex w-full ${mobile ? "mt-0" : "mt-4"}`)}
@ -117,7 +116,7 @@ const User = ({ user, mobile, theme }) => {
</View>
</Pressable>
</View>
)}
) : null}
</View>
);
};

@ -15,7 +15,6 @@ import Colors from "../../../constants/Colors";
const { width } = Dimensions.get("window");
function Tab({ data, theme }) {
const [dataType, setDataType] = useState("all");
@ -185,16 +184,16 @@ function Tab({ data, theme }) {
</TouchableOpacity>
</View>
<View style={tw("flex w-full p-4")}>
{dataType === "all" && (
{dataType === "all" ? (
<>
{data.voice && <Voice data={data.voice} />}
{data.video && <Video data={data.video} />}
{data.ppt && <PPT data={data.ppt} />}
{data.pdf && <PDF data={data.pdf} />}
{data.links && <Links data={data.links} />}
{data.voice ? <Voice data={data.voice} /> : null}
{data.video ? <Video data={data.video} /> : null}
{data.ppt ? <PPT data={data.ppt} /> : null}
{data.pdf ? <PDF data={data.pdf} /> : null}
{data.links ? <Links data={data.links} /> : null}
</>
)}
{dataType === "voice" && (
) : null}
{dataType === "voice" ? (
<>
{data.voice ? (
<Voice data={data.voice} />
@ -210,8 +209,8 @@ function Tab({ data, theme }) {
</Text>
)}
</>
)}
{dataType === "video" && (
) : null}
{dataType === "video" ? (
<>
{data.video ? (
<Video data={data.video} />
@ -227,8 +226,8 @@ function Tab({ data, theme }) {
</Text>
)}
</>
)}
{dataType === "ppt" && (
) : null}
{dataType === "ppt" ? (
<>
{data.ppt ? (
<PPT data={data.ppt} />
@ -244,8 +243,8 @@ function Tab({ data, theme }) {
</Text>
)}
</>
)}
{dataType === "pdf" && (
) : null}
{dataType === "pdf" ? (
<>
{data.pdf ? (
<PDF data={data.pdf} />
@ -261,8 +260,8 @@ function Tab({ data, theme }) {
</Text>
)}
</>
)}
{dataType === "links" && (
) : null}
{dataType === "links" ? (
<>
{data.links ? (
<Links data={data.links} />
@ -278,7 +277,7 @@ function Tab({ data, theme }) {
</Text>
)}
</>
)}
) : null}
</View>
</View>
);

@ -45,7 +45,7 @@ function QRContent({ route, getQrData, data, grades }) {
/>
<ScrollView
>
{data && <Content data={data} grades={grades} />}
{data ? <Content data={data} grades={grades} /> : null}
</ScrollView>
</SafeAreaView>
);

@ -20,10 +20,10 @@ function Code({ codeId, setCodeId, theme, loading }) {
const [value, setValue] = React.useState(codeId || "");
const [requestFlag, setRequestFlag] = React.useState(false);
const setOff = () => {
const setOff = React.useCallback(() => {
setRequestFlag(true);
setCodeId({ offCodeValue: value });
};
}, [requestFlag, value]);
React.useEffect(() => {
if (!loading) {
@ -43,7 +43,9 @@ function Code({ codeId, setCodeId, theme, loading }) {
]}
>
<TextInput
onChangeText={(text) => setValue(text = onInput.englishAndNumberWithoutSpace(text))}
onChangeText={(text) =>
setValue((text = onInput.englishAndNumberWithoutSpace(text)))
}
style={[
tw("border-0 flex-1 text-right pr-3"),
{ fontSize: fontSize.tiny, fontFamily: "regular" },
@ -67,7 +69,7 @@ function Code({ codeId, setCodeId, theme, loading }) {
<ActivityIndicator
size={fontSize.tiny}
color={Colors.theme1[theme].white}
style={tw('px-2')}
style={tw("px-2")}
/>
) : (
<Text

@ -21,9 +21,24 @@ import tw from "tailwind-rn";
const width = Dimensions.get("window").width;
const ios = Platform.OS === "ios";
function Product({ product, grades, pushToCart, loading, mobile, theme, addActionFlag, getList }) {
function Product({
product,
grades,
pushToCart,
loading,
mobile,
theme,
addActionFlag,
getList,
}) {
const [selectedProduct, setSelectedProduct] = React.useState(null);
const types = {
0: "نسخه دیجیتال",
1: "نسخه فیزیکی",
2: "نسخه ویدئویی",
};
const submit = async (action) => {
setSelectedProduct(product?.productId);
await action();
@ -35,237 +50,231 @@ function Product({ product, grades, pushToCart, loading, mobile, theme, addActio
}
}, [loading]);
return (
product && (
<View
style={[
tw(
`flex justify-between py-2 ${ios ? "flex-row" : "flex-row-reverse"}`
),
{
borderBottomWidth: 1,
borderColor: Colors.theme1[theme].grayE3,
direction: "rtl",
},
]}
>
<View style={tw(`flex ${ios ? "flex-row" : "flex-row-reverse"}`)}>
<Image
source={{
uri:
"https://dnvn.ir/api/v1/file/" + product.product.book.fileIds,
return product ? (
<View
style={[
tw(
`flex justify-between py-2 ${ios ? "flex-row" : "flex-row-reverse"}`
),
{
borderBottomWidth: 1,
borderColor: Colors.theme1[theme].grayE3,
direction: "rtl",
},
]}
>
<View style={tw(`flex ${ios ? "flex-row" : "flex-row-reverse"}`)}>
<Image
source={{
uri:
"https://dnvn.ir/api/v1/file/" + product?.product?.book?.fileIds,
}}
style={[
tw(""),
{
width: mobile ? width / 5 : width / 7,
height: ((mobile ? width / 5 : width / 7) * 4) / 2.8,
},
]}
/>
<View
style={tw(`flex ${ios ? "items-start pl-3" : "items-end pr-2"}`)}
>
<Text
style={{
fontSize: mobile ? fontSize.lg : fontSize.xl4,
color: Colors.theme1[theme].green79,
marginBottom: 5,
fontFamily: "bold",
}}
>
{product?.product?.book?.name || " "}
</Text>
<Text
style={{
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[theme].gray2077,
marginBottom: 3,
fontFamily: "regular",
}}
style={[
tw(""),
{
width: mobile ? width / 5 : width / 7,
height: ((mobile ? width / 5 : width / 7) * 4) / 2.8,
},
]}
/>
>
{"پایه" + " " + grades[product?.product?.book?.gradeId] || " "}
</Text>
<Text
style={{
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[theme].gray2077,
fontFamily: "regular",
}}
>
{types[product?.productType]}
</Text>
<View
style={tw(`flex ${ios ? "items-start pl-3" : "items-end pr-2"}`)}
style={tw(
`flex items-center justify-center mt-4 ${
ios ? "flex-row-reverse" : "flex-row"
}`
)}
>
<Text
style={{
fontSize: mobile ? fontSize.lg : fontSize.xl4,
color: Colors.theme1[theme].green79,
marginBottom: 5,
fontFamily: "bold",
}}
>
{product.product.book.name || " "}
</Text>
<Text
style={{
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[theme].gray2077,
marginBottom: 3,
fontFamily: "regular",
}}
style={[
{
fontSize: mobile ? fontSize.xs : fontSize.tiny,
fontFamily: "regular",
},
]}
>
{"پایه" + " " + grades[product.product.book.gradeId] || " "}
{" " + "تومان"}
</Text>
<Text
style={{
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[theme].gray2077,
fontFamily: "regular",
}}
style={[
{
fontSize: mobile ? fontSize.lg : fontSize.xl,
fontFamily: "regular",
},
]}
>
{product.productType || 1 === 2 ? "نسخه فیزیکی" : "نسخه دیجیتال"}
{separate(product?.product?.price) || " "}
</Text>
<View
style={tw(
`flex items-center justify-center mt-4 ${
ios ? "flex-row-reverse" : "flex-row"
}`
)}
</View>
</View>
</View>
<View
style={tw(`flex justify-between ${ios ? "items-end" : "items-start"}`)}
>
<AntDesign
name="close"
size={mobile ? 20 : 30}
color={Colors.theme1[theme].redFF1}
onPress={() =>
submit(
pushToCart(
{
productId: product?.productId,
userId: product?.userId,
count: product?.productType === 1 ? -1 : -product?.count,
},
{},
{ id: product?.factorId }
)
)
}
/>
<View style={tw("flex items-center mt-2")}>
<View
style={tw(
`flex items-center mb-3 ${ios ? "flex-row" : "flex-row-reverse"}`
)}
>
<Pressable
onPress={() =>
submit(
pushToCart({
productId: product?.productId,
userId: product?.userId,
count: 1,
})
)
}
style={[
tw(
`rounded-md py-0 flex flex-row justify-center items-center border ${
mobile ? "px-2" : "px-3"
}`
),
{
borderColor: Colors.theme1[theme].greenCF,
},
]}
>
<Text
style={[
{
fontSize: mobile ? fontSize.xs : fontSize.tiny,
fontFamily: "regular",
},
]}
style={{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
color: Colors.theme1[theme].greenCF,
fontFamily: "light",
}}
>
{" " + "تومان"}
+
</Text>
</Pressable>
{loading && selectedProduct === product?.productId ? (
<ActivityIndicator
style={tw("mx-2")}
size="small"
color={Colors.theme1[theme].greenBA}
/>
) : (
<Text
style={[
tw("mx-2.5"),
{
fontSize: mobile ? fontSize.lg : fontSize.xl,
fontFamily: "regular",
fontSize: fontSize.xl6,
color: Colors.theme1[theme].greenBA,
fontFamily: "bold",
},
]}
>
{separate(product.product.price) || " "}
{product?.count}
</Text>
</View>
</View>
</View>
<View
style={tw(
`flex justify-between ${ios ? "items-end" : "items-start"}`
)}
>
<AntDesign
name="close"
size={mobile ? 20 : 30}
color={Colors.theme1[theme].redFF1}
onPress={() =>
submit(
pushToCart(
{
productId: product.productId,
userId: product.userId,
count: product.productType === 1 ? -1 : -product?.count,
},
{},
{ id: product.factorId }
)
)
}
/>
<View style={tw("flex items-center mt-2")}>
<View
style={tw(
`flex items-center mb-3 ${
ios ? "flex-row" : "flex-row-reverse"
}`
)}
>
<Pressable
onPress={() =>
submit(
pushToCart({
productId: product.productId,
userId: product.userId,
count: 1,
})
)
}
style={[
tw(
`rounded-md py-0 flex flex-row justify-center items-center border ${
mobile ? "px-2" : "px-3"
}`
),
{
borderColor: Colors.theme1[theme].greenCF,
},
]}
>
<Text
style={{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
color: Colors.theme1[theme].greenCF,
fontFamily: "light",
}}
>
+
</Text>
</Pressable>
{(loading && selectedProduct === product.productId) ? (
<ActivityIndicator
style={tw("mx-2")}
size="small"
color={Colors.theme1[theme].greenBA}
/>
) : (
<Text
style={[
tw("mx-2.5"),
{
fontSize: fontSize.xl6,
color: Colors.theme1[theme].greenBA,
fontFamily: "bold",
},
]}
>
{product.count}
</Text>
)}
)}
<Pressable
onPress={() =>
submit(
pushToCart({
productId: product.productId,
userId: product.userId,
count: -1,
})
)
}
style={[
tw(
`rounded-md py-0 flex flex-row justify-center items-center border ${
mobile ? "px-2.5" : "px-3.5"
}`
),
{
borderColor: Colors.theme1[theme].greenCF,
},
]}
>
<Text
style={{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
color: Colors.theme1[theme].greenCF,
fontFamily: "bold",
}}
>
-
</Text>
</Pressable>
</View>
<View
style={tw(
`flex items-center justify-center ${
ios ? "flex-row-reverse" : "flex-row"
}`
)}
<Pressable
onPress={() =>
submit(
pushToCart({
productId: product?.productId,
userId: product?.userId,
count: -1,
})
)
}
style={[
tw(
`rounded-md py-0 flex flex-row justify-center items-center border ${
mobile ? "px-2.5" : "px-3.5"
}`
),
{
borderColor: Colors.theme1[theme].greenCF,
},
]}
>
<Text style={[{ fontSize: fontSize.sm, fontFamily: "regular" }]}>
{" " + "تومان"}
</Text>
<Text
style={[
{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
fontFamily: "regular",
},
]}
style={{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
color: Colors.theme1[theme].greenCF,
fontFamily: "bold",
}}
>
{separate(product.product.price * product.count) || " "}
-
</Text>
</View>
</Pressable>
</View>
<View
style={tw(
`flex items-center justify-center ${
ios ? "flex-row-reverse" : "flex-row"
}`
)}
>
<Text style={[{ fontSize: fontSize.sm, fontFamily: "regular" }]}>
{" " + "تومان"}
</Text>
<Text
style={[
{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
fontFamily: "regular",
},
]}
>
{separate(product?.product?.price * product?.count) || " "}
</Text>
</View>
</View>
</View>
)
);
</View>
) : null;
}
const mapStateToProps = (state) => ({
@ -277,7 +286,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = {
pushToCart: userProduct.add,
getList: userProduct.list
getList: userProduct.list,
};
export default connect(mapStateToProps, mapDispatchToProps)(Product);

@ -146,11 +146,10 @@ function ShoppingCart({
>
{list
?.sort((a, b) => a?.id - b?.id)
?.map(
(product, index) =>
product.condition < 2 && (
<Product key={index} product={product} loading={loading} />
)
?.map((product, index) =>
product.condition < 2 ? (
<Product key={index} product={product} loading={loading} />
) : null
)}
<Code />
<View

@ -29,7 +29,7 @@ const Season = ({
realSeasons,
seasonName,
mobile,
theme
theme,
}) => {
// const [selectedSeason, setSelectedSeason] = useState(null);
const navigation = useNavigation();
@ -138,10 +138,11 @@ const Season = ({
},
]}
>
{realSeasons?.length > 0 &&
realSeasons?.filter(
(item) => item?.id === season[0]?.categoryId
)[0]?.name}
{realSeasons?.length
? realSeasons?.filter(
(item) => item?.id === season[0]?.categoryId
)[0]?.name
: null}
</Text>
<SimpleLineIcons
name={
@ -151,10 +152,11 @@ const Season = ({
color={Colors.theme1[theme].green79}
/>
</View>
{season[0]?.categoryId === activeSeason &&
season?.map((unit, index) => (
<Unit unit={unit} key={index} index={index} />
))}
{season[0]?.categoryId === activeSeason
? season?.map((unit, index) => (
<Unit unit={unit} key={index} index={index} />
))
: null}
</Pressable>
</View>
);
@ -165,7 +167,7 @@ const mapStateToProps = (state) => ({
realSeasons: state.publicApi.bookInfo?.categories,
vodDuration: state.publicApi.bookInfo?.vodDuration,
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
theme: state.publicApi.theme,
});
const mapDispatchToProps = {

@ -106,7 +106,7 @@ function Product({
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
{!mobile && <View style={tw("mt-5")}></View>}
{!mobile ? <View style={tw("mt-5")}></View> : null}
<View style={[tw(" w-full flex ")]}>
<View
style={[
@ -161,7 +161,9 @@ function Product({
<Divider type={"vertical"} />
</View>
<CustomPressable
title={`خرید با قیمت ${separate(book?.product[2]?.price || ' ')} تومان`}
title={`خرید با قیمت ${separate(
book?.product[2]?.price || " "
)} تومان`}
backgroundColor={Colors.theme1[theme].greenCF}
color={"white"}
border={{ color: "#196EC0", width: 0 }}

@ -63,18 +63,16 @@ function VideoDisplay({ route, mobile, theme }) {
style={styles.container}
onLayout={() => setWidth(Dimensions.get("window").width)}
>
{!mobile && <View style={tw("mt-5")}></View>}
{!mobile ? <View style={tw("mt-5")}></View> : null}
<View style={tw("flex ")}>
<Video
ref={video}
style={{ width: "100%", height: (width * 9) / 16 - 16}}
style={{ width: "100%", height: (width * 9) / 16 - 16 }}
source={{
uri: `https://dnvn.ir/api/v1/file/${route.params.unit?.fileIds}`,
}}
useNativeControls
resizeMode="cover"
/>
<Text
style={{
@ -123,7 +121,7 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => ({
grades: state.publicApi.grades,
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
theme: state.publicApi.theme,
});
export default connect(mapStateToProps)(VideoDisplay);

@ -22,7 +22,7 @@ import NewestVideo from "./components/NewestVideo";
//assets
import tw from 'tailwind-rn';
import tw from "tailwind-rn";
function Videos({ grades, videos, getVideos, mobile }) {
const [search, setSearch] = useState("");
@ -61,14 +61,14 @@ function Videos({ grades, videos, getVideos, mobile }) {
contentContainerStyle={styles.contentContainerStyle}
style={[styles.container]}
>
{!mobile && <View style={tw("mt-5")}></View>}
{!mobile ? <View style={tw("mt-5")}></View> : null}
<Search
value={search}
onChange={setSearch}
placeholder={"نام کتاب یا دوره را جستجو کنید"}
/>
{/* <Divider type={"vertical"} /> */}
{videos.length > 0 && (
{videos.length ? (
<>
<MostViewedVideo videos={videos} grades={grades} />
<Divider type={"vertical"} />
@ -79,7 +79,7 @@ function Videos({ grades, videos, getVideos, mobile }) {
grades={grades}
/>
</>
)}
) : null}
</ScrollView>
</SafeAreaView>
);

Loading…
Cancel
Save