From cdee7125774b1896234d76cb4d36c2127fc52793 Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Tue, 22 Jun 2021 13:12:51 -0300 Subject: [PATCH] Feature Changes and updates --- README.md | 10 +++++-- commerce.config.json | 3 +++ components/common/Navbar/Navbar.module.css | 1 + components/common/Navbar/Navbar.tsx | 8 +++--- components/common/UserNav/UserNav.tsx | 12 +++++---- .../product/ProductSidebar/ProductSidebar.tsx | 26 ++++++++++--------- framework/bigcommerce/commerce.config.json | 3 ++- framework/local/commerce.config.json | 5 +++- 8 files changed, 44 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index b0cd2b2d3..07752972a 100644 --- a/README.md +++ b/README.md @@ -66,14 +66,20 @@ Every provider defines the features that it supports under `framework/{provider} #### Features Available +The following features can be enabled or disabled. This means that the UI will remove all code related to the feature. +For example: Turning `cart` off will disable Cart capabilities. + +- cart +- search - wishlist +- customerAuth - customCheckout #### How to turn Features on and off > NOTE: The selected provider should support the feature that you are toggling. (This means that you can't turn wishlist on if the provider doesn't support this functionality out the box) -- Open `commerce.config.json` +- Open `commerce.config.json` from your chosen provider. - You'll see a config file like this: ```json { @@ -83,7 +89,7 @@ Every provider defines the features that it supports under `framework/{provider} } } ``` -- Turn wishlist on by setting wishlist to true. +- Turn `wishlist` on by setting `wishlist` to `true`. - Run the app and the wishlist functionality should be back on. ### How to create a new provider diff --git a/commerce.config.json b/commerce.config.json index 06b985504..ad72b58de 100644 --- a/commerce.config.json +++ b/commerce.config.json @@ -1,6 +1,9 @@ { "features": { + "cart": true, + "search": true, "wishlist": false, + "customerAuth": false, "customCheckout": false } } diff --git a/components/common/Navbar/Navbar.module.css b/components/common/Navbar/Navbar.module.css index 3d424ec2c..faa86d156 100644 --- a/components/common/Navbar/Navbar.module.css +++ b/components/common/Navbar/Navbar.module.css @@ -1,5 +1,6 @@ .root { @apply sticky top-0 bg-primary z-40 transition-all duration-150; + min-height: 74px; } .nav { diff --git a/components/common/Navbar/Navbar.tsx b/components/common/Navbar/Navbar.tsx index 45cda1bae..2ce5f33b8 100644 --- a/components/common/Navbar/Navbar.tsx +++ b/components/common/Navbar/Navbar.tsx @@ -34,9 +34,11 @@ const Navbar: FC = ({ links }) => ( ))} -
- -
+ {process.env.COMMERCE_SEARCH_ENABLED && ( +
+ +
+ )}
diff --git a/components/common/UserNav/UserNav.tsx b/components/common/UserNav/UserNav.tsx index 16e7279bb..5d7d28df3 100644 --- a/components/common/UserNav/UserNav.tsx +++ b/components/common/UserNav/UserNav.tsx @@ -25,10 +25,12 @@ const UserNav: FC = ({ className }) => { return (