From 29465ed63bb00b2cf1a5053e464594e20ce3006a Mon Sep 17 00:00:00 2001 From: LoneRifle Date: Tue, 23 Jun 2020 19:40:24 +0800 Subject: [PATCH 1/6] fix(info): move social, edit buttons to bottom again Signed-off-by: LoneRifle --- src/Components/Info.js | 133 ++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/src/Components/Info.js b/src/Components/Info.js index d73427c1..bbb2dcfc 100644 --- a/src/Components/Info.js +++ b/src/Components/Info.js @@ -1123,73 +1123,6 @@ export class Info extends React.Component { ) : null} - - - -
-
- -
-
-
- {" "} - Share this with friends! -
- - - {" "} - - - - - - - {" "} - - - {" "} -
-
{this.state.data.promo ? (
*/} + +
+
+ +
+
+
+ {" "} + Share this with friends! +
+ + + {" "} + + + + + + + {" "} + + + {" "} +
+
+

Are you the owner? Email foodleh@outlook.com for enquiries.{" "} From 4462a3f97efafa884f18c2541733a505595f76b4 Mon Sep 17 00:00:00 2001 From: LoneRifle Date: Tue, 23 Jun 2020 20:15:24 +0800 Subject: [PATCH 2/6] fix(info): rearrange layout of details - Move tags to near the title, grouping them - "what is it" - Make address TitleCase - group fields address, website and phone - "where is it" - add hyperlinks to WhatsApp/SMS/Call annotations to phone - Put Da Bao/Delivery and regions on same line - "can I get it" Signed-off-by: LoneRifle --- src/Components/Info.js | 187 ++++++++++++++++++++++++----------------- 1 file changed, 111 insertions(+), 76 deletions(-) diff --git a/src/Components/Info.js b/src/Components/Info.js index bbb2dcfc..00e7b823 100644 --- a/src/Components/Info.js +++ b/src/Components/Info.js @@ -729,7 +729,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,10 +931,31 @@ 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} + + {(this.state.data.unit + ' ' + this.state.data.street).toLowerCase()} -
- {cuisine.length > 0 ? ( + {this.state.data.website ? (
- - {" "} - {cuisine} -
-
- ) : null} - {this.state.data.pickup_option || - this.state.data.delivery_option ? ( -
- - - + {" "} - {this.state.data.pickup_option ? ( - Da Bao - ) : null} - {this.state.data.delivery_option ? ( - Delivery - ) : null}{" "} -
-
- ) : null} - {regions.length > 0 ? ( -
- + onLoad("website_click", this.state.data.name) + } + target="blank" > - - - - - {" "} - {regions} -
+ {this.state.data.website.replace(/https?:\/\//,'')} +
) : null} {this.state.data.contact !== "0" ? ( @@ -1048,18 +1029,23 @@ export class Info extends React.Component { {this.state.data.contact} {" ("} {this.state.data.whatsapp ? ( - WhatsApp - {this.state.data.sms || this.state.data.call ? ( - , - ) : null} + 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} + SMS + {this.state.data.call ? ', ' : null} ) : null} - {this.state.data.call ? Call : null} + {this.state.data.call ? Call : null} {") "}
{this.state.data.wechatid ? ( @@ -1069,6 +1055,55 @@ export class Info extends React.Component {
) : null} + {this.state.data.pickup_option || + this.state.data.delivery_option ? ( +
+ + + + {" "} + {this.state.data.pickup_option ? ( + Da Bao + ) : null} + {this.state.data.delivery_option ? ( + Delivery + ) : null} + {regions.length > 0 ? ( + + + + + + + {" "} + {regions} +
+
+ ) : null} +
+ ) : null} {/* Custom button display: menu, website, message */}
{this.state.data.menu && @@ -1108,7 +1143,7 @@ export class Info extends React.Component { {this.state.data.whatsapp ? ( onLoad("message", this.state.data.name)} > From 06f3a90dbf234a124c2091aa2bb39a69a1be435e Mon Sep 17 00:00:00 2001 From: LoneRifle Date: Tue, 23 Jun 2020 20:53:47 +0800 Subject: [PATCH 3/6] fix(info): replace buttons with delivery info - Move the see more drawer to the true bottom of menu, and allow it to stay, toggling between seeing more and seeing less - Replace the menu/website/message buttons with delivery info, moving that from the bottom to the top, since that information is relevant Signed-off-by: LoneRifle --- src/Components/Info.js | 268 +++++++++++++++-------------------------- 1 file changed, 100 insertions(+), 168 deletions(-) diff --git a/src/Components/Info.js b/src/Components/Info.js index 00e7b823..456830d9 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"; @@ -1104,60 +1101,64 @@ export class Info extends React.Component { ) : 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" - > - +
+ Details Regarding Delivery +
+ +

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

+ {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} + {this.state.data.price ? ( +
+
+ Delivery Fees +
+

+ {this.state.data.price} +

+
+ ) : null} + {this.state.data.opening ? ( +
+
+ 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 ? ( @@ -1843,6 +1801,50 @@ 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.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 ↓ : see less ↑ + } +
+
) : null} @@ -1941,77 +1943,7 @@ 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} - {this.state.data.price ? ( -
-
- Delivery Fees -
-

- {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} -

*/} - + ) : null}
Date: Tue, 23 Jun 2020 20:56:49 +0800 Subject: [PATCH 4/6] fix(info): use double-quotes Signed-off-by: LoneRifle --- src/Components/Info.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/Info.js b/src/Components/Info.js index 456830d9..d2f7c080 100644 --- a/src/Components/Info.js +++ b/src/Components/Info.js @@ -928,11 +928,11 @@ export class Info extends React.Component { > {this.state.hero ? null : (
-

+

{this.state.data.name}

{cuisine.length > 0 ? ( -
+
Delivery ) : null} {regions.length > 0 ? ( - + Date: Tue, 23 Jun 2020 22:21:31 +0800 Subject: [PATCH 5/6] fix(info): rework spacing, address link colour Signed-off-by: LoneRifle --- src/Components/Info.js | 204 +++++++++++++++++++++-------------------- 1 file changed, 104 insertions(+), 100 deletions(-) diff --git a/src/Components/Info.js b/src/Components/Info.js index d2f7c080..1d7ed5dd 100644 --- a/src/Components/Info.js +++ b/src/Components/Info.js @@ -932,7 +932,7 @@ export class Info extends React.Component { {this.state.data.name} {cuisine.length > 0 ? ( -
+
)} - - - - {" "} - - {(this.state.data.unit + ' ' + this.state.data.street).toLowerCase()} - - {this.state.data.website ? ( - - ) : 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.unit + ' ' + this.state.data.street).toLowerCase()} + + {this.state.data.website ? ( + + ) : 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 ? ( -
+
Date: Tue, 23 Jun 2020 22:37:26 +0800 Subject: [PATCH 6/6] fix(info): margin for info groups, bug with see more drawer Signed-off-by: LoneRifle --- src/Components/Info.js | 72 ++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/src/Components/Info.js b/src/Components/Info.js index 1d7ed5dd..48570e04 100644 --- a/src/Components/Info.js +++ b/src/Components/Info.js @@ -953,7 +953,7 @@ export class Info extends React.Component { ) : null}
)} -
+
{this.state.data.pickup_option || this.state.data.delivery_option ? ( -
+
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 && ( + (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] && 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.length === 1 && this.state.data.menu_combined[0] && - this.state.data.menu_combined[0].name !== "") ? - see more ↓ : see less ↑ - } + this.state.data.menu_combined[0].name !== "") + ) + ?
+
+
+ {!this.state.wantToOrder ? see more ↓ : see less ↑} +
-
+ : null + }
) : null}