update 8 files

master
Reza_ashrafi 2 years ago
parent 0b07adff44
commit 1d872ac88b
  1. 1
      src/redux/reducers/file.js
  2. 5
      src/screens/Address/index.js
  3. 13
      src/screens/Home/components/MyBooks.js
  4. 3
      src/screens/Home/index.js
  5. 6
      src/screens/Otp/index.js
  6. 262
      src/screens/Products/components/Main.js
  7. 1
      src/screens/Videos/components/MostViewedVideo.js
  8. 1200
      yarn-error.log

@ -7,7 +7,6 @@ export default function file(state = initialState, action) {
let { type, data, params } = action; let { type, data, params } = action;
switch (type) { switch (type) {
case "file/upload": case "file/upload":
console.log(data, params);
return { return {
...state, ...state,
loading: false, loading: false,

@ -22,6 +22,7 @@ import { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
import Navbar from "../../components/Navbar"; import Navbar from "../../components/Navbar";
import CustomPressable from "../../components/Pressable"; import CustomPressable from "../../components/Pressable";
import CustomTextInput from "../../components/CustomTextInput"; import CustomTextInput from "../../components/CustomTextInput";
import MapSelector from "../../components/MapSelector";
import Select from "../../components/Select"; import Select from "../../components/Select";
//style //style
@ -552,7 +553,9 @@ const Address = ({
</View> </View>
{!profilePage ? ( {!profilePage ? (
<> <>
{/* */} <View style={{ width : '100%', height : height / 4 }}>
<MapSelector setAddress={(text) => setMapAddress(text)} />
</View>
<TextInput <TextInput
style={[ style={[
tw("w-full mt-4 py-4 px-2 rounded-sm h-40"), tw("w-full mt-4 py-4 px-2 rounded-sm h-40"),

@ -60,7 +60,6 @@ function MyBooks({ books, grades, theme, mobile }) {
> >
کتابهای من کتابهای من
</Text> </Text>
<FlatList <FlatList
showsHorizontalScrollIndicator={false} showsHorizontalScrollIndicator={false}
style={[tw("py-3")]} style={[tw("py-3")]}
@ -189,7 +188,10 @@ const Book = ({ book, grades, theme, mobile }) => {
/> />
<View style={tw("flex items-center")}></View> <View style={tw("flex items-center")}></View>
<Pressable <Pressable
onPress={() => navigation.push("QR", { page: "activation" })} onPress={() => {
setOpenModal(!openModal);
navigation.push("QR", { page: "activation" });
}}
style={{ style={{
backgroundColor: Colors.theme1.greenD9, backgroundColor: Colors.theme1.greenD9,
color: "white", color: "white",
@ -210,11 +212,12 @@ const Book = ({ book, grades, theme, mobile }) => {
</Text> </Text>
</Pressable> </Pressable>
<Pressable <Pressable
onPress={() => onPress={() => {
setOpenModal(!openModal);
Linking.openURL( Linking.openURL(
`https://ar.dnvn.ir/lunch?id=${book?.product?.ARId}` `https://ar.dnvn.ir/lunch?id=${book?.product?.ARId}`
) );
} }}
style={{ style={{
backgroundColor: Colors.theme1.gray2077, backgroundColor: Colors.theme1.gray2077,
color: "white", color: "white",

@ -30,6 +30,7 @@ import tw from "tailwind-rn";
const { width, height } = Dimensions.get("window"); const { width, height } = Dimensions.get("window");
const Home = ({ const Home = ({
theme,
route, route,
blogs, blogs,
books, books,
@ -73,6 +74,7 @@ const Home = ({
getFirstLogin(); getFirstLogin();
}, []); }, []);
return ( return (
<SafeAreaView style={styles.safeStyle}> <SafeAreaView style={styles.safeStyle}>
<Navbar <Navbar
@ -132,6 +134,7 @@ const mapStateToProps = (state) => ({
userProducts: state.userProduct.list, userProducts: state.userProduct.list,
mobile: state.publicApi.isMobile, mobile: state.publicApi.isMobile,
bottomNavigation: state.config.bottomNavigation, bottomNavigation: state.config.bottomNavigation,
theme: state.publicApi.theme,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -111,6 +111,12 @@ function Otp(props) {
} }
}; };
React.useEffect(() => {
if(firstCode && secondCode && thirdCode && fourthCode) {
submit();
}
},[firstCode, secondCode, thirdCode, fourthCode]);
useEffect(() => { useEffect(() => {
ref1.focus(); ref1.focus();
}, []); }, []);

@ -70,81 +70,82 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => {
return filterOptions?.productType === "محصولات ویدیویی" return filterOptions?.productType === "محصولات ویدیویی"
? bySearchFilter?.map((product, index) => ( ? bySearchFilter?.map((product, index) => (
<Pressable <></>
style={[ // <Pressable
{ // style={[
width: mobile ? "auto" : width / 2.2, // {
borderWidth: 1, // width: mobile ? "auto" : width / 2.2,
borderColor: // borderWidth: 1,
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), // borderColor:
}, // Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`), // },
]} // tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`),
key={index} // ]}
onPress={() => navigation.navigate("Video", { id: product.id })} // key={index}
> // onPress={() => navigation.navigate("Video", { id: product.id })}
<View style={[tw("relative w-full mb-1")]}> // >
<Image // <View style={[tw("relative w-full mb-1")]}>
source={{ // <Image
uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`, // source={{
}} // uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
style={[ // }}
tw("w-full rounded-sm"), // style={[
{ height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 }, // tw("w-full rounded-sm"),
]} // { height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 },
/> // ]}
</View> // />
// </View>
<Text // <Text
style={[ // style={[
tw("mb-1"), // tw("mb-1"),
{ // {
fontFamily: "bold", // fontFamily: "bold",
fontSize: mobile ? fontSize.lg : fontSize.base, // fontSize: mobile ? fontSize.lg : fontSize.base,
color: // color:
theme === "light" // theme === "light"
? Colors.theme1.gray20 // ? Colors.theme1.gray20
: Colors.theme1.white, // : Colors.theme1.white,
textAlign: ios ? "right" : "auto", // textAlign: ios ? "right" : "auto",
}, // },
]} // ]}
> // >
{"دوره ویدئویی" + " " + product?.name} // {"دوره ویدئویی" + " " + product?.name}
</Text> // </Text>
<Text // <Text
style={[ // style={[
tw("mb-4"), // tw("mb-4"),
{ // {
fontSize: mobile ? fontSize.tiny : fontSize.sm, // fontSize: mobile ? fontSize.tiny : fontSize.sm,
fontFamily: "regular", // fontFamily: "regular",
color: Colors.theme1.greenBA, // color: Colors.theme1.greenBA,
textAlign: ios ? "right" : "auto", // textAlign: ios ? "right" : "auto",
}, // },
]} // ]}
> // >
{"پایه" + " " + grades[product?.gradeId]} // {"پایه" + " " + grades[product?.gradeId]}
</Text> // </Text>
<Text // <Text
style={[ // style={[
tw("w-full flex flex-row text-left"), // tw("w-full flex flex-row text-left"),
{ // {
fontSize: mobile ? fontSize.xl : fontSize.lg, // fontSize: mobile ? fontSize.xl : fontSize.lg,
fontFamily: "bold", // fontFamily: "bold",
color: // color:
theme === "light" // theme === "light"
? Colors.theme1.gray20 // ? Colors.theme1.gray20
: Colors.theme1.white, // : Colors.theme1.white,
}, // },
]} // ]}
> // >
{separate( // {separate(
product?.product?.filter( // product?.product?.filter(
(product) => product?.productType === 4 // (product) => product?.productType === 4
)[0].price // )[0].price
)}{" "} // )}{" "}
<Text style={{ fontSize: fontSize.sm }}>تومان</Text> // <Text style={{ fontSize: fontSize.sm }}>تومان</Text>
</Text> // </Text>
</Pressable> // </Pressable>
)) ))
: bySearchFilter?.map((product, index) => ( : bySearchFilter?.map((product, index) => (
<React.Fragment key={index}> <React.Fragment key={index}>
@ -205,7 +206,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => {
: Colors.theme1.white, : Colors.theme1.white,
}} }}
> >
{ product?.name} {product?.name}
</Text> </Text>
<Text <Text
style={{ style={{
@ -220,119 +221,8 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => {
{"پایه" + " " + grades[product?.gradeId]} {"پایه" + " " + grades[product?.gradeId]}
</Text> </Text>
</View> </View>
{/* <View
style={tw(
"flex flex-row-reverse items-center justify-center pb-1 mt-3"
)}
>
<Text
style={[
tw("text-center ml-1"),
{
color:
theme === "light"
? Colors.theme1.gray20
: Colors.theme1.white,
fontFamily: "bold",
fontSize: mobile ? fontSize.xl2 : fontSize.lg,
},
]}
>
{separate(
product?.product?.filter(
(product) => product?.productType === 1
)[0]?.price
)}
</Text>
<Text
style={{
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.gray20
: Colors.theme1.white,
fontFamily: "regular",
}}
>
تومان
</Text>
</View> */}
</Pressable> </Pressable>
) : null} ) : null}
{/* {(
productType
? productType === ("محصولات فیزیکی" || "همه محصولات")
: true
) ? (
<Pressable
key={product?.product[1]?.id}
style={[
{
width: mobile
? width / 2 - 25
: orientation === "portrait"
? width / 4.2
: width / 5.2,
marginBottom: 15,
borderWidth: 1,
borderColor:
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
},
tw("flex justify-between px-2 pt-2 rounded-md"),
]}
onPress={() =>
navigation.navigate("Product", {
id: product?.id,
type: "book",
})
}
>
<View style={tw("w-full flex")}>
<Image
source={{
uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
}}
resizeMode="contain"
style={[
tw("rounded-sm"),
{
flex: 1,
height: mobile
? ((width / 2 - 25) * 4) / 2.9
: ((width / 3.2) * 16) / 16,
},
]}
/>
<Text
style={{
fontSize: mobile ? fontSize.base : fontSize.tiny,
marginTop: 5,
color:
theme === "light"
? Colors.theme1.gray20
: Colors.theme1.white,
fontFamily: "bold",
width: "100%",
textAlign: ios ? "right" : "auto",
}}
>
{"کتاب فیزیکی" + " " + product?.name}
</Text>
<Text
style={{
color: Colors.theme1.greenBA,
fontSize: mobile ? fontSize.tiny : fontSize.sm,
marginTop: 5,
fontFamily: "regular",
width: "100%",
textAlign: ios ? "right" : "auto",
}}
>
{"پایه" + " " + grades[product?.gradeId]}
</Text>
</View>
</Pressable>
) : null} */}
</React.Fragment> </React.Fragment>
)); ));
}; };

@ -142,7 +142,6 @@ function MostViewedVideo({ videos, grades, mobile, theme }) {
<Header <Header
title="پربازدیدترین" title="پربازدیدترین"
route={"Products"} route={"Products"}
state={{ productType: "دوره ویدئویی" }}
/> />
</View> </View>
<FlatList <FlatList

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save