|
|
@ -1,38 +1,55 @@ |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import { View, Text, Dimensions } from "react-native"; |
|
|
|
import { View, Text, Dimensions, Appearance } from "react-native"; |
|
|
|
|
|
|
|
import { Rating } from 'react-native-ratings'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//assets
|
|
|
|
import tw from "tailwind-rn"; |
|
|
|
import tw from "tailwind-rn"; |
|
|
|
import fontSize from "../../../constants/fontSize"; |
|
|
|
import fontSize from "../../../constants/fontSize"; |
|
|
|
|
|
|
|
import Colors from "../../../constants/Colors"; |
|
|
|
|
|
|
|
|
|
|
|
const width = Dimensions.get("window").width; |
|
|
|
const width = Dimensions.get("window").width; |
|
|
|
|
|
|
|
|
|
|
|
export default function Rates({ rates }) { |
|
|
|
export default function Rates({ rate }) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ratingCompleted = (rating) => { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View style={tw("flex flex-row-reverse")}> |
|
|
|
<View style={tw("flex flex-row-reverse")}> |
|
|
|
<View |
|
|
|
<View style={[tw("flex items-center justify-center"), { width: "25%" }]}> |
|
|
|
style={[ |
|
|
|
|
|
|
|
tw("flex items-center justify-center"), |
|
|
|
|
|
|
|
{ width: "25%" }, |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
{ fontSize: fontSize.xl6, color: "#05335F", fontFamily: "bold" }, |
|
|
|
{ fontSize: fontSize.xl6, color: "#05335F", fontFamily: "bold" }, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
|
{rates.mid} |
|
|
|
{rate} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
|
|
|
|
<Rating |
|
|
|
|
|
|
|
type='star' |
|
|
|
|
|
|
|
ratingCount={5} |
|
|
|
|
|
|
|
imageSize={15} |
|
|
|
|
|
|
|
onFinishRating={(rating) => ratingCompleted(rating)} |
|
|
|
|
|
|
|
/> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.sm, |
|
|
|
fontSize: fontSize.sm, |
|
|
|
color: "#707070", |
|
|
|
color: "#707070", |
|
|
|
fontFamily: "light", |
|
|
|
fontFamily: "light", |
|
|
|
|
|
|
|
marginTop : 5 |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{"از" + " " + rates.allRates + " " + "نفر"} |
|
|
|
{`از بین ${1150} نفر`} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View style={[tw("flex flex-1"), { width: "60%" }]}> |
|
|
|
<View style={[tw("flex flex-1"), { width: "60%" }]}> |
|
|
|
{rates.fields.map((field, index) => ( |
|
|
|
{[ |
|
|
|
|
|
|
|
{ name: "بخش ۱", value: 40 }, |
|
|
|
|
|
|
|
{ name: "بخش ۱", value: 20 }, |
|
|
|
|
|
|
|
{ name: "بخش ۱", value: 70 }, |
|
|
|
|
|
|
|
{ name: "بخش ۱", value: 10 }, |
|
|
|
|
|
|
|
{ name: "بخش ۱", value: 50 }, |
|
|
|
|
|
|
|
].map((field, index) => ( |
|
|
|
<Progress key={index} data={field} /> |
|
|
|
<Progress key={index} data={field} /> |
|
|
|
))} |
|
|
|
))} |
|
|
|
</View> |
|
|
|
</View> |
|
|
@ -40,9 +57,13 @@ export default function Rates({ rates }) { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const Progress = ({ data }) => { |
|
|
|
const Progress = ({ data, ...props }) => { |
|
|
|
|
|
|
|
const colorScheme = React.useMemo(() => { |
|
|
|
|
|
|
|
return Appearance.getColorScheme(); |
|
|
|
|
|
|
|
},[props.useless]); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View style={[tw("flex flex-1 flex-row items-center py-0.5")]}> |
|
|
|
<View style={[tw("flex flex-1 flex-row items-center py-1.5")]}> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.sm, |
|
|
|
fontSize: fontSize.sm, |
|
|
@ -55,13 +76,13 @@ const Progress = ({ data }) => { |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
tw("rounded-md ml-2 flex-1"), |
|
|
|
tw("rounded-md ml-2 flex-1"), |
|
|
|
{ height: 6, backgroundColor: "#D3E9FF" }, |
|
|
|
{ height: 6, backgroundColor: Colors.theme1[colorScheme].greenFF1 }, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
tw("h-full rounded-md my-auto"), |
|
|
|
tw("h-full rounded-md"), |
|
|
|
{ width: data.value + "%", backgroundColor: "#2B8DEB" }, |
|
|
|
{ width: data.value + "%", backgroundColor: Colors.theme1[colorScheme].greenCF }, |
|
|
|
]} |
|
|
|
]} |
|
|
|
></View> |
|
|
|
></View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|