From 76e10ae95bf223adf68d1b50b59b7cd825ebc3f4 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Sun, 10 Apr 2022 17:17:24 +0430 Subject: [PATCH] some fix --- src/redux/reducers/userFactor.js | 1 - src/screens/Product/components/Rates.js | 31 +++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/redux/reducers/userFactor.js b/src/redux/reducers/userFactor.js index ddfa548..f73c128 100644 --- a/src/redux/reducers/userFactor.js +++ b/src/redux/reducers/userFactor.js @@ -49,7 +49,6 @@ export default function userFactor(state = initialState, action) { case "userFactor/myList": return { ...state, loading: false, list: data, error: null }; case "userFactor/update": - // toast.success("درخواست شما با موفقیت انجام شد."); return { ...state, loading: false, error: null }; case "userFactor/deleteUserOffCode": return { ...state, loading: false, error: null }; diff --git a/src/screens/Product/components/Rates.js b/src/screens/Product/components/Rates.js index d904bff..8c8a164 100644 --- a/src/screens/Product/components/Rates.js +++ b/src/screens/Product/components/Rates.js @@ -1,5 +1,5 @@ import React from "react"; -import { View, Text, Dimensions, Appearance } from "react-native"; +import { View, Text, Dimensions, Appearance, Pressable } from "react-native"; import { Rating } from "react-native-ratings"; import { connect } from "react-redux"; import { vote } from "../../../redux/actions"; @@ -12,14 +12,23 @@ import Colors from "../../../constants/Colors"; const width = Dimensions.get("window").width; -function Rates({ rate, productId, addVote, isBuyed }) { +function Rates({ rate, productId, addVote, isBuyed = null }) { const ratingCompleted = (rating) => { return; }; return ( - + + !isBuyed + ? asyncAwesomeAlert("خطا", "شما این محصول رو خریداری نکرده اید.", { + showCancelButton: false, + }) + : {} + } + > - isBuyed - ? addVote({ productId, vote: rating }) - : asyncAwesomeAlert( - "خطا", - "شما این محصول رو خریداری نکرده اید.", - { - showCancelButton: false, - } - ) - } + value={4} + onFinishRating={(rating) => addVote({ productId, vote: rating })} + readonly={!isBuyed} /> {`از بین ${1150} نفر`} - + {[ { name: "بخش ۱", value: 40 },