diff --git a/src/Components/Info.js b/src/Components/Info.js index d73427c1..48570e04 100644 --- a/src/Components/Info.js +++ b/src/Components/Info.js @@ -22,9 +22,6 @@ import Linkify from "react-linkify"; import { withRouter } from "react-router-dom"; import update from "immutability-helper"; import whatsapp_icon from "../assets/whatsapp_icon.png"; -import whatsapp_button from "../assets/whatsapp_button.png"; -import menu_button from "../assets/menu_button.png"; -import website_button from "../assets/website_button.png"; import menu_title from "../assets/info_menu.png"; import orderleh_title from "../assets/orderleh_title.png"; import delivery_title from "../assets/info_delivery.png"; @@ -729,7 +726,7 @@ export class Info extends React.Component { let cuisine = []; let regions = []; let photos = []; - let link = "https://wa.me/65" + this.state.data.contact; + let whatsAppLink = "https://wa.me/65" + this.state.data.contact; if (this.state.retrieved) { if (this.state.data.categories) { this.state.data.categories.forEach((element) => { @@ -931,56 +928,137 @@ export class Info extends React.Component { > {this.state.hero ? null : (
-

{this.state.data.name}

+

+ {this.state.data.name} +

+ {cuisine.length > 0 ? ( +
+ + + {" "} + {cuisine} +
+
+ ) : null}
)} - - - - - {" "} - - {this.state.data.unit} {this.state.data.street} - -
- {cuisine.length > 0 ? ( -
- - - {" "} - {cuisine} -
-
- ) : null} +
+ + + + {" "} + + {(this.state.data.unit + ' ' + this.state.data.street).toLowerCase()} + + {this.state.data.website ? ( +
+ + + + + {" "} + + onLoad("website_click", this.state.data.name) + } + target="blank" + > + {this.state.data.website.replace(/https?:\/\//,'')} + +
+ ) : null} + {this.state.data.contact !== "0" ? ( +
+ + + {" "} + + {this.state.data.contact} {" ("} + {this.state.data.whatsapp ? ( + + onLoad("message", this.state.data.name)} + > + WhatsApp + + {this.state.data.sms || this.state.data.call ? ', ' : null} + + ) : null} + {this.state.data.sms ? ( + + SMS + {this.state.data.call ? ', ' : null} + + ) : null} + {this.state.data.call ? Call : null} + {") "}
+ {this.state.data.wechatid ? ( + + WeChat ID: {this.state.data.wechatid} + + ) : null} +
+
+ ) : null} +
{this.state.data.pickup_option || this.state.data.delivery_option ? ( -
+
Delivery - ) : null}{" "} -
-
- ) : null} - {regions.length > 0 ? ( -
- - - - - - {" "} - {regions} -
+ ) : null} + {regions.length > 0 ? ( + + + + + + + {" "} + {regions} +
+
+ ) : null}
) : null} - {this.state.data.contact !== "0" ? ( -
- - - {" "} - - {this.state.data.contact} {" ("} - {this.state.data.whatsapp ? ( - - WhatsApp - {this.state.data.sms || this.state.data.call ? ( - , - ) : null} - - ) : null} - {this.state.data.sms ? ( + {this.state.data.delivery_detail || + this.state.data.minimum_order || + this.state.data.free_delivery ? ( +
+
+ Details Regarding Delivery +
+ +

+ {this.state.data.delivery_detail} +

+ {this.state.data.minimum_order ? ( - SMS{this.state.data.call ? , : null} + Minimum Order: ${this.state.data.minimum_order} +
) : null} - {this.state.data.call ? Call : null} - {") "}
- {this.state.data.wechatid ? ( - - WeChat ID: {this.state.data.wechatid} - + {this.state.data.free_delivery ? ( + Free Delivery: ${this.state.data.free_delivery} ) : null} - +
) : null} - {/* Custom button display: menu, website, message */} -
- {this.state.data.menu && - this.state.data.whatsapp && - this.state.data.menu_combined.length > 0 && - this.state.data.menu_combined[0].name !== "" ? ( - - - - ) : null} - {this.state.data.website ? ( - - onLoad("website_click", this.state.data.name) - } - target="blank" + {this.state.data.price ? ( +
+
+ Delivery Fees +
+

- - - ) : null} - {this.state.data.whatsapp ? ( - - onLoad("message", this.state.data.name)} - > - - - - ) : null} -

- - - -
-
- + {this.state.data.price} +

-
-
- {" "} - Share this with friends! -
- - - {" "} - - - - - - - {" "} - +
+ Opening Hours +
+

- - {" "} + {this.state.data.opening} +

-
+ ) : null} {this.state.data.promo ? (
) : null} - {/* See more button shows if only 1 item OR >1 item && customer hasn't clicked Menu / see more */} - {(!this.state.wantToOrder && - this.state.data.menu && - this.state.data.menu_combined.length > 1 && - this.state.data.menu_combined[1] && - this.state.data.menu_combined[1].name !== "") || - (!this.state.wantToOrder && - this.state.data.menu && - this.state.data.menu_combined[0] && - this.state.data.menu_combined[0].name !== "" && - this.state.data.menu_combined[1] && - this.state.data.menu_combined[1].name === "") || - (!this.state.wantToOrder && - this.state.data.menu && - this.state.data.menu_combined.length === 1 && - this.state.data.menu_combined[0] && - this.state.data.menu_combined[0].name !== "") ? ( -
-
-
- see more ↓ -
-
- ) : null} {/* Display the rest of the menu if customer clicks Menu / see more */} {this.state.wantToOrder ? ( @@ -1875,6 +1805,48 @@ export class Info extends React.Component {
) : null} + + {/* See more button shows if only 1 item OR >1 item && customer hasn't clicked Menu / see more */} + { + this.state.data.menu && ( + (this.state.data.menu_combined.length > 1 && + this.state.data.menu_combined[1] && + this.state.data.menu_combined[1].name !== "") || + (this.state.data.menu_combined[0] && + this.state.data.menu_combined[0].name !== "" && + this.state.data.menu_combined[1] && + this.state.data.menu_combined[1].name === "") || + (this.state.data.menu_combined.length === 1 && + this.state.data.menu_combined[0] && + this.state.data.menu_combined[0].name !== "") + ) + ?
+
+
+ {!this.state.wantToOrder ? see more ↓ : see less ↑} +
+
+ : null + }
) : null} @@ -1973,76 +1945,72 @@ export class Info extends React.Component {

{this.getMenu(false)}



- ) : null} - {this.state.data.delivery_detail || - this.state.data.minimum_order || - this.state.data.free_delivery ? ( -
-
- Details Regarding Delivery -
- -

- {this.state.data.delivery_detail} -

- {this.state.data.minimum_order ? ( - - Minimum Order: ${this.state.data.minimum_order} -
-
- ) : null} - {this.state.data.free_delivery ? ( - Free Delivery: ${this.state.data.free_delivery} - ) : null} -
+ ) : null} +
+
+
- ) : null} - {this.state.data.price ? ( -
-
- Delivery Fees -
-

+

+ {" "} + Share this with friends! +
+ - {this.state.data.price} -

-
- ) : null} - {this.state.data.opening ? ( -
-
- Opening Hours -
-

+ {" "} + + + + + - {this.state.data.opening} -

+ + {" "} + + + {" "}
- ) : null} - {/*

- {this.state.data.website ? ( - this.state.data.website.slice(0, 4) === "http" ? ( - Website Link - ) : ( - - Website Link - - ) - ) : null} -

*/} +
+

Are you the owner? Email foodleh@outlook.com for enquiries.{" "}