reza added loading to product button

master
Reza_ashrafi 3 years ago
parent da3341e43b
commit f9b9bbfdd5
  1. 2
      App.js
  2. 101
      src/screens/Product/components/Book.js
  3. 4
      src/screens/ShoppingCart/components/Product.js

@ -8,8 +8,6 @@ import { store, persistor } from "./src/redux/store";
import React from "react"; import React from "react";
import { PersistGate } from "redux-persist/integration/react"; import { PersistGate } from "redux-persist/integration/react";
console.log(persistor);
const App = () => { const App = () => {
let [fontsLoaded] = useFonts({ let [fontsLoaded] = useFonts({
light: require("./assets/fonts/Farsi/Light.ttf"), light: require("./assets/fonts/Farsi/Light.ttf"),

@ -7,6 +7,7 @@ import {
TouchableHighlight, TouchableHighlight,
Dimensions, Dimensions,
Platform, Platform,
ActivityIndicator,
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { product, userProduct } from "../../../redux/actions"; import { product, userProduct } from "../../../redux/actions";
@ -295,20 +296,32 @@ function Book({
} }
> >
<> <>
<Text {whichTypeAdded === "physical" && userProductsLoading ? (
style={{ <ActivityIndicator
fontFamily: "bold", color={
fontSize: fontSize.sm,
color:
theme === "light" theme === "light"
? Colors.theme1.green79 ? Colors.theme1.green79
: Colors.theme1.greenCF, : 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>
)}
paddingVertical: 4,
}}
>
خرید نسخه فیزیکی کتاب
</Text>
<View style={tw("flex flex-row-reverse items-center")}> <View style={tw("flex flex-row-reverse items-center")}>
<View style={tw("w-px h-full bg-green-300")}></View> <View style={tw("w-px h-full bg-green-300")}></View>
<View style={tw("flex")}> <View style={tw("flex")}>
@ -370,20 +383,31 @@ function Book({
} }
> >
<> <>
<Text {whichTypeAdded === "digital" && userProductsLoading ? (
style={{ <ActivityIndicator
fontFamily: "bold", color={
fontSize: fontSize.sm,
color:
theme === "light" theme === "light"
? Colors.theme1.green79 ? Colors.theme1.green79
: Colors.theme1.greenCF, : Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
خرید نسخه دیجیتال کتاب خرید نسخه دیجیتال کتاب
</Text> </Text>
)}
<View style={tw("flex")}> <View style={tw("flex")}>
<Text <Text
style={[ style={[
@ -473,20 +497,31 @@ function Book({
} }
> >
<> <>
<Text {whichTypeAdded === "video" && userProductsLoading ? (
style={{ <ActivityIndicator
fontFamily: "bold", color={
fontSize: fontSize.sm,
color:
theme === "light" theme === "light"
? Colors.theme1.green79 ? Colors.theme1.green79
: Colors.theme1.greenCF, : Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color:
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
خرید دوره ویدئویی کتاب خرید دوره ویدئویی کتاب
</Text> </Text>
)}
<View style={tw("flex flex-row-reverse")}> <View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View> <View style={tw("w-px h-full bg-green-500")}></View>
<Text <Text

@ -35,8 +35,8 @@ function Product({
const types = { const types = {
0: "نسخه دیجیتال", 0: "نسخه دیجیتال",
1: "نسخه فیزیکی", 2: "نسخه فیزیکی",
2: "نسخه ویدئویی", 4: "نسخه ویدئویی",
}; };
const submit = async (action) => { const submit = async (action) => {

Loading…
Cancel
Save