84 lines
2.2 KiB
JavaScript
Executable File
84 lines
2.2 KiB
JavaScript
Executable File
import React from "react";
|
|
import { View } from "react-native";
|
|
import Text from "react-native-text";
|
|
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
|
|
import Size from "../../config/size";
|
|
const size = new Size();
|
|
import theme from "../../config/colors";
|
|
import { Fonts } from "../../config/fonts";
|
|
import { width, height } from "../../config/screen";
|
|
|
|
const dataLanguage = (data, value, lang) => {
|
|
if (lang == "english") {
|
|
switch (value) {
|
|
case "name":
|
|
return data.nameEn;
|
|
break;
|
|
}
|
|
} else {
|
|
switch (value) {
|
|
case "name":
|
|
return data.name;
|
|
break;
|
|
}
|
|
}
|
|
};
|
|
|
|
const FoodsRowForOrderDetails = props => {
|
|
return (
|
|
<View style={{ marginLeft: 5, marginRight: 5, marginTop: 10 }}>
|
|
<View style={{ flexDirection: "row", marginBottom: 10 }}>
|
|
<View style={{ width: "60%" }}>
|
|
<Text
|
|
style={{
|
|
color: theme.coolGrey,
|
|
fontFamily: Fonts.century,
|
|
fontWeight: "bold",
|
|
fontSize:15
|
|
}}
|
|
>
|
|
{dataLanguage(props.items.menu.cuisine, "name", props.lang)}
|
|
</Text>
|
|
<Text
|
|
style={{
|
|
paddingTop:3,
|
|
color: theme.coolGrey,
|
|
fontFamily: Fonts.century,
|
|
fontSize: 13,
|
|
}}>
|
|
|
|
{dataLanguage(props.items.menu.cuisine.restaurant, "name", props.lang)}
|
|
</Text>
|
|
<Text
|
|
style={{
|
|
paddingTop:3,
|
|
color: theme.coolGrey,
|
|
fontFamily: Fonts.century,
|
|
fontSize: 13,
|
|
}}>Quantity: {props.items.qty}</Text>
|
|
</View>
|
|
<View
|
|
style={{
|
|
width: "40%",
|
|
flexDirection: "row",
|
|
justifyContent: "flex-end"
|
|
}}
|
|
>
|
|
<Text
|
|
style={{
|
|
color: theme.coolGrey,
|
|
fontFamily: Fonts.century,
|
|
fontWeight: "bold",
|
|
fontSize:15
|
|
}}
|
|
>
|
|
HKD ${(props.items.price*props.items.qty).toFixed(2)}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default FoodsRowForOrderDetails;
|