87 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			87 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 FoodsRow = 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.cuisine, "name", props.lang)}
 | 
						|
          </Text>
 | 
						|
          <Text
 | 
						|
            style={{
 | 
						|
              paddingTop: 3,
 | 
						|
              color: theme.coolGrey,
 | 
						|
              fontFamily: Fonts.century,
 | 
						|
              fontSize: 13
 | 
						|
            }}
 | 
						|
          >
 | 
						|
            {dataLanguage(props.items.cuisine.restaurant, "name", props.lang)}
 | 
						|
          </Text>
 | 
						|
          <Text
 | 
						|
            style={{
 | 
						|
              paddingTop: 3,
 | 
						|
              color: theme.coolGrey,
 | 
						|
              fontFamily: Fonts.century,
 | 
						|
              fontSize: 13
 | 
						|
            }}
 | 
						|
          >
 | 
						|
            Quantity: {props.items.count}
 | 
						|
          </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.count).toFixed(2)}
 | 
						|
          </Text>
 | 
						|
        </View>
 | 
						|
      </View>
 | 
						|
    </View>
 | 
						|
  );
 | 
						|
};
 | 
						|
 | 
						|
export default FoodsRow;
 |