update 8 files

master
Reza_ashrafi 3 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;
switch (type) {
case "file/upload":
console.log(data, params);
return {
...state,
loading: false,

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

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

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

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

@ -70,81 +70,82 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => {
return filterOptions?.productType === "محصولات ویدیویی"
? bySearchFilter?.map((product, index) => (
<Pressable
style={[
{
width: mobile ? "auto" : width / 2.2,
borderWidth: 1,
borderColor:
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
},
tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`),
]}
key={index}
onPress={() => navigation.navigate("Video", { id: product.id })}
>
<View style={[tw("relative w-full mb-1")]}>
<Image
source={{
uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
}}
style={[
tw("w-full rounded-sm"),
{ height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 },
]}
/>
</View>
<></>
// <Pressable
// style={[
// {
// width: mobile ? "auto" : width / 2.2,
// borderWidth: 1,
// borderColor:
// Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
// },
// tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`),
// ]}
// key={index}
// onPress={() => navigation.navigate("Video", { id: product.id })}
// >
// <View style={[tw("relative w-full mb-1")]}>
// <Image
// source={{
// uri: `https://dnvn.ir/api/v1/file/${product?.fileIds}`,
// }}
// style={[
// tw("w-full rounded-sm"),
// { height: ((mobile ? width - 25 : width / 2.2) * 9) / 16 },
// ]}
// />
// </View>
<Text
style={[
tw("mb-1"),
{
fontFamily: "bold",
fontSize: mobile ? fontSize.lg : fontSize.base,
color:
theme === "light"
? Colors.theme1.gray20
: Colors.theme1.white,
textAlign: ios ? "right" : "auto",
},
]}
>
{"دوره ویدئویی" + " " + product?.name}
</Text>
<Text
style={[
tw("mb-4"),
{
fontSize: mobile ? fontSize.tiny : fontSize.sm,
fontFamily: "regular",
color: Colors.theme1.greenBA,
textAlign: ios ? "right" : "auto",
},
]}
>
{"پایه" + " " + grades[product?.gradeId]}
</Text>
<Text
style={[
tw("w-full flex flex-row text-left"),
{
fontSize: mobile ? fontSize.xl : fontSize.lg,
fontFamily: "bold",
color:
theme === "light"
? Colors.theme1.gray20
: Colors.theme1.white,
},
]}
>
{separate(
product?.product?.filter(
(product) => product?.productType === 4
)[0].price
)}{" "}
<Text style={{ fontSize: fontSize.sm }}>تومان</Text>
</Text>
</Pressable>
// <Text
// style={[
// tw("mb-1"),
// {
// fontFamily: "bold",
// fontSize: mobile ? fontSize.lg : fontSize.base,
// color:
// theme === "light"
// ? Colors.theme1.gray20
// : Colors.theme1.white,
// textAlign: ios ? "right" : "auto",
// },
// ]}
// >
// {"دوره ویدئویی" + " " + product?.name}
// </Text>
// <Text
// style={[
// tw("mb-4"),
// {
// fontSize: mobile ? fontSize.tiny : fontSize.sm,
// fontFamily: "regular",
// color: Colors.theme1.greenBA,
// textAlign: ios ? "right" : "auto",
// },
// ]}
// >
// {"پایه" + " " + grades[product?.gradeId]}
// </Text>
// <Text
// style={[
// tw("w-full flex flex-row text-left"),
// {
// fontSize: mobile ? fontSize.xl : fontSize.lg,
// fontFamily: "bold",
// color:
// theme === "light"
// ? Colors.theme1.gray20
// : Colors.theme1.white,
// },
// ]}
// >
// {separate(
// product?.product?.filter(
// (product) => product?.productType === 4
// )[0].price
// )}{" "}
// <Text style={{ fontSize: fontSize.sm }}>تومان</Text>
// </Text>
// </Pressable>
))
: bySearchFilter?.map((product, index) => (
<React.Fragment key={index}>
@ -205,7 +206,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => {
: Colors.theme1.white,
}}
>
{ product?.name}
{product?.name}
</Text>
<Text
style={{
@ -220,119 +221,8 @@ const Main = ({ books, filterOptions, grades, mobile, theme, orientation }) => {
{"پایه" + " " + grades[product?.gradeId]}
</Text>
</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>
) : 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>
));
};

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

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