update 17 files

master
Reza_ashrafi 3 years ago
parent 9ccfb80304
commit c10d14f827
  1. 4
      src/redux/actions/config.js
  2. 1
      src/redux/proxy.js
  3. 11
      src/redux/reducers/config.js
  4. 2
      src/redux/reducers/file.js
  5. 554
      src/screens/Product/components/Book.js
  6. 6
      src/screens/Product/index.js
  7. 4
      src/screens/Profile/components/User.js
  8. 5
      src/screens/Splash/index.js
  9. 27
      src/screens/Video/components/Season.js
  10. 45
      src/screens/Video/index.js
  11. 1
      src/screens/VideoDisplay/components/Season/index.js
  12. 20
      src/screens/VideoDisplay/index.js
  13. 24
      src/screens/Videos/components/MostViewedVideo.js
  14. 2
      src/screens/Videos/components/NewestVideo.js
  15. 1
      src/screens/Videos/index.js

@ -9,6 +9,10 @@ const config = {
(data = {}) =>
async (dispatch) =>
await proxy.get("config/filters", data, { dispatch }),
getAvailableForSell:
(data = {}) =>
async (dispatch) =>
await proxy.get("config/availableForSell", data, { dispatch }),
};
export default config;

@ -60,6 +60,7 @@ class Proxy {
dispatch = dispatch || (() => {});
dispatch({ type: url.split("/")[0] + "/" + "loading" });
let response = await fetch();
// console.log(response);
switch (response.status) {
case 200:
dispatch({ type: url, data: response.data.data, params });

@ -2,6 +2,7 @@ const initialState = {
loading: false,
error: null,
bottomNavigation: null,
availableForSell: [],
};
export default function config(state = initialState, action) {
@ -14,6 +15,14 @@ export default function config(state = initialState, action) {
bottomNavigation: data.bottomNavigationList,
error: null,
};
case "config/availableForSell":
console.log(data);
return {
...state,
loading: false,
availableForSell: data.productTypes,
error: null,
};
case "config/loading":
return { ...state, loading: true };
case "config/error":
@ -21,4 +30,4 @@ export default function config(state = initialState, action) {
default:
return state;
}
}
}

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

@ -18,7 +18,6 @@ import separate from "../../../utils/separate";
//components
import LinkBox from "./LinkBox";
import Comments from "./Comments";
import ImageSlider from "../../../components/ImageSlider";
import Rates from "./Rates";
//style
@ -39,20 +38,23 @@ function Book({
userProducts,
theme,
orientation,
availableForSell,
}) {
const [width, setWidth] = React.useState(Dimensions.get("window").width);
const navigation = useNavigation();
const [type, setType] = useState(1);
const [whichTypeAdded, setWhichTypeAdded] = React.useState(null);
const [pageLoading, setPageLoading] = useState(false);
const [imageSlider, setImageSlider] = useState(false);
useEffect(() => {
setPageLoading(true);
setTimeout(() => {
setPageLoading(false);
}, 500);
}, [type]);
const physicalAvailableForSell = React.useMemo(() => {
return availableForSell?.filter((product) => product === 2)?.length;
}, [availableForSell]);
const digitalAvailableForSell = React.useMemo(() => {
return availableForSell?.filter((product) => product === 1)?.length;
}, [availableForSell]);
const videoAvailableForSell = React.useMemo(() => {
return availableForSell?.filter((product) => product === 4)?.length;
}, [availableForSell]);
const physicalProduct = React.useMemo(() => {
return book?.product?.filter((product) => product?.productType === 2)[0];
@ -134,6 +136,144 @@ function Book({
}
}, [userProducts]);
const ProductButton = ({
availableInCart,
availableForSell,
product,
type,
onLoad,
title,
sample,
sampleAction,
}) => {
return product ? (
<View style={tw("w-full flex flex-row-reverse justify-between")}>
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
availableInCart
? asyncAwesomeAlert(
"",
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
)
: availableForSell
? addToCart(
pushToCart({
productId: product?.id,
userId: userId,
count: 1,
}),
type
)
: null
}
>
<>
{onLoad ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4,
}}
>
{title}
</Text>
)}
<View style={tw("flex flex-row-reverse items-center")}>
<View style={tw("w-px h-full bg-green-300")}></View>
<View style={tw("flex")}>
<Text
style={[
tw("py-1 pr-2"),
{
fontFamily: "bold",
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
fontSize: fontSize.sm,
},
]}
>
{availableForSell
? (separate(product?.price) || " ") + " " + "تومان"
: "ناموجود"}
</Text>
</View>
</View>
</>
</TouchableHighlight>
{sample ? (
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: fontSize.sm * 6 + 18,
},
]}
onPress={() => sampleAction()}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.xs,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4,
}}
>
مشاهده نمونه
</Text>
</TouchableHighlight>
) : null}
</View>
) : null;
};
return (
<View
style={[tw("flex flex-1 relative")]}
@ -263,360 +403,61 @@ function Book({
}}
>
{" "}
{4.8 + "\n" + "امتیاز"}
{book?.rate || 4 + "\n" + "امتیاز"}
</Text>
</View>
</View>
{book?.product?.length > 1 ? (
<View style={"flex mt-8"}>
<Text
style={[
tw("w-full text-right"),
{
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.white,
<Text
style={[
tw("w-full text-right"),
{
color:
theme === "light" ? Colors.theme1.green79 : Colors.theme1.white,
fontSize: mobile ? fontSize.tiny : fontSize.base,
fontFamily: "demi",
},
]}
>
نسخه محصول را انتخاب کنید
</Text>
<View style={tw("flex justify-between")}></View>
</View>
fontSize: mobile ? fontSize.tiny : fontSize.base,
fontFamily: "demi",
},
]}
>
نسخه محصول را انتخاب کنید
</Text>
) : null}
<View style={tw("flex flex-row-reverse justify-between flex-wrap py-3")}>
{physicalProduct ? (
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
physicalAvailabileInCart
? asyncAwesomeAlert(
"",
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
)
: addToCart(
pushToCart({
productId: physicalProduct?.id,
userId: userId,
count: 1,
}),
"physical"
)
}
>
<>
{whichTypeAdded === "physical" && userProductsLoading ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4,
}}
>
خرید نسخه فیزیکی کتاب
</Text>
)}
<View style={tw("flex flex-row-reverse items-center")}>
<View style={tw("w-px h-full bg-green-300")}></View>
<View style={tw("flex")}>
<Text
style={[
tw("py-1 pr-2"),
{
fontFamily: "bold",
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
fontSize: fontSize.sm,
},
]}
>
{(separate(physicalProduct?.price) || " ") + " " + "تومان"}
</Text>
</View>
</View>
</>
</TouchableHighlight>
) : null}
{physicalProduct ? (
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: fontSize.sm * 6 + 18,
},
]}
onPress={() =>
navigation.push("Sample", { id: book?.sampleFileId })
}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.xs,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4,
}}
>
مشاهده نمونه
</Text>
</TouchableHighlight>
) : null}
{digitalProduct ? (
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
digitalAvailabileInCart
? asyncAwesomeAlert(
"",
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
)
: addToCart(
pushToCart({
productId: digitalProduct?.id,
userId: userId,
count: 1,
}),
"digital"
)
}
>
<>
{whichTypeAdded === "digital" && userProductsLoading ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4,
}}
>
خرید نسخه دیجیتال کتاب
</Text>
)}
<View style={tw("flex")}>
<Text
style={[
tw("py-1 pr-2"),
{
borderRightWidth: 1,
borderColor: Colors.theme1.greenCF,
fontFamily: "bold",
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
fontSize: fontSize.sm,
},
]}
>
{(separate(digitalProduct?.price) || " ") + " " + "تومان"}
</Text>
</View>
</>
</TouchableHighlight>
) : null}
{digitalProduct ? (
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: fontSize.sm * 6 + 18,
},
]}
onPress={() => navigation.navigate("Video", { id: book?.id })}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.xs,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4,
}}
>
پیش نمایش
</Text>
</TouchableHighlight>
) : null}
{videoProduct ? (
<TouchableHighlight
underlayColor={Colors.theme1.greenFF + "22"}
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1.greenCF,
backgroundColor:
theme === "light" ? Colors.theme1.greenFF + "0a" : null,
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
videoAvailabileInCart
? asyncAwesomeAlert(
"",
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
)
: addToCart(
pushToCart({
productId: videoProduct?.id,
userId: userId,
count: 1,
}),
"video"
)
}
>
<>
{whichTypeAdded === "video" && userProductsLoading ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
<View style={tw("mt-4")}>
<ProductButton
product={physicalProduct}
availableForSell={physicalAvailableForSell}
availableInCart={physicalAvailabileInCart}
type="physical"
onLoad={whichTypeAdded === "physical" && userProductsLoading}
title="خرید نسخه فیزیکی کتاب"
sample={true}
sampleAction={() =>
navigation.push("Sample", { id: book?.sampleFileId })
}
/>
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"),
{
fontFamily: "bold",
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
<ProductButton
product={videoProduct}
availableInCart={videoAvailabileInCart}
availableForSell={videoAvailableForSell}
type="video"
onLoad={whichTypeAdded === "video" && userProductsLoading}
title="خرید نسخه ویدئویی کتاب"
sample={true}
sampleAction={() => navigation.navigate("Video", { id: book?.id })}
/>
fontSize: fontSize.sm,
},
]}
>
{(separate(videoProduct?.price) || " ") + " " + "تومان"}
</Text>
</View>
</>
</TouchableHighlight>
) : null}
<ProductButton
product={digitalProduct}
availableInCart={digitalAvailabileInCart}
availableForSell={digitalAvailableForSell}
type="digital"
onLoad={whichTypeAdded === "digital" && userProductsLoading}
title="خرید نسخه دیجیتال کتاب"
sample={false}
sampleAction={() => {}}
/>
</View>
{book?.text ? (
<LinkBox
@ -699,6 +540,7 @@ const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
orientation: state.publicApi.orientation,
theme: state.publicApi.theme,
availableForSell: state.config.availableForSell,
});
const mapDispatchToProps = {

@ -9,14 +9,15 @@ import {
KeyboardAvoidingView,
} from "react-native";
import Book from "./components/Book";
import { book } from "../../redux/actions";
import { book, config } from "../../redux/actions";
import { connect } from "react-redux";
import Navbar from "../../components/Navbar";
const { height, width } = Dimensions.get("window");
function Product({ route, book, getBook, grades }) {
function Product({ route, book, getBook, grades, getAvailableForSell }) {
useEffect(() => {
getAvailableForSell();
getBook({ id: route.params.id, vod: true });
}, []);
@ -69,6 +70,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = {
getBook: book.info,
getAvailableForSell: config.getAvailableForSell
};
export default connect(mapStateToProps, mapDispatchToProps)(Product);

@ -31,9 +31,7 @@ const User = ({ user, mobile, theme, upload }) => {
quality: 1,
});
console.log(result);
upload(result);
upload({file : result, name : 'file'});
if (!result.cancelled) {
setImage(result.uri);

@ -4,7 +4,6 @@ import {
Image,
ActivityIndicator,
Dimensions,
BackHandler,
StatusBar,
} from "react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";
@ -16,7 +15,6 @@ import {
publicApi,
config,
} from "../../redux/actions";
import { useIsFocused } from "@react-navigation/native";
import Logo from "../../assets/images/logo.png";
@ -87,6 +85,7 @@ function Splash({
alignItems: "center",
flex: 1,
display: "flex",
backgroundColor : 'white'
}}
>
<View style={{ height: (width * 0.7 * 2) / 3 }}>
@ -101,7 +100,7 @@ function Splash({
</View>
<ActivityIndicator
size={"large"}
color={theme === "light" ? Colors.theme1.dark : Colors.theme1.white}
color={Colors.theme1.dark}
style={{ marginTop: 20 }}
/>
</View>

@ -1,6 +1,7 @@
import React from "react";
import { View, Text, Pressable, Appearance } from "react-native";
import { SimpleLineIcons } from "@expo/vector-icons";
import { asyncAwesomeAlert } from "../../../utils/AsyncWrappers";
import { connect } from "react-redux";
import { publicApi } from "../../../redux/actions";
import { useNavigation } from "@react-navigation/native";
@ -24,6 +25,7 @@ const duration = (value) => {
const Season = ({
season,
videoBuyed,
toggle,
activeSeason,
realSeasons,
@ -89,7 +91,11 @@ const Season = ({
Number(index) === 0
? Colors.theme1.greenCF
: theme === "light"
? Colors.theme1.gray2077
? videoBuyed
? Colors.theme1.greenCF
: Colors.theme1.gray2077
: videoBuyed
? Colors.theme1.greenCF
: Colors.theme1.white + "66",
},
]}
@ -99,8 +105,19 @@ const Season = ({
season: season,
unit: unit,
name: seasonName,
videoBuyed: videoBuyed,
})
: videoBuyed
? navigation.navigate("VideoDisplay", {
season: season,
unit: unit,
name: seasonName,
videoBuyed: videoBuyed,
})
: asyncAwesomeAlert("خطا", "ابتدا دوره را خریداری کنید", {
showCancelButton: false,
confirmText: "باشه",
})
: {}
}
>
<Text
@ -113,7 +130,11 @@ const Season = ({
Number(index) === 0
? Colors.theme1.greenCF
: theme === "light"
? Colors.theme1.gray2077
? videoBuyed
? Colors.theme1.greenCF
: Colors.theme1.gray2077
: videoBuyed
? Colors.theme1.greenCF
: Colors.theme1.white + "66",
}}
>

@ -13,7 +13,7 @@ import {
} from "react-native";
import { useNavigation } from "@react-navigation/native";
import { connect } from "react-redux";
import { publicApi, userProduct } from "../../redux/actions";
import { publicApi, userProduct, config } from "../../redux/actions";
import separate from "../../utils/separate";
import { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
@ -44,11 +44,15 @@ function Product({
mobile,
theme,
userProducts,
getAvailableForSell,
availableForSell,
}) {
const [position, setPosition] = useState("100%");
const navigation = useNavigation();
const [addedFlag, setAddedFlag] = React.useState(false);
useEffect(() => {
getAvailableForSell();
getBook({ bookId: route.params.id }, { id: route.params.id, vod: true });
}, []);
@ -57,12 +61,29 @@ function Product({
setPosition(position === "100%" ? "0%" : "100%");
};
const videoProduct = React.useMemo(() => {
return book?.product?.filter((product) => product?.productType === 4)[0];
}, [book]);
const videoAvailabileInCart = React.useMemo(() => {
return userProducts?.filter(
(product) => product?.productId === book?.product[2]?.id
)[0];
(product) =>
product?.productId === videoProduct?.id && product?.condition < 2
)?.length;
}, [userProducts, book]);
const videoBuyed = React.useMemo(() => {
return userProducts?.filter(
(product) =>
product?.productId === videoProduct?.id && product?.condition >= 2
)?.length;
}, [userProducts, book]);
const videoAvailableForSell = React.useMemo(() => {
return availableForSell?.filter((product) => product === 4)?.length;
}, [availableForSell]);
const addToCart = React.useCallback(
async (action) => {
setAddedFlag(true);
@ -170,9 +191,13 @@ function Product({
<Divider type={"vertical"} />
</View>
<CustomPressable
title={`خرید با قیمت ${separate(
book?.product[2]?.price || " "
)} تومان`}
title={
videoAvailableForSell
? `خرید با قیمت ${separate(
book?.product[2]?.price || " "
)} تومان`
: "ناموجود"
}
backgroundColor={Colors.theme1.greenCF}
color={"white"}
border={{ color: "#196EC0", width: 0 }}
@ -193,13 +218,15 @@ function Product({
cancelText: "ادامه خرید",
}
)
: addToCart(
: videoAvailableForSell
? addToCart(
pushToCart({
productId: book?.product[2]?.id,
userId: userId,
count: 1,
})
)
: null
}
/>
</View>
@ -207,7 +234,7 @@ function Product({
{seasons
?.sort((a, b) => a[0]?.categoryId - b[0]?.categoryId)
?.map((season, index) => (
<Season season={season} key={index} id={book?.id} index={index} />
<Season season={season} key={index} id={book?.id} index={index} videoBuyed={videoBuyed} />
))}
</View>
</ScrollView>
@ -235,10 +262,12 @@ const mapStateToProps = (state) => ({
loading: state.userProduct.loading,
mobile: state.publicApi.mobile,
theme: state.publicApi.theme,
availableForSell: state.config.availableForSell,
});
const mapDispatchToProps = {
getBook: publicApi.bookInfo,
pushToCart: userProduct.add,
getAvailableForSell: config.getAvailableForSell,
};
export default connect(mapStateToProps, mapDispatchToProps)(Product);

@ -30,6 +30,7 @@ const Season = ({
setVideoActive,
mobile,
theme,
videoBuyed,
}) => {
const navigation = useNavigation();

@ -28,7 +28,6 @@ import Colors from "../../constants/Colors";
const ios = Platform.OS === "ios";
function VideoDisplay({ route, mobile, theme }) {
const video = React.useRef(null);
const [width, setWidth] = useState(Dimensions.get("window").width);
@ -42,7 +41,9 @@ function VideoDisplay({ route, mobile, theme }) {
const onFullscreenUpdate = async ({ fullscreenUpdate }) => {
if (fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_DID_PRESENT) {
await ScreenOrientation.unlockAsync();
} else if (fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS) {
} else if (
fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS
) {
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.PORTRAIT
);
@ -95,7 +96,7 @@ function VideoDisplay({ route, mobile, theme }) {
style={{
fontSize: fontSize.xl,
fontFamily: "bold",
marginTop: mobile ? 8 : 12,
marginTop: mobile ? 20 : 12,
color:
theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white,
textAlign: "right",
@ -113,11 +114,14 @@ function VideoDisplay({ route, mobile, theme }) {
>
<Divider type={"vertical"} />
</View>
<Season
season={route.params.season}
activeUnit={route.params.unit}
name={route.params.name}
/>
{route?.params?.videoBuyed ? (
<Season
season={route.params.season}
videoBuyed={route.params.videoBuyed}
activeUnit={route.params.unit}
name={route.params.name}
/>
) : null}
</View>
</ScrollView>
</SafeAreaView>

@ -52,9 +52,7 @@ function MostViewedVideo({ videos, grades, mobile, theme }) {
source={{ uri: `https://dnvn.ir/api/v1/file/${video.fileIds}` }}
resizeMode="contain"
style={[
tw(
`rounded-sm h-full absolute left-2`
),
tw(`rounded-sm h-full absolute left-2`),
{
width: mobile ? 70 : 105,
height: mobile ? 110 : 150,
@ -110,7 +108,11 @@ function MostViewedVideo({ videos, grades, mobile, theme }) {
},
]}
>
{separate(video?.product?.filter((product) => product?.productType === 4)[0]?.price)}
{separate(
video?.product?.filter(
(product) => product?.productType === 4
)[0]?.price
)}
</Text>
</View>
@ -136,16 +138,18 @@ function MostViewedVideo({ videos, grades, mobile, theme }) {
return (
<View style={tw("w-full flex w-full mt-3")}>
<Header
title="پربازدیدترین"
route={"Products"}
state={{ productType: "دوره ویدئویی" }}
/>
<View style={tw('pl-4 pr-4')}>
<Header
title="پربازدیدترین"
route={"Products"}
state={{ productType: "دوره ویدئویی" }}
/>
</View>
<FlatList
showsHorizontalScrollIndicator={false}
horizontal={true}
inverted={true}
style={tw("pb-1.5 mt-3 flex flex-row w-full")}
style={tw("pb-1.5 px-4 mt-3 flex flex-row w-full")}
data={videos.slice(0, 7)}
renderItem={({ item }) => <Video video={item} />}
keyExtractor={(item) => item.id}

@ -70,7 +70,7 @@ const NewestVideo = ({ videos, grades, mobile, theme }) => {
);
};
return (
<View style={tw("w-full flex w-full")}>
<View style={tw("w-full flex w-full px-4")}>
<Header title="جدیدترین دورهها" route="" />
<View
style={tw(

@ -93,7 +93,6 @@ const styles = StyleSheet.create({
container: {
flexDirection: "column",
paddingVertical: 0,
paddingHorizontal: 16,
},
});

Loading…
Cancel
Save