From 98267af93d05fd56410e6b32d9ac283e7e51a257 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Thu, 26 Dec 2024 15:06:37 +0800 Subject: [PATCH] implemented account creation and improved checkout flow for delivery selection --- .prettierrc | 12 +- .yarnrc.yml | 1 - README.md | 130 +++++++++++----------- index.html | 7 +- src/components/CheckoutButton.tsx | 16 ++- src/components/CustomerLocationSelect.tsx | 106 +++++++++++------- src/components/PhoneInput.tsx | 8 +- src/components/ProductCard.tsx | 2 +- src/contexts/AuthContext.tsx | 55 +++++++++ src/hooks/use-current-location.ts | 16 ++- src/hooks/use-qpay-checkout.ts | 3 +- src/hooks/use-saved-locations.ts | 31 ++++-- src/hooks/use-stripe-checkout.ts | 1 + src/navigation/AppNavigator.tsx | 5 +- src/navigation/StoreNavigator.tsx | 8 ++ src/navigation/stacks/CheckoutStack.tsx | 10 ++ src/screens/BootScreen.tsx | 39 ++++--- src/screens/CartScreen.tsx | 8 +- src/screens/CheckoutScreen.tsx | 25 +++-- src/screens/CreateAccountScreen.tsx | 70 +++++++++++- src/screens/CreateAccountVerifyScreen.tsx | 70 ++++++++++++ src/screens/EditLocationScreen.tsx | 40 ++++++- src/screens/LocationPermissionScreen.tsx | 13 ++- src/screens/LocationPickerScreen.tsx | 47 ++++++-- src/screens/PhoneLoginScreen.tsx | 53 ++++++--- src/screens/QPayCheckoutScreen.tsx | 2 +- src/screens/StripeCheckoutScreen.tsx | 2 +- src/utils/checkout.js | 2 +- src/utils/location.js | 115 ++++++++++--------- 29 files changed, 632 insertions(+), 265 deletions(-) create mode 100644 src/screens/CreateAccountVerifyScreen.tsx diff --git a/.prettierrc b/.prettierrc index 1b9b1a2..eb884b3 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,8 +1,8 @@ { - "semi": true, - "singleQuote": true, - "trailingComma": "es5", - "printWidth": 190, - "tabWidth": 4, - "jsxSingleQuote": true + "semi": true, + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 190, + "tabWidth": 4, + "jsxSingleQuote": true } diff --git a/.yarnrc.yml b/.yarnrc.yml index d559f81..9f498eb 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1,2 @@ nodeLinker: node-modules - # yarnPath: .yarn/releases/yarn-3.6.4.cjs diff --git a/README.md b/README.md index 5347460..6229c89 100644 --- a/README.md +++ b/README.md @@ -34,52 +34,52 @@ Open source ecommerce mobile app for on-demand orders. Setup ecommerce marketpla ## Table of Contents -- [About](#about) - - [Use cases](#use-cases) -- [Screenshots](#screenshots) -- [Prerequisites](#prerequisites) -- [Installation](#installation) - - [Configure Environment](#configure-environment) -- [Running in Simulator](#running-in-simulator) - - [Run the app in iOS Simulator](#run-the-app-in-ios-simulator) - - [Run the app in Android Simulator](#run-the-app-in-android-simulator) -- [Push Notifications](#push-notifications) - - [APNS Push Notifications](#apns-push-notifications) - - [FCM Push Notifications](#fcm-push-notifications) -- [Generate Assets](#generate-assets) -- [Configuration](#configuration) - - [Application Configuration](#appconfig) - - [Interface Configuration](#uiconfig) -- [Internationalization and Translations](#internationalization-and-translations) - - [Internationalization](#internationalization) - - [Translations](#translations) -- [Payment Gateways](#payment-gateways) - - [Stripe](#stripe) -- [Store Locations](#store-locations) - - [Store Hours](#store-hours) -- [Multi-Vendor](#multi-vendor) - - [Creating a network](#creating-a-network) - - [Inviting to network](#inviting-to-network) - - [Configuring network](#configuring-network) - - [Launch network on app](#launch-network-on-app) -- [Cart](#cart) -- [Customer Authentication](#customer-authentication) - - [Creating a customer account](#creating-a-customer-account) - - [Logging in a customer](#logging-in-a-customer) -- [Delivery/ Service Rates](#delivery-service-rates) - - [Location based quote](#location-based-quote) -- [Checkout](#checkout) - - [Creating a checkout token](#creating-a-checkout-token) - - [Capture checkout](#capture-checkout) -- [Driver/Agent App](#driver-agent-app) - - [Proof of delivery](#proof-of-delivery) -- [Orders](#orders) - - [Auto-accept orders](#auto-accept-orders) - - [Manually accept orders](#manually-accept-orders) - - [Auto-assign orders](#auto-assign-orders) - - [Manually assign orders](#manually-assign-orders) -- [Documentation](#documentation) -- [Roadmap](#roadmap) +- [About](#about) + - [Use cases](#use-cases) +- [Screenshots](#screenshots) +- [Prerequisites](#prerequisites) +- [Installation](#installation) + - [Configure Environment](#configure-environment) +- [Running in Simulator](#running-in-simulator) + - [Run the app in iOS Simulator](#run-the-app-in-ios-simulator) + - [Run the app in Android Simulator](#run-the-app-in-android-simulator) +- [Push Notifications](#push-notifications) + - [APNS Push Notifications](#apns-push-notifications) + - [FCM Push Notifications](#fcm-push-notifications) +- [Generate Assets](#generate-assets) +- [Configuration](#configuration) + - [Application Configuration](#appconfig) + - [Interface Configuration](#uiconfig) +- [Internationalization and Translations](#internationalization-and-translations) + - [Internationalization](#internationalization) + - [Translations](#translations) +- [Payment Gateways](#payment-gateways) + - [Stripe](#stripe) +- [Store Locations](#store-locations) + - [Store Hours](#store-hours) +- [Multi-Vendor](#multi-vendor) + - [Creating a network](#creating-a-network) + - [Inviting to network](#inviting-to-network) + - [Configuring network](#configuring-network) + - [Launch network on app](#launch-network-on-app) +- [Cart](#cart) +- [Customer Authentication](#customer-authentication) + - [Creating a customer account](#creating-a-customer-account) + - [Logging in a customer](#logging-in-a-customer) +- [Delivery/ Service Rates](#delivery-service-rates) + - [Location based quote](#location-based-quote) +- [Checkout](#checkout) + - [Creating a checkout token](#creating-a-checkout-token) + - [Capture checkout](#capture-checkout) +- [Driver/Agent App](#driver-agent-app) + - [Proof of delivery](#proof-of-delivery) +- [Orders](#orders) + - [Auto-accept orders](#auto-accept-orders) + - [Manually accept orders](#manually-accept-orders) + - [Auto-assign orders](#auto-assign-orders) + - [Manually assign orders](#manually-assign-orders) +- [Documentation](#documentation) +- [Roadmap](#roadmap) ### About @@ -89,15 +89,15 @@ _Notice: Network/ Multi-vendor functionality is still a work in progress._ #### Use Cases -- Food delivery app -- Services booking app -- Hyperlocal shopping app -- Hyperlocal marketplace app -- Alcohol delivery app -- Cannabis delivery app -- Lawn care booking app -- Transportation booking app -- and much more... +- Food delivery app +- Services booking app +- Hyperlocal shopping app +- Hyperlocal marketplace app +- Alcohol delivery app +- Cannabis delivery app +- Lawn care booking app +- Transportation booking app +- and much more... ### Screenshots @@ -106,10 +106,10 @@ _Notice: Network/ Multi-vendor functionality is still a work in progress._ ### Prerequisites -- [Yarn](https://yarnpkg.com/) or [NPM](https://nodejs.org/en/) -- [React Native CLI](https://reactnative.dev/docs/environment-setup) -- Xcode 12+ -- Android Studio +- [Yarn](https://yarnpkg.com/) or [NPM](https://nodejs.org/en/) +- [React Native CLI](https://reactnative.dev/docs/environment-setup) +- Xcode 12+ +- Android Studio ### Installation @@ -128,7 +128,7 @@ corepack enable corepack prepare yarn@3.6.4 --activate yarn bundle install -cd ios +cd ios bundle exec pod install touch .env ``` @@ -516,8 +516,8 @@ If you would like to make contributions to the Fleetbase Javascript SDK document ### Roadmap -- Global state management with redux -- Write proper react hooks for sdks -- Add debounce on products search -- Add network/marketplace views -- Shopify & Woocommerce adapters +- Global state management with redux +- Write proper react hooks for sdks +- Add debounce on products search +- Add network/marketplace views +- Shopify & Woocommerce adapters diff --git a/index.html b/index.html index 7d47ae5..b4dc4be 100644 --- a/index.html +++ b/index.html @@ -6,10 +6,7 @@ React Native Web - +