reza added loading to product button

master
Reza_ashrafi 3 years ago
parent da3341e43b
commit f9b9bbfdd5
  1. 2
      App.js
  2. 35
      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,6 +296,16 @@ function Book({
} }
> >
<> <>
{whichTypeAdded === "physical" && userProductsLoading ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text <Text
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
@ -309,6 +320,8 @@ function Book({
> >
خرید نسخه فیزیکی کتاب خرید نسخه فیزیکی کتاب
</Text> </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,6 +383,16 @@ function Book({
} }
> >
<> <>
{whichTypeAdded === "digital" && userProductsLoading ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text <Text
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
@ -384,6 +407,7 @@ function Book({
> >
خرید نسخه دیجیتال کتاب خرید نسخه دیجیتال کتاب
</Text> </Text>
)}
<View style={tw("flex")}> <View style={tw("flex")}>
<Text <Text
style={[ style={[
@ -473,6 +497,16 @@ function Book({
} }
> >
<> <>
{whichTypeAdded === "video" && userProductsLoading ? (
<ActivityIndicator
color={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.greenCF
}
size={fontSize.sm}
/>
) : (
<Text <Text
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
@ -487,6 +521,7 @@ function Book({
> >
خرید دوره ویدئویی کتاب خرید دوره ویدئویی کتاب
</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