├── .watchmanconfig ├── src ├── utils │ ├── helpers.ts │ └── dimensionsUtil.ts ├── assets │ ├── images │ │ ├── gpay.png │ │ ├── applepay.png │ │ ├── avatar.png │ │ └── amazonpay.png │ ├── fonts │ │ ├── app_icons.ttf │ │ ├── Poppins-Black.ttf │ │ ├── Poppins-Bold.ttf │ │ ├── Poppins-Light.ttf │ │ ├── Poppins-Medium.ttf │ │ ├── Poppins-Thin.ttf │ │ ├── Poppins-Regular.ttf │ │ ├── Poppins-SemiBold.ttf │ │ ├── Poppins-ExtraBold.ttf │ │ └── Poppins-ExtraLight.ttf │ ├── icons │ │ └── ic_launcher.png │ ├── coffee_assets │ │ ├── latte │ │ │ ├── square │ │ │ │ ├── latte_pic_1_square.png │ │ │ │ ├── latte_pic_2_square.png │ │ │ │ └── latte_pic_3_square.png │ │ │ └── portrait │ │ │ │ ├── latte_pic_1_portrait.png │ │ │ │ ├── latte_pic_2_portrait.png │ │ │ │ └── latte_pic_3_portrait.png │ │ ├── espresso │ │ │ ├── square │ │ │ │ ├── espresso_pic_1_square.png │ │ │ │ ├── espresso_pic_2_square.png │ │ │ │ └── espresso_pic_3_square.png │ │ │ └── portrait │ │ │ │ ├── espresso_pic_1_portrait.png │ │ │ │ ├── espresso_pic_2_portrait.png │ │ │ │ └── espresso_pic_3_portrait.png │ │ ├── americano │ │ │ ├── square │ │ │ │ ├── americano_pic_1_square.png │ │ │ │ ├── americano_pic_2_square.png │ │ │ │ └── americano_pic_3_square.png │ │ │ └── portrait │ │ │ │ ├── americano_pic_1_portrait.png │ │ │ │ ├── americano_pic_2_portrait.png │ │ │ │ └── americano_pic_3_portrait.png │ │ ├── cappuccino │ │ │ ├── square │ │ │ │ ├── cappuccino_pic_1_square.png │ │ │ │ ├── cappuccino_pic_2_square.png │ │ │ │ └── cappuccino_pic_3_square.png │ │ │ └── portrait │ │ │ │ ├── cappuccino_pic_1_portrait.png │ │ │ │ ├── cappuccino_pic_2_portrait.png │ │ │ │ └── cappuccino_pic_3_portrait.png │ │ ├── macchiato │ │ │ ├── square │ │ │ │ ├── macchiato_pic_1_square.png │ │ │ │ ├── macchiato_pic_2_square.png │ │ │ │ └── macchiato_pic_3_square.png │ │ │ └── portrait │ │ │ │ ├── macchiato_pic_1_portrait.png │ │ │ │ ├── macchiato_pic_2_portrait.png │ │ │ │ └── macchiato_pic_3_portrait.png │ │ ├── black_coffee │ │ │ ├── square │ │ │ │ ├── black_coffee_pic_1_square.png │ │ │ │ ├── black_coffee_pic_2_square.png │ │ │ │ └── black_coffee_pic_3_square.png │ │ │ └── portrait │ │ │ │ ├── black_coffee_pic_1_portrait.png │ │ │ │ ├── black_coffee_pic_2_portrait.png │ │ │ │ └── black_coffee_pic_3_portrait.png │ │ ├── arabica_coffee_beans │ │ │ ├── arabica_coffee_beans_square.png │ │ │ └── arabica_coffee_beans_portrait.png │ │ ├── excelsa_coffee_beans │ │ │ ├── excelsa_coffee_beans_square.png │ │ │ └── excelsa_coffee_beans_portrait.png │ │ ├── robusta_coffee_beans │ │ │ ├── robusta_coffee_beans_square.png │ │ │ └── robusta_coffee_beans_portrait.png │ │ └── liberica_coffee_beans │ │ │ ├── liberica_coffee_beans_square.png │ │ │ └── liberica_coffee_beans_portrait.png │ └── lottie │ │ └── download.json ├── components │ ├── common │ │ ├── CustomIcon.ts │ │ ├── HeaderBar.tsx │ │ ├── EmptyListAnimation.tsx │ │ ├── PopUpAnimation.tsx │ │ ├── GradientIconBG.tsx │ │ ├── PaymentFooter.tsx │ │ ├── ProductCard.tsx │ │ └── ImageBackdropInfo.tsx │ └── specific │ │ ├── ProfilePicture.tsx │ │ └── BackgroundIcon.tsx ├── types │ └── common │ │ ├── orderItem.ts │ │ ├── cartItem.ts │ │ └── product.ts ├── config │ ├── screenNames.ts │ ├── constants.ts │ ├── messages.ts │ ├── colors.ts │ ├── assets.ts │ ├── specialTypes.ts │ ├── fonts.ts │ └── dimensions.ts ├── data │ ├── paymentOptions.ts │ └── beansCollection.ts ├── screens │ ├── OrderHistory │ │ ├── OrderHistoryViewModel.ts │ │ ├── components │ │ │ ├── OrderHistoryCard.tsx │ │ │ └── OrderItemCard.tsx │ │ └── OrderHistoryScreen.tsx │ ├── Cart │ │ ├── CartViewModel.ts │ │ └── CartScreen.tsx │ ├── Payment │ │ ├── PaymentViewModel.ts │ │ ├── components │ │ │ └── PaymentMethod.tsx │ │ └── PaymentScreen.tsx │ ├── Favorite │ │ ├── FavoriteViewModel.ts │ │ ├── components │ │ │ └── FavoriteItemCard.tsx │ │ └── FavoriteScreen.tsx │ ├── Home │ │ ├── components │ │ │ ├── CategoryScroller.tsx │ │ │ └── SearchInput.tsx │ │ ├── HomeViewModel.ts │ │ └── HomeScreen.tsx │ └── Detail │ │ ├── DetailViewModel.ts │ │ └── DetailScreen.tsx ├── state │ ├── util │ │ ├── favoriteActions.ts │ │ └── cartActions.ts │ └── useStore.ts └── navigation │ ├── RootStackNavigator.tsx │ └── TabNavigator.tsx ├── nativewind-env.d.ts ├── jest.config.js ├── .bundle └── config ├── app.json ├── .eslintrc.js ├── tsconfig.json ├── android ├── app │ ├── debug.keystore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── color.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── drawable │ │ │ │ │ ├── gpay.png │ │ │ │ │ ├── avatar.png │ │ │ │ │ ├── amazonpay.png │ │ │ │ │ ├── applepay.png │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── latte_pic_1_square.png │ │ │ │ │ ├── latte_pic_2_square.png │ │ │ │ │ ├── latte_pic_3_square.png │ │ │ │ │ ├── americano_pic_1_square.png │ │ │ │ │ ├── americano_pic_2_square.png │ │ │ │ │ ├── americano_pic_3_square.png │ │ │ │ │ ├── espresso_pic_1_square.png │ │ │ │ │ ├── espresso_pic_2_square.png │ │ │ │ │ ├── espresso_pic_3_square.png │ │ │ │ │ ├── latte_pic_1_portrait.png │ │ │ │ │ ├── latte_pic_2_portrait.png │ │ │ │ │ ├── latte_pic_3_portrait.png │ │ │ │ │ ├── macchiato_pic_1_square.png │ │ │ │ │ ├── macchiato_pic_2_square.png │ │ │ │ │ ├── macchiato_pic_3_square.png │ │ │ │ │ ├── americano_pic_1_portrait.png │ │ │ │ │ ├── americano_pic_2_portrait.png │ │ │ │ │ ├── americano_pic_3_portrait.png │ │ │ │ │ ├── cappuccino_pic_1_square.png │ │ │ │ │ ├── cappuccino_pic_2_square.png │ │ │ │ │ ├── cappuccino_pic_3_square.png │ │ │ │ │ ├── espresso_pic_1_portrait.png │ │ │ │ │ ├── espresso_pic_2_portrait.png │ │ │ │ │ ├── espresso_pic_3_portrait.png │ │ │ │ │ ├── macchiato_pic_1_portrait.png │ │ │ │ │ ├── macchiato_pic_2_portrait.png │ │ │ │ │ ├── macchiato_pic_3_portrait.png │ │ │ │ │ ├── arabica_coffee_beans_square.png │ │ │ │ │ ├── black_coffee_pic_1_portrait.png │ │ │ │ │ ├── black_coffee_pic_1_square.png │ │ │ │ │ ├── black_coffee_pic_2_portrait.png │ │ │ │ │ ├── black_coffee_pic_2_square.png │ │ │ │ │ ├── black_coffee_pic_3_portrait.png │ │ │ │ │ ├── black_coffee_pic_3_square.png │ │ │ │ │ ├── cappuccino_pic_1_portrait.png │ │ │ │ │ ├── cappuccino_pic_2_portrait.png │ │ │ │ │ ├── cappuccino_pic_3_portrait.png │ │ │ │ │ ├── excelsa_coffee_beans_square.png │ │ │ │ │ ├── robusta_coffee_beans_square.png │ │ │ │ │ ├── arabica_coffee_beans_portrait.png │ │ │ │ │ ├── excelsa_coffee_beans_portrait.png │ │ │ │ │ ├── liberica_coffee_beans_square.png │ │ │ │ │ ├── robusta_coffee_beans_portrait.png │ │ │ │ │ ├── liberica_coffee_beans_portrait.png │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── launch_screen.jpg │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── launch_screen.jpg │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── launch_screen.jpg │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── launch_screen.jpg │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ └── launch_screen.jpg │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ └── ic_launcher.xml │ │ │ │ └── layout │ │ │ │ │ └── launch_screen.xml │ │ │ ├── play_store_512.png │ │ │ ├── assets │ │ │ │ ├── fonts │ │ │ │ │ ├── app_icons.ttf │ │ │ │ │ ├── Poppins-Bold.ttf │ │ │ │ │ ├── Poppins-Thin.ttf │ │ │ │ │ ├── Poppins-Black.ttf │ │ │ │ │ ├── Poppins-Light.ttf │ │ │ │ │ ├── Poppins-Medium.ttf │ │ │ │ │ ├── Poppins-ExtraBold.ttf │ │ │ │ │ ├── Poppins-Regular.ttf │ │ │ │ │ ├── Poppins-SemiBold.ttf │ │ │ │ │ └── Poppins-ExtraLight.ttf │ │ │ │ └── custom │ │ │ │ │ └── download.json │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── coffeelab │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ └── debug │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── ios ├── CoffeeLab │ ├── Images.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── AppDelegate.mm │ ├── PrivacyInfo.xcprivacy │ ├── Info.plist │ └── LaunchScreen.storyboard ├── .xcode.env ├── CoffeeLabTests │ ├── Info.plist │ └── CoffeeLabTests.m ├── Podfile └── CoffeeLab.xcodeproj │ └── xcshareddata │ └── xcschemes │ └── CoffeeLab.xcscheme ├── babel.config.js ├── _archive └── screenshots │ ├── screenshot-2.jpg │ ├── screenshot-3.jpg │ ├── screenshot-4.jpg │ ├── screenshot-5.jpg │ ├── screenshot-6.png │ ├── screenshot-7.png │ ├── screenshot-8.jpg │ ├── screenshot-9.jpg │ ├── screenshot-10.jpg │ ├── screenshot-11.png │ └── screenshot-1-home.png ├── react-native.config.js ├── .prettierrc.js ├── App.tsx ├── index.js ├── metro.config.js ├── Gemfile ├── __tests__ └── App.test.tsx ├── tailwind.config.js ├── .gitignore └── package.json /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/utils/helpers.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nativewind-env.d.ts: -------------------------------------------------------------------------------- 1 | /// -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | }; 4 | -------------------------------------------------------------------------------- /.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CoffeeLab", 3 | "displayName": "CoffeeLab" 4 | } 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native', 4 | }; 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@react-native/typescript-config/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CoffeeLab 3 | 4 | -------------------------------------------------------------------------------- /src/assets/images/gpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/images/gpay.png -------------------------------------------------------------------------------- /ios/CoffeeLab/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/assets/fonts/app_icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/app_icons.ttf -------------------------------------------------------------------------------- /src/assets/images/applepay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/images/applepay.png -------------------------------------------------------------------------------- /src/assets/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/images/avatar.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | plugins: ["nativewind/babel"], 4 | }; 5 | -------------------------------------------------------------------------------- /src/assets/icons/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/icons/ic_launcher.png -------------------------------------------------------------------------------- /src/assets/images/amazonpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/images/amazonpay.png -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-Black.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-Light.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-Medium.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-Thin.ttf -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-2.jpg -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-3.jpg -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-4.jpg -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-5.jpg -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-6.png -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-7.png -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-8.jpg -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-9.jpg -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-10.jpg -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-11.png -------------------------------------------------------------------------------- /android/app/src/main/play_store_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/play_store_512.png -------------------------------------------------------------------------------- /ios/CoffeeLab/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : RCTAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/fonts/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /_archive/screenshots/screenshot-1-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/_archive/screenshots/screenshot-1-home.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/gpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/gpay.png -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | project: { 3 | ios: {}, 4 | android: {}, 5 | }, 6 | assets: ['./src/assets'], 7 | }; -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/avatar.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #0C0F14 4 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/app_icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/app_icons.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/amazonpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/amazonpay.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/applepay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/applepay.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-Thin.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-Black.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-Light.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-Medium.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/assets/fonts/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/launch_screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable-hdpi/launch_screen.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/launch_screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable-mdpi/launch_screen.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/launch_screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable-xhdpi/launch_screen.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/latte_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/latte_pic_1_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/latte_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/latte_pic_2_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/latte_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/latte_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/launch_screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable-xxhdpi/launch_screen.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/launch_screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable-xxxhdpi/launch_screen.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/americano_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/americano_pic_1_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/americano_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/americano_pic_2_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/americano_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/americano_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/espresso_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/espresso_pic_1_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/espresso_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/espresso_pic_2_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/espresso_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/espresso_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/latte_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/latte_pic_1_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/latte_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/latte_pic_2_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/latte_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/latte_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/macchiato_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/macchiato_pic_1_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/macchiato_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/macchiato_pic_2_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/macchiato_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/macchiato_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/latte/square/latte_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/latte/square/latte_pic_1_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/latte/square/latte_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/latte/square/latte_pic_2_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/latte/square/latte_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/latte/square/latte_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/americano_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/americano_pic_1_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/americano_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/americano_pic_2_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/americano_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/americano_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/cappuccino_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/cappuccino_pic_1_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/cappuccino_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/cappuccino_pic_2_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/cappuccino_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/cappuccino_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/espresso_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/espresso_pic_1_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/espresso_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/espresso_pic_2_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/espresso_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/espresso_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/macchiato_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/macchiato_pic_1_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/macchiato_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/macchiato_pic_2_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/macchiato_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/macchiato_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/arabica_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/arabica_coffee_beans_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/black_coffee_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/black_coffee_pic_1_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/black_coffee_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/black_coffee_pic_1_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/black_coffee_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/black_coffee_pic_2_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/black_coffee_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/black_coffee_pic_2_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/black_coffee_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/black_coffee_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/black_coffee_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/black_coffee_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/cappuccino_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/cappuccino_pic_1_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/cappuccino_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/cappuccino_pic_2_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/cappuccino_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/cappuccino_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/excelsa_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/excelsa_coffee_beans_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/robusta_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/robusta_coffee_beans_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/latte/portrait/latte_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/latte/portrait/latte_pic_1_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/latte/portrait/latte_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/latte/portrait/latte_pic_2_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/latte/portrait/latte_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/latte/portrait/latte_pic_3_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/arabica_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/arabica_coffee_beans_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/excelsa_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/excelsa_coffee_beans_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/liberica_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/liberica_coffee_beans_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/robusta_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/robusta_coffee_beans_portrait.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/espresso/square/espresso_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/espresso/square/espresso_pic_1_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/espresso/square/espresso_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/espresso/square/espresso_pic_2_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/espresso/square/espresso_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/espresso/square/espresso_pic_3_square.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/liberica_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/android/app/src/main/res/drawable/liberica_coffee_beans_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/americano/square/americano_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/americano/square/americano_pic_1_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/americano/square/americano_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/americano/square/americano_pic_2_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/americano/square/americano_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/americano/square/americano_pic_3_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/cappuccino/square/cappuccino_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/cappuccino/square/cappuccino_pic_1_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/cappuccino/square/cappuccino_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/cappuccino/square/cappuccino_pic_2_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/cappuccino/square/cappuccino_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/cappuccino/square/cappuccino_pic_3_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/espresso/portrait/espresso_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/espresso/portrait/espresso_pic_1_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/espresso/portrait/espresso_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/espresso/portrait/espresso_pic_2_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/espresso/portrait/espresso_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/espresso/portrait/espresso_pic_3_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/macchiato/square/macchiato_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/macchiato/square/macchiato_pic_1_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/macchiato/square/macchiato_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/macchiato/square/macchiato_pic_2_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/macchiato/square/macchiato_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/macchiato/square/macchiato_pic_3_square.png -------------------------------------------------------------------------------- /App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import RootStackNavigator from './src/navigation/RootStackNavigator'; 3 | 4 | const App = () => { 5 | return ; 6 | }; 7 | 8 | export default App; 9 | -------------------------------------------------------------------------------- /src/assets/coffee_assets/americano/portrait/americano_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/americano/portrait/americano_pic_1_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/americano/portrait/americano_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/americano/portrait/americano_pic_2_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/americano/portrait/americano_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/americano/portrait/americano_pic_3_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/macchiato/portrait/macchiato_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/macchiato/portrait/macchiato_pic_1_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/macchiato/portrait/macchiato_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/macchiato/portrait/macchiato_pic_2_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/macchiato/portrait/macchiato_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/macchiato/portrait/macchiato_pic_3_portrait.png -------------------------------------------------------------------------------- /src/components/common/CustomIcon.ts: -------------------------------------------------------------------------------- 1 | import {createIconSetFromIcoMoon} from 'react-native-vector-icons' 2 | import icoMoonConfig from '../../../selection.json' 3 | export default createIconSetFromIcoMoon(icoMoonConfig) -------------------------------------------------------------------------------- /src/assets/coffee_assets/black_coffee/square/black_coffee_pic_1_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/black_coffee/square/black_coffee_pic_1_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/black_coffee/square/black_coffee_pic_2_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/black_coffee/square/black_coffee_pic_2_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/black_coffee/square/black_coffee_pic_3_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/black_coffee/square/black_coffee_pic_3_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/cappuccino/portrait/cappuccino_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/cappuccino/portrait/cappuccino_pic_1_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/cappuccino/portrait/cappuccino_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/cappuccino/portrait/cappuccino_pic_2_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/cappuccino/portrait/cappuccino_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/cappuccino/portrait/cappuccino_pic_3_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/arabica_coffee_beans/arabica_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/arabica_coffee_beans/arabica_coffee_beans_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/excelsa_coffee_beans/excelsa_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/excelsa_coffee_beans/excelsa_coffee_beans_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/robusta_coffee_beans/robusta_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/robusta_coffee_beans/robusta_coffee_beans_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/arabica_coffee_beans/arabica_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/arabica_coffee_beans/arabica_coffee_beans_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/black_coffee/portrait/black_coffee_pic_1_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/black_coffee/portrait/black_coffee_pic_1_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/black_coffee/portrait/black_coffee_pic_2_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/black_coffee/portrait/black_coffee_pic_2_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/black_coffee/portrait/black_coffee_pic_3_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/black_coffee/portrait/black_coffee_pic_3_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/excelsa_coffee_beans/excelsa_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/excelsa_coffee_beans/excelsa_coffee_beans_portrait.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/liberica_coffee_beans/liberica_coffee_beans_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/liberica_coffee_beans/liberica_coffee_beans_square.png -------------------------------------------------------------------------------- /src/assets/coffee_assets/robusta_coffee_beans/robusta_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/robusta_coffee_beans/robusta_coffee_beans_portrait.png -------------------------------------------------------------------------------- /src/types/common/orderItem.ts: -------------------------------------------------------------------------------- 1 | import { CartItem } from "./cartItem"; 2 | 3 | export interface OrderItem { 4 | orderDate: string; 5 | paymentMethod: string; 6 | totalPrice: string; 7 | itemList: CartItem[]; 8 | } 9 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /src/assets/coffee_assets/liberica_coffee_beans/liberica_coffee_beans_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovaLogics/coffee-lab-reactnative-app/HEAD/src/assets/coffee_assets/liberica_coffee_beans/liberica_coffee_beans_portrait.png -------------------------------------------------------------------------------- /ios/CoffeeLab/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/types/common/cartItem.ts: -------------------------------------------------------------------------------- 1 | import { Product } from "./product"; 2 | 3 | // - CartItem Item 4 | export interface CartItemPrice { 5 | size: string; 6 | price: string; 7 | currency: string; 8 | quantity: number; 9 | } 10 | 11 | export interface CartItem extends Product { 12 | prices: CartItemPrice[]; 13 | } 14 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); 2 | 3 | /** 4 | * Metro configuration 5 | * https://reactnative.dev/docs/metro 6 | * 7 | * @type {import('metro-config').MetroConfig} 8 | */ 9 | const config = {}; 10 | 11 | module.exports = mergeConfig(getDefaultConfig(__dirname), config); 12 | -------------------------------------------------------------------------------- /src/config/screenNames.ts: -------------------------------------------------------------------------------- 1 | export const SCREENS = { 2 | HOME: 'Home', 3 | CART: 'Cart', 4 | FAVORITE: 'Favorite', 5 | HISTORY: 'History', 6 | DETAIL: 'Detail', 7 | PAYMENT: 'Payment', 8 | }; 9 | 10 | export const NAVIGATORS = { 11 | ROOT_STACK: 'RootStackNavigator', 12 | TAB: 'TabNavigator', 13 | }; 14 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | rootProject.name = 'CoffeeLab' 5 | include ':app' 6 | includeBuild('../node_modules/@react-native/gradle-plugin') 7 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__tests__/App.test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: import explicitly to use the types shipped with jest. 10 | import {it} from '@jest/globals'; 11 | 12 | // Note: test renderer must be required after react-native. 13 | import renderer from 'react-test-renderer'; 14 | 15 | it('renders correctly', () => { 16 | renderer.create(); 17 | }); 18 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /src/config/constants.ts: -------------------------------------------------------------------------------- 1 | export const CONSTANTS = { 2 | APP_NAME: "CoffeeLab", 3 | THEMES: { 4 | LIGHT: "light", 5 | DARK: "dark", 6 | }, 7 | TITLES: { 8 | FAVORITES: "Favorites", 9 | ORDER_HISTORY: "Order History", 10 | }, 11 | PLACEHOLDER: { 12 | FIND_YOUR_COFFEE: "Find your Coffee...", 13 | }, 14 | LIMITS: { 15 | MAX_ITEMS_IN_CART: 20, 16 | MIN_PASSWORD_LENGTH: 8, 17 | }, 18 | GENERAL: { 19 | CATEGORY_ALL: "All", 20 | }, 21 | }; -------------------------------------------------------------------------------- /src/data/paymentOptions.ts: -------------------------------------------------------------------------------- 1 | import { images } from "../config/assets"; 2 | 3 | export const PAYMENT_OPTIONS = [ 4 | { 5 | name: "Wallet", 6 | icon: "icon", 7 | isIcon: true, 8 | }, 9 | { 10 | name: "Google Pay", 11 | icon: images.logoGooglePay, 12 | isIcon: false, 13 | }, 14 | { 15 | name: "Apple Pay", 16 | icon: images.logoApplePay, 17 | isIcon: false, 18 | }, 19 | { 20 | name: "Amazon Pay", 21 | icon: images.logoAmazonPay, 22 | isIcon: false, 23 | }, 24 | ]; -------------------------------------------------------------------------------- /src/components/specific/ProfilePicture.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Image, View } from 'react-native' 3 | import { images } from '../../config/assets' 4 | 5 | const ProfilePicture = () => { 6 | return ( 7 | 10 | 13 | 14 | ) 15 | } 16 | 17 | export default ProfilePicture; -------------------------------------------------------------------------------- /android/app/src/main/res/layout/launch_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 15 | -------------------------------------------------------------------------------- /src/types/common/product.ts: -------------------------------------------------------------------------------- 1 | import { ImageProps } from "react-native"; 2 | 3 | // - Product 4 | export interface ProductPrice { 5 | size: string; 6 | price: string; 7 | currency: string; 8 | } 9 | 10 | export interface Product { 11 | id: string; 12 | name: string; 13 | description: string; 14 | roasted: string; 15 | imageLinkSquare: ImageProps; 16 | imageLinkPortrait: ImageProps; 17 | ingredients: string; 18 | specialIngredient: string; 19 | prices: ProductPrice[]; 20 | averageRating: number; 21 | ratingsCount: string; 22 | isFavorite: boolean; 23 | type: 'Coffee' | 'Bean'; 24 | index: number; 25 | } -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "34.0.0" 4 | minSdkVersion = 23 5 | compileSdkVersion = 34 6 | targetSdkVersion = 34 7 | ndkVersion = "26.1.10909125" 8 | kotlinVersion = "1.9.24" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | apply plugin: "com.facebook.react.rootproject" 22 | -------------------------------------------------------------------------------- /src/config/messages.ts: -------------------------------------------------------------------------------- 1 | export const MESSAGES = { 2 | DEFAULTS: { 3 | CART_IS_EMPTY: "Cart is Empty!", 4 | NO_FAVORITES: "No Favorites", 5 | NO_ORDER_HISTORY:"No Order History!", 6 | }, 7 | SUCCESS: { 8 | ITEM_ADDED_TO_CART: (itemName: string) => `${itemName} is Added to Cart`, 9 | ITEM_ADDED: "Item has been added to your cart successfully.", 10 | PAYMENT_COMPLETED: "Payment was completed successfully.", 11 | }, 12 | ERROR: { 13 | NETWORK: "Unable to connect. Please check your internet connection.", 14 | OUT_OF_STOCK: "Sorry, this item is currently out of stock.", 15 | }, 16 | INFO: { 17 | WELCOME: "Welcome to our app! Explore and enjoy your shopping experience.", 18 | UPDATE_AVAILABLE: "A new update is available. Please update your app.", 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /ios/CoffeeLabTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/components/specific/BackgroundIcon.tsx: -------------------------------------------------------------------------------- 1 | // React and React Native 2 | import React from 'react'; 3 | import { View } from 'react-native'; 4 | // Configuration and components 5 | import CustomIcon from '../common/CustomIcon'; 6 | 7 | interface BackgroundIconProps { 8 | name: string; 9 | color: string; 10 | size: number; 11 | backgroundColor: string; 12 | } 13 | 14 | const BackgroundIcon: React.FC = ({ 15 | name, 16 | color, 17 | size, 18 | backgroundColor, 19 | }) => { 20 | return ( 21 | 24 | 29 | 30 | ) 31 | } 32 | 33 | export default BackgroundIcon; -------------------------------------------------------------------------------- /src/utils/dimensionsUtil.ts: -------------------------------------------------------------------------------- 1 | import { Dimensions, PixelRatio } from 'react-native'; 2 | 3 | const { width, height } = Dimensions.get('window'); 4 | 5 | export default class DimensionsUtil { 6 | // Get screen width 7 | static getScreenWidth(): number { 8 | return width; 9 | } 10 | 11 | // Get screen height 12 | static getScreenHeight(): number { 13 | return height; 14 | } 15 | 16 | // Convert px to dp 17 | static pxToDp(px: number): number { 18 | return PixelRatio.roundToNearestPixel(px); 19 | } 20 | 21 | // Convert dp to percentage of screen width 22 | static widthPercentage(percentage: number): number { 23 | return (width * percentage) / 100; 24 | } 25 | 26 | // Convert dp to percentage of screen height 27 | // usage : heightPercentage(10); // 10% of the screen height 28 | static heightPercentage(percentage: number): number { 29 | return (height * percentage) / 100; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/screens/OrderHistory/OrderHistoryViewModel.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { useStore } from '../../state/useStore'; 3 | import { SCREENS } from '../../config/screenNames'; 4 | import { lottieAnimations } from '../../config/assets'; 5 | 6 | export const useOrderHistoryViewModel = (navigation: any) => { 7 | const orderHistoryList = useStore((state: any) => state.orderHistoryList); 8 | const [showAnimation, setShowAnimation] = useState(false); 9 | 10 | const navigationHandler = ({ index, id, type }: any) => { 11 | navigation.push(SCREENS.DETAIL, { index, id, type }); 12 | }; 13 | 14 | const downloadActionHandler = () => { 15 | setShowAnimation(true); 16 | setTimeout(() => { 17 | setShowAnimation(false); 18 | }, 1500); 19 | }; 20 | 21 | return { 22 | orderHistoryList, 23 | showAnimation, 24 | navigationHandler, 25 | downloadActionHandler, 26 | lottieAnimations, 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /ios/CoffeeLab/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | 5 | @implementation AppDelegate 6 | 7 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 8 | { 9 | self.moduleName = @"CoffeeLab"; 10 | // You can add your custom initial props in the dictionary below. 11 | // They will be passed down to the ViewController used by React Native. 12 | self.initialProps = @{}; 13 | 14 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 15 | } 16 | 17 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 18 | { 19 | return [self bundleURL]; 20 | } 21 | 22 | - (NSURL *)bundleURL 23 | { 24 | #if DEBUG 25 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 26 | #else 27 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 28 | #endif 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /src/config/colors.ts: -------------------------------------------------------------------------------- 1 | type ColorVariants = { 2 | red: string; 3 | orange: string; 4 | black: string; 5 | darkGrey: string; 6 | grey: string; 7 | lightGrey: string; 8 | white: string; 9 | blackTransparent: string; 10 | }; 11 | 12 | interface Colors { 13 | primary: ColorVariants; 14 | secondary: ColorVariants; 15 | } 16 | 17 | export const colors: Colors = { 18 | primary: { 19 | red: '#DC3535', 20 | orange: '#D17842', 21 | black: '#0C0F14', 22 | darkGrey: '#141921', 23 | grey: '#252A32', 24 | lightGrey: '#52555A', 25 | white: '#FFFFFF', 26 | blackTransparent: 'rgba(12,15,20,0.5)', 27 | }, 28 | secondary: { 29 | red: '#E05A5A', 30 | orange: '#E0925D', 31 | black: '#15181D', 32 | darkGrey: '#21262E', 33 | grey: '#252A32', 34 | lightGrey: '#AEAEAE', 35 | white: '#F5F5F5', 36 | blackTransparent: 'rgba(0,0,0,0.7)', 37 | }, 38 | }; -------------------------------------------------------------------------------- /src/components/common/HeaderBar.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, Text } from 'react-native'; 3 | import { fontSizes } from '../../config/fonts'; 4 | import { colors } from '../../config/colors'; 5 | import { iconSet } from '../../config/assets'; 6 | import GradientIconBG from './GradientIconBG'; 7 | import ProfilePicture from '../specific/ProfilePicture'; 8 | 9 | interface HeaderBarProps { 10 | title?: string; 11 | } 12 | 13 | const HeaderBar: React.FC = ({ title }) => { 14 | return ( 15 | 16 | 21 | 22 | {title} 23 | 24 | 25 | 26 | ); 27 | }; 28 | 29 | export default HeaderBar; -------------------------------------------------------------------------------- /src/screens/Cart/CartViewModel.ts: -------------------------------------------------------------------------------- 1 | import { useStore } from "../../state/useStore"; 2 | 3 | export const useCartViewModel = () => { 4 | const cartList= useStore((state: any) => state.cartList); 5 | const cartPrice = useStore((state: any) => state.cartPrice); 6 | const calculateCartPrice = useStore((state: any) => state.calculateCartPrice); 7 | const incrementCartItemQuantity = useStore((state: any) => state.incrementCartItemQuantity); 8 | const decrementCartItemQuantity = useStore((state: any) => state.decrementCartItemQuantity); 9 | 10 | 11 | const handleIncrementQuantity = (id: string, size: string) => { 12 | incrementCartItemQuantity(id, size); 13 | calculateCartPrice(); 14 | }; 15 | 16 | const handleDecrementQuantity = (id: string, size: string) => { 17 | decrementCartItemQuantity(id, size); 18 | calculateCartPrice(); 19 | }; 20 | 21 | return { 22 | cartList, 23 | cartPrice, 24 | handleIncrementQuantity, 25 | handleDecrementQuantity, 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /src/components/common/EmptyListAnimation.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, Text } from 'react-native'; 3 | import LottieView from 'lottie-react-native'; 4 | import { lottieAnimations } from '../../config/assets'; 5 | 6 | interface EmptyListAnimationProps { 7 | title: string; 8 | } 9 | 10 | const EmptyListAnimation: React.FC = ({ 11 | title 12 | }) => { 13 | return ( 14 | 15 | {/* Animation View */} 16 | 22 | {/* Title Text */} 23 | 26 | {title} 27 | 28 | 29 | ); 30 | }; 31 | 32 | export default EmptyListAnimation; -------------------------------------------------------------------------------- /src/components/common/PopUpAnimation.tsx: -------------------------------------------------------------------------------- 1 | import { StyleSheet, Text, View } from 'react-native' 2 | import React from 'react' 3 | import LottieView from 'lottie-react-native'; 4 | import { colors } from '../../config/colors'; 5 | 6 | interface PopUpAnimationProps { 7 | style: any; 8 | source: any; 9 | } 10 | 11 | const PopUpAnimation: React.FC = ({ 12 | style, 13 | source, 14 | }) => { 15 | return ( 16 | 17 | 22 | 23 | ) 24 | } 25 | 26 | const styles = StyleSheet.create({ 27 | lottieAnimationContainer: { 28 | flex: 1, 29 | position: "absolute", 30 | top: 0, 31 | bottom: 0, 32 | left: 0, 33 | right: 0, 34 | zIndex: 10, 35 | backgroundColor: colors.secondary.blackTransparent, 36 | justifyContent: "center", 37 | }, 38 | }) 39 | 40 | export default PopUpAnimation; -------------------------------------------------------------------------------- /src/config/assets.ts: -------------------------------------------------------------------------------- 1 | const images = { 2 | avatarDefault: require('../assets/images/avatar.png'), 3 | logoAmazonPay: require('../assets/images/amazonpay.png'), 4 | logoApplePay: require('../assets/images/applepay.png'), 5 | logoGooglePay: require('../assets/images/gpay.png'), 6 | }; 7 | 8 | const icons = { 9 | search: require('../assets/icons/ic_launcher.png'), 10 | }; 11 | 12 | const iconSet = { 13 | add: 'add', 14 | close: 'close', 15 | bean: 'bean', 16 | beans: 'beans', 17 | bell: 'bell', 18 | cart: 'cart', 19 | chip: 'chip', 20 | drop: 'drop', 21 | home: 'home', 22 | left: 'left', 23 | like: 'like', 24 | location: 'location', 25 | menu: 'menu', 26 | minus: 'minus', 27 | search: 'search', 28 | star: 'star', 29 | visa: 'visa', 30 | wallet: 'wallet', 31 | }; 32 | 33 | const lottieAnimations = { 34 | coffeecup: require('../assets/lottie/coffeecup.json'), 35 | download: require('../assets/lottie/download.json'), 36 | successful: require('../assets/lottie/successful.json'), 37 | }; 38 | 39 | export { images, icons, iconSet, lottieAnimations }; 40 | -------------------------------------------------------------------------------- /ios/CoffeeLab/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/config/specialTypes.ts: -------------------------------------------------------------------------------- 1 | // Product type related constants 2 | export const PRODUCT_TYPES = { 3 | COFFEE: "Coffee", 4 | BEAN: "Bean", 5 | }; 6 | 7 | // Payment related constants 8 | export const PAYMENT_METHODS = { 9 | WALLET: "Wallet", 10 | CREDIT_CARD: "Credit Card", 11 | GOOGLE_PAY: "Google Pay", 12 | APPLE_PAY: "Apple Pay", 13 | AMAZON_PAY: "Amazon Pay", 14 | }; 15 | 16 | // Currency and Conversion Constants 17 | // Usage: CURRENCY.USD.symbol 18 | export const CURRENCY = { 19 | USD: { code: "USD", symbol: "$" }, 20 | EUR: { code: "EUR", symbol: "€" }, 21 | INR: { code: "INR", symbol: "₹" }, 22 | GBP: { code: "GBP", symbol: "£" }, 23 | AUD: { code: "AUD", symbol: "A$" }, 24 | CAD: { code: "CAD", symbol: "C$" }, 25 | JPY: { code: "JPY", symbol: "¥" }, 26 | CNY: { code: "CNY", symbol: "¥" }, 27 | CHF: { code: "CHF", symbol: "Fr" }, 28 | SEK: { code: "SEK", symbol: "kr" }, 29 | }; 30 | 31 | 32 | export const BUTTON_TITLES = { 33 | ADD_TO_CART: "Add to Cart", 34 | BUY_NOW: "Buy Now", 35 | PAY_WITH: (paymentMode: string) => `Pay with ${paymentMode}`, 36 | PAY: "Pay", 37 | }; 38 | -------------------------------------------------------------------------------- /src/state/util/favoriteActions.ts: -------------------------------------------------------------------------------- 1 | import produce from "immer"; 2 | 3 | export const addToFavoriteList = (state: any, type: string, id: string) => { 4 | const list = type === "Coffee" ? state.coffeeList : state.beanList; 5 | const index = list.findIndex((item: any) => item.id === id); 6 | 7 | if (index !== -1) { 8 | const item = list[index]; 9 | 10 | if (!item.isFavorite) { 11 | item.isFavorite = true; 12 | state.favoriteList.unshift(item); 13 | } 14 | } 15 | }; 16 | 17 | export const deleteFromFavoriteList = (state: any, type: string, id: string) => { 18 | const list = type === "Coffee" ? state.coffeeList : state.beanList; 19 | const indexInList = list.findIndex((item: any) => item.id === id); 20 | 21 | if (indexInList !== -1) { 22 | const item = list[indexInList]; 23 | if (item.isFavorite) { 24 | item.isFavorite = false; 25 | } 26 | } 27 | 28 | const indexInFavorites = state.favoriteList.findIndex((item: any) => item.id === id); 29 | 30 | if (indexInFavorites !== -1) { 31 | state.favoriteList.splice(indexInFavorites, 1); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /ios/CoffeeLab/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/screens/Payment/PaymentViewModel.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { useStore } from '../../state/useStore'; 3 | import { PAYMENT_METHODS } from '../../config/specialTypes'; 4 | import { NAVIGATORS, SCREENS } from '../../config/screenNames'; 5 | 6 | export const usePaymentViewModel = (navigation: any, route: any) => { 7 | const calculateCartPrice = useStore((state: any) => state.calculateCartPrice); 8 | const addToOrderHistoryFromCart = useStore((state: any) => state.addToOrderHistoryFromCart); 9 | 10 | const [paymentMode, setPaymentMode] = useState(PAYMENT_METHODS.CREDIT_CARD); 11 | const [showSuccessAnimation, setShowSuccessAnimation] = useState(false); 12 | 13 | const buttonPressHandler = () => { 14 | setShowSuccessAnimation(true); 15 | addToOrderHistoryFromCart(paymentMode); 16 | calculateCartPrice(); 17 | setTimeout(() => { 18 | setShowSuccessAnimation(false); 19 | navigation.navigate(NAVIGATORS.TAB, { screen: SCREENS.HISTORY }); 20 | }, 2000); 21 | }; 22 | 23 | return { 24 | paymentMode, 25 | setPaymentMode, 26 | showSuccessAnimation, 27 | buttonPressHandler, 28 | amount: route.params.amount, 29 | }; 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/coffeelab/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.coffeelab 2 | 3 | import android.os.Bundle; 4 | import com.facebook.react.ReactActivity 5 | import com.facebook.react.ReactActivityDelegate 6 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 7 | import com.facebook.react.defaults.DefaultReactActivityDelegate 8 | 9 | // react-native-splash-screen >= 0.3.1 10 | import org.devio.rn.splashscreen.SplashScreen; 11 | 12 | class MainActivity : ReactActivity() { 13 | 14 | /** 15 | * Returns the name of the main component registered from JavaScript. This is used to schedule 16 | * rendering of the component. 17 | */ 18 | override fun getMainComponentName(): String = "CoffeeLab" 19 | 20 | override fun onCreate(savedInstanceState: Bundle?) { 21 | SplashScreen.show(this); 22 | super.onCreate(null) 23 | } 24 | 25 | /** 26 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 27 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 28 | */ 29 | override fun createReactActivityDelegate(): ReactActivityDelegate = 30 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/components/common/GradientIconBG.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View } from 'react-native'; 3 | import LinearGradient from 'react-native-linear-gradient'; 4 | import tw from 'twrnc'; 5 | import CustomIcon from './CustomIcon'; 6 | import { colors } from '../../config/colors'; 7 | 8 | interface GradientIconBGProps { 9 | name: string; 10 | color: string; 11 | size: number; 12 | } 13 | 14 | const GradientIconBG: React.FC = ({ 15 | name, 16 | color, 17 | size 18 | }) => { 19 | return ( 20 | 23 | 28 | 33 | 34 | 35 | ); 36 | }; 37 | 38 | export default GradientIconBG; -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Resolve react_native_pods.rb with node to allow for hoisting 2 | require Pod::Executable.execute_command('node', ['-p', 3 | 'require.resolve( 4 | "react-native/scripts/react_native_pods.rb", 5 | {paths: [process.argv[1]]}, 6 | )', __dir__]).strip 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | linkage = ENV['USE_FRAMEWORKS'] 12 | if linkage != nil 13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 14 | use_frameworks! :linkage => linkage.to_sym 15 | end 16 | 17 | target 'CoffeeLab' do 18 | config = use_native_modules! 19 | 20 | use_react_native!( 21 | :path => config[:reactNativePath], 22 | # An absolute path to your application root. 23 | :app_path => "#{Pod::Config.instance.installation_root}/.." 24 | ) 25 | 26 | target 'CoffeeLabTests' do 27 | inherit! :complete 28 | # Pods for testing 29 | end 30 | 31 | post_install do |installer| 32 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 33 | react_native_post_install( 34 | installer, 35 | config[:reactNativePath], 36 | :mac_catalyst_enabled => false, 37 | # :ccache_enabled => true 38 | ) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/screens/Favorite/FavoriteViewModel.ts: -------------------------------------------------------------------------------- 1 | import { useCallback } from 'react'; 2 | import { useStore } from '../../state/useStore'; 3 | import { SCREENS } from '../../config/screenNames'; 4 | 5 | export const useFavoriteViewModel = (navigation: any) => { 6 | const favoriteList = useStore((state: any) => state.favoriteList); 7 | const addToFavoriteList = useStore((state: any) => state.addToFavoriteList); 8 | const deleteFromFavoriteList = useStore((state: any) => state.deleteFromFavoriteList); 9 | 10 | const toggleFavorite = useCallback( 11 | (id: string, type: string, isFavorite: boolean) => { 12 | isFavorite ? deleteFromFavoriteList(id, type) : addToFavoriteList(id, type); 13 | }, 14 | [addToFavoriteList, deleteFromFavoriteList] 15 | ); 16 | 17 | // const toggleFavorite = (id: string, type: string, isFavorite: boolean) => { 18 | // isFavorite ? deleteFromFavoriteList(id, type) : addToFavoriteList(id, type); 19 | // }; 20 | 21 | const navigateToDetail = useCallback( 22 | (item: any) => { 23 | navigation.push(SCREENS.DETAIL, { 24 | index: item.index, 25 | id: item.id, 26 | type: item.type, 27 | }); 28 | }, 29 | [navigation] 30 | ); 31 | 32 | return { 33 | favoriteList, 34 | toggleFavorite, 35 | navigateToDetail, 36 | }; 37 | }; 38 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ["./App.{js,jsx,ts,tsx}", 3 | "./src/**/*.{js,jsx,ts,tsx}" 4 | ], 5 | theme: { 6 | extend: { 7 | colors: { 8 | primary: { 9 | red: '#DC3535', 10 | orange: '#D17842', 11 | black: '#0C0F14', 12 | darkGrey: '#141921', 13 | grey: '#252A32', 14 | lightGrey: '#52555A', 15 | white: '#FFFFFF', 16 | blackTransparent: 'rgba(12,15,20,0.5)', 17 | }, 18 | secondary: { 19 | red: '#E05A5A', 20 | orange: '#E0925D', 21 | black: '#15181D', 22 | darkGrey: '#21262E', 23 | grey: '#252A32', 24 | lightGrey: '#AEAEAE', 25 | white: '#F5F5F5', 26 | blackTransparent: 'rgba(0,0,0,0.7)', 27 | }, 28 | }, 29 | fontFamily: { 30 | poppinsBlack: ['Poppins-Black'], 31 | poppinsBold: ['Poppins-Bold'], 32 | poppinsExtraBold: ['Poppins-ExtraBold'], 33 | poppinsExtraLight: ['Poppins-ExtraLight'], 34 | poppinsLight: ['Poppins-Light'], 35 | poppinsMedium: ['Poppins-Medium'], 36 | poppinsRegular: ['Poppins-Regular'], 37 | poppinsSemiBold: ['Poppins-SemiBold'], 38 | poppinsThin: ['Poppins-Thin'], 39 | }, 40 | }, 41 | }, 42 | plugins: [], 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/config/fonts.ts: -------------------------------------------------------------------------------- 1 | type FontVariants = { 2 | black: string; 3 | bold: string; 4 | extraBold: string; 5 | extraLight: string; 6 | light: string; 7 | medium: string; 8 | regular: string; 9 | semiBold: string; 10 | thin: string; 11 | }; 12 | 13 | interface Fonts { 14 | poppins: FontVariants; 15 | } 16 | 17 | export const fonts: Fonts = { 18 | poppins: { 19 | black: 'Poppins-Black', 20 | bold: 'Poppins-Bold', 21 | extraBold: 'Poppins-ExtraBold', 22 | extraLight: 'Poppins-ExtraLight', 23 | light: 'Poppins-Light', 24 | medium: 'Poppins-Medium', 25 | regular: 'Poppins-Regular', 26 | semiBold: 'Poppins-SemiBold', 27 | thin: 'Poppins-Thin', 28 | }, 29 | }; 30 | 31 | 32 | //----------------------------------- 33 | 34 | interface FontSizes { 35 | size8: number; 36 | size10: number; 37 | size12: number; 38 | size14: number; 39 | size16: number; 40 | size18: number; 41 | size20: number; 42 | size24: number; 43 | size28: number; 44 | size30: number; 45 | size32: number; 46 | } 47 | 48 | export const fontSizes: FontSizes = { 49 | size8: 8, 50 | size10: 10, 51 | size12: 12, 52 | size14: 14, 53 | size16: 16, 54 | size18: 18, 55 | size20: 20, 56 | size24: 24, 57 | size28: 28, 58 | size30: 30, 59 | size32: 32, 60 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | **/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | .cxx/ 34 | *.keystore 35 | !debug.keystore 36 | 37 | # node.js 38 | # 39 | node_modules/ 40 | npm-debug.log 41 | yarn-error.log 42 | 43 | # fastlane 44 | # 45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 46 | # screenshots whenever they are needed. 47 | # For more information about the recommended setup visit: 48 | # https://docs.fastlane.tools/best-practices/source-control/ 49 | 50 | **/fastlane/report.xml 51 | **/fastlane/Preview.html 52 | **/fastlane/screenshots 53 | **/fastlane/test_output 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # Ruby / CocoaPods 59 | **/Pods/ 60 | /vendor/bundle/ 61 | 62 | # Temporary files created by Metro to check the health of the file watcher 63 | .metro-health-check* 64 | 65 | # testing 66 | /coverage 67 | 68 | # Yarn 69 | .yarn/* 70 | !.yarn/patches 71 | !.yarn/plugins 72 | !.yarn/releases 73 | !.yarn/sdks 74 | !.yarn/versions 75 | -------------------------------------------------------------------------------- /src/navigation/RootStackNavigator.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | import { createNativeStackNavigator } from '@react-navigation/native-stack'; 3 | import { NavigationContainer } from '@react-navigation/native'; 4 | import SplashScreen from 'react-native-splash-screen'; 5 | import { NAVIGATORS, SCREENS } from '../config/screenNames'; 6 | 7 | // Navigators 8 | import TabNavigator from './TabNavigator'; 9 | 10 | // Screens 11 | import DetailScreen from '../screens/Detail/DetailScreen'; 12 | import PaymentScreen from '../screens/Payment/PaymentScreen'; 13 | 14 | const Stack = createNativeStackNavigator(); 15 | 16 | const RootStackNavigator = () => { 17 | useEffect(() => { 18 | SplashScreen.hide(); 19 | }, []); 20 | 21 | return ( 22 | 23 | 24 | 29 | 34 | 39 | 40 | 41 | ); 42 | }; 43 | 44 | export default RootStackNavigator; 45 | -------------------------------------------------------------------------------- /src/screens/Favorite/components/FavoriteItemCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Text, View } from 'react-native' 3 | import { colors } from '../../../config/colors'; 4 | import { Product } from '../../../types/common/product'; 5 | import ImageBackdropInfo from '../../../components/common/ImageBackdropInfo'; 6 | import LinearGradient from 'react-native-linear-gradient'; 7 | 8 | interface FavoriteItemCardProps { 9 | product: Product; 10 | toggleFavorite: (id: string, type: string, isFavorite: boolean) => void; 11 | } 12 | 13 | const FavoriteItemCard: React.FC = ({ 14 | product, 15 | toggleFavorite, 16 | }) => { 17 | return ( 18 | 19 | { }} 24 | /> 25 | 26 | 31 | {/* Description Title */} 32 | 33 | Description 34 | 35 | {/* Description Area */} 36 | 37 | {product.description} 38 | 39 | 40 | 41 | ) 42 | } 43 | 44 | export default FavoriteItemCard; -------------------------------------------------------------------------------- /android/app/src/main/java/com/coffeelab/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.coffeelab 2 | 3 | import android.app.Application 4 | import com.facebook.react.PackageList 5 | import com.facebook.react.ReactApplication 6 | import com.facebook.react.ReactHost 7 | import com.facebook.react.ReactNativeHost 8 | import com.facebook.react.ReactPackage 9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load 10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost 11 | import com.facebook.react.defaults.DefaultReactNativeHost 12 | import com.facebook.soloader.SoLoader 13 | 14 | class MainApplication : Application(), ReactApplication { 15 | 16 | override val reactNativeHost: ReactNativeHost = 17 | object : DefaultReactNativeHost(this) { 18 | override fun getPackages(): List = 19 | PackageList(this).packages.apply { 20 | // Packages that cannot be autolinked yet can be added manually here, for example: 21 | // add(MyReactNativePackage()) 22 | } 23 | 24 | override fun getJSMainModuleName(): String = "index" 25 | 26 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG 27 | 28 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 29 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED 30 | } 31 | 32 | override val reactHost: ReactHost 33 | get() = getDefaultReactHost(applicationContext, reactNativeHost) 34 | 35 | override fun onCreate() { 36 | super.onCreate() 37 | SoLoader.init(this, false) 38 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 39 | // If you opted-in for the New Architecture, we load the native entry point for this app. 40 | load() 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CoffeeLab", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "lint": "eslint .", 9 | "start": "react-native start", 10 | "test": "jest" 11 | }, 12 | "dependencies": { 13 | "@react-native-async-storage/async-storage": "^2.1.0", 14 | "@react-native-community/blur": "^4.4.1", 15 | "@react-navigation/bottom-tabs": "^7.2.0", 16 | "@react-navigation/native": "^7.0.14", 17 | "@react-navigation/native-stack": "^7.2.0", 18 | "immer": "^10.1.1", 19 | "lottie-react-native": "^7.2.2", 20 | "nativewind": "^2.0.11", 21 | "react": "18.3.1", 22 | "react-native": "0.75.4", 23 | "react-native-linear-gradient": "^2.8.3", 24 | "react-native-safe-area-context": "^5.1.0", 25 | "react-native-screens": "^4.5.0", 26 | "react-native-splash-screen": "^3.3.0", 27 | "react-native-vector-icons": "^10.2.0", 28 | "twrnc": "^4.6.1", 29 | "zustand": "^5.0.3" 30 | }, 31 | "devDependencies": { 32 | "@babel/core": "^7.20.0", 33 | "@babel/preset-env": "^7.20.0", 34 | "@babel/runtime": "^7.20.0", 35 | "@react-native/babel-preset": "0.75.4", 36 | "@react-native/eslint-config": "0.75.4", 37 | "@react-native/metro-config": "0.75.4", 38 | "@react-native/typescript-config": "0.75.4", 39 | "@types/react": "^18.2.6", 40 | "@types/react-native-vector-icons": "^6.4.18", 41 | "@types/react-test-renderer": "^18.0.0", 42 | "babel-jest": "^29.6.3", 43 | "eslint": "^8.19.0", 44 | "jest": "^29.6.3", 45 | "prettier": "2.8.8", 46 | "react-test-renderer": "18.3.1", 47 | "tailwindcss": "^3.3.2", 48 | "typescript": "5.0.4" 49 | }, 50 | "engines": { 51 | "node": ">=18" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/screens/Home/components/CategoryScroller.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ScrollView, View, TouchableOpacity, Text } from 'react-native'; 3 | import tw from 'twrnc'; 4 | 5 | type CategoryScrollerProps = { 6 | categories: string[]; 7 | categoryIndex: number; 8 | onCategoryChange: (index: number) => void; 9 | }; 10 | 11 | const CategoryScroller: React.FC = ({ 12 | categories, 13 | categoryIndex, 14 | onCategoryChange, 15 | }) => { 16 | return ( 17 | 22 | {categories.map((category, index) => { 23 | const isActive = categoryIndex === index; 24 | 25 | return ( 26 | 29 | onCategoryChange(index)} 32 | > 33 | 37 | {category} 38 | 39 | {isActive && } 40 | 41 | 42 | ); 43 | })} 44 | 45 | ); 46 | }; 47 | 48 | export default CategoryScroller; 49 | -------------------------------------------------------------------------------- /src/components/common/PaymentFooter.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Text, TouchableOpacity, View } from 'react-native' 3 | 4 | interface PriceProps { 5 | price: string; 6 | currency: string; 7 | } 8 | 9 | interface PaymentFooterProps { 10 | price: PriceProps; 11 | buttonTitle: string; 12 | buttonPressHandler: any; 13 | priceContainerStyle: string; 14 | } 15 | 16 | const PaymentFooter: React.FC = ({ 17 | price, 18 | buttonTitle, 19 | buttonPressHandler, 20 | priceContainerStyle, 21 | }) => { 22 | return ( 23 | 24 | {/* Price View */} 25 | 26 | 27 | Price 28 | 29 | 30 | {`${price.currency} `} 31 | 32 | {price.price} 33 | 34 | 35 | 36 | 37 | {/* Action Button */} 38 | buttonPressHandler()}> 42 | 43 | {buttonTitle} 44 | 45 | 46 | 47 | ); 48 | }; 49 | 50 | export default PaymentFooter; 51 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | android.enableJetifier=true 25 | 26 | # Use this property to specify which architecture you want to build. 27 | # You can also override it from the CLI using 28 | # ./gradlew -PreactNativeArchitectures=x86_64 29 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 30 | 31 | # Use this property to enable support to the new architecture. 32 | # This will allow you to use TurboModules and the Fabric render in 33 | # your application. You should enable this flag either if you want 34 | # to write custom TurboModules/Fabric components OR use libraries that 35 | # are providing them. 36 | newArchEnabled=false 37 | 38 | # Use this property to enable or disable the Hermes JS engine. 39 | # If set to false, you will be using JSC instead. 40 | hermesEnabled=true 41 | -------------------------------------------------------------------------------- /src/screens/Detail/DetailViewModel.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { useStore } from '../../state/useStore'; 3 | import { Product } from '../../types/common/product'; 4 | import { PRODUCT_TYPES } from '../../config/specialTypes'; 5 | import { CartItem } from '../../types/common/cartItem'; 6 | import { NAVIGATORS, SCREENS } from '../../config/screenNames'; 7 | 8 | const DetailViewModel = (navigation: any, route: any) => { 9 | const addToCart = useStore((state: any) => state.addToCart); 10 | const addToFavoriteList = useStore((state: any) => state.addToFavoriteList); 11 | const calculateCartPrice = useStore((state: any) => state.calculateCartPrice); 12 | const deleteFromFavoriteList = useStore((state: any) => state.deleteFromFavoriteList); 13 | 14 | const selectedItem: Product = useStore((state: any) => 15 | route.params.type == PRODUCT_TYPES.COFFEE ? state.coffeeList : state.beanList, 16 | )[route.params.index]; 17 | 18 | const [fullDescription, setFullDescription] = useState(false); 19 | const [price, setPrice] = useState(selectedItem.prices[0]); 20 | 21 | const backHandler = () => { 22 | navigation.pop(); 23 | }; 24 | 25 | const toggleFavorite = (id: string, type: string, isFavorite: boolean) => { 26 | isFavorite ? deleteFromFavoriteList(id, type) : addToFavoriteList(id, type); 27 | }; 28 | 29 | const toggleDescription = () => { 30 | setFullDescription((prev) => !prev); 31 | }; 32 | 33 | const addToCartHandler = () => { 34 | const cartItem: CartItem = { 35 | ...selectedItem, 36 | prices: [{ ...price, quantity: 1 }] 37 | }; 38 | addToCart(cartItem); 39 | calculateCartPrice(); 40 | navigation.navigate(NAVIGATORS.TAB, { screen: SCREENS.CART }); 41 | }; 42 | 43 | return { 44 | selectedItem, 45 | fullDescription, 46 | price, 47 | backHandler, 48 | toggleFavorite, 49 | toggleDescription, 50 | setPrice, 51 | addToCartHandler 52 | }; 53 | }; 54 | 55 | export default DetailViewModel; -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/CoffeeLab/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | CoffeeLab 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSAllowsLocalNetworking 32 | 33 | 34 | NSLocationWhenInUseUsageDescription 35 | 36 | UILaunchStoryboardName 37 | LaunchScreen 38 | UIRequiredDeviceCapabilities 39 | 40 | arm64 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | UIAppFonts 51 | 52 | app_icons.ttf 53 | Poppins-Black.ttf 54 | Poppins-Bold.ttf 55 | Poppins-ExtraBold.ttf 56 | Poppins-ExtraLight.ttf 57 | Poppins-Light.ttf 58 | Poppins-Medium.ttf 59 | Poppins-Regular.ttf 60 | Poppins-SemiBold.ttf 61 | Poppins-Thin.ttf 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/screens/Home/components/SearchInput.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, TextInput, TouchableOpacity } from 'react-native'; 3 | import { fontSizes } from '../../../config/fonts'; 4 | import { colors } from '../../../config/colors'; 5 | import { iconSet } from '../../../config/assets'; 6 | import { CONSTANTS } from '../../../config/constants'; 7 | import CustomIcon from '../../../components/common/CustomIcon'; 8 | 9 | type SearchInputProps = { 10 | searchText: string; 11 | setSearchText: (text: string) => void; 12 | onSearchCoffee: (text: string) => void; 13 | onResetSearch: () => void; 14 | }; 15 | 16 | const SearchInput: React.FC = ({ 17 | searchText, 18 | setSearchText, 19 | onSearchCoffee, 20 | onResetSearch, 21 | }) => { 22 | return ( 23 | 24 | {/* Search Icon */} 25 | onSearchCoffee(searchText)}> 27 | 0 32 | ? colors.primary.orange 33 | : colors.primary.lightGrey 34 | } 35 | className="mx-5" 36 | /> 37 | 38 | 39 | {/* Text Input */} 40 | { 45 | setSearchText(text); 46 | onSearchCoffee(searchText); 47 | }} 48 | placeholderTextColor={colors.primary.lightGrey} 49 | /> 50 | 51 | {/* Reset Icon */} 52 | {searchText.length > 0 && ( 53 | onResetSearch()}> 55 | 61 | 62 | )} 63 | 64 | ); 65 | }; 66 | 67 | export default SearchInput; 68 | -------------------------------------------------------------------------------- /src/state/useStore.ts: -------------------------------------------------------------------------------- 1 | import { create } from "zustand"; 2 | import { produce } from "immer"; 3 | import { persist, createJSONStorage } from 'zustand/middleware'; 4 | import AsyncStorage, { AsyncStorageStatic } from '@react-native-async-storage/async-storage'; 5 | 6 | import { CartItem } from "../types/common/cartItem"; 7 | import COFFEE_COLLECTION from "../data/coffeeCollection"; 8 | import BEANS_COLLECTION from "../data/beansCollection"; 9 | import { 10 | addToFavoriteList, deleteFromFavoriteList 11 | } from "./util/favoriteActions"; 12 | import { 13 | addToCart, addToOrderHistoryFromCart, calculateCartPrice, 14 | decrementCartItemQuantity, incrementCartItemQuantity 15 | } from "./util/cartActions"; 16 | 17 | 18 | export const useStore = create( 19 | persist( 20 | (set, get) => ({ 21 | coffeeList: COFFEE_COLLECTION, 22 | beanList: BEANS_COLLECTION, 23 | cartPrice: 0, 24 | favoriteList: [], 25 | cartList: [], 26 | orderHistoryList: [], 27 | addToCart: (cartItem: CartItem) => 28 | set(produce((state) => addToCart(state, cartItem))), 29 | 30 | calculateCartPrice: () => 31 | set(produce((state) => calculateCartPrice(state))), 32 | 33 | incrementCartItemQuantity: (id: string, size: string) => 34 | set(produce((state) => incrementCartItemQuantity(state, id, size))), 35 | 36 | decrementCartItemQuantity: (id: string, size: string) => 37 | set(produce((state) => decrementCartItemQuantity(state, id, size))), 38 | 39 | addToOrderHistoryFromCart: (paymentMethod: string) => 40 | set(produce((state) => addToOrderHistoryFromCart(state, paymentMethod))), 41 | 42 | addToFavoriteList: (id: string, type: string) => 43 | set(produce((state) => addToFavoriteList(state, type, id))), 44 | 45 | deleteFromFavoriteList: (id: string, type: string) => 46 | set(produce((state) => deleteFromFavoriteList(state, type, id))), 47 | }), 48 | { 49 | name: "coffee-lab-app", 50 | storage: createJSONStorage(() => AsyncStorage), 51 | }, 52 | ), 53 | ); -------------------------------------------------------------------------------- /ios/CoffeeLabTests/CoffeeLabTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface CoffeeLabTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation CoffeeLabTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /src/screens/Favorite/FavoriteScreen.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ScrollView, StatusBar, TouchableOpacity, View } from 'react-native'; 3 | import { SafeAreaView } from 'react-native-safe-area-context'; 4 | import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs'; 5 | import tw from 'twrnc'; 6 | import { colors } from '../../config/colors'; 7 | import { SCREENS } from '../../config/screenNames'; 8 | import { MESSAGES } from '../../config/messages'; 9 | import EmptyListAnimation from '../../components/common/EmptyListAnimation'; 10 | import HeaderBar from '../../components/common/HeaderBar'; 11 | import FavoriteItemCard from './components/FavoriteItemCard'; 12 | import { useFavoriteViewModel } from './FavoriteViewModel'; 13 | 14 | interface FavoriteScreenProps { 15 | navigation: any; 16 | } 17 | 18 | const FavoriteScreen: React.FC = ({ navigation }) => { 19 | const tabBarHeight = useBottomTabBarHeight(); 20 | const { favoriteList, toggleFavorite, navigateToDetail } = useFavoriteViewModel(navigation); 21 | 22 | return ( 23 | 24 | {/* Status Bar */} 25 | 26 | {/* Scrollable Content */} 27 | 28 | 31 | 32 | {/* Header Bar */} 33 | 34 | {/* Favorite Items */} 35 | {favoriteList.length === 0 ? ( 36 | 37 | ) : ( 38 | 39 | {favoriteList.map((item: any) => ( 40 | navigateToDetail(item)}> 43 | 47 | 48 | ))} 49 | 50 | )} 51 | 52 | 53 | 54 | 55 | ); 56 | }; 57 | 58 | export default FavoriteScreen; 59 | -------------------------------------------------------------------------------- /src/screens/OrderHistory/components/OrderHistoryCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Text, TouchableOpacity, View } from 'react-native' 3 | import OrderItemCard from './OrderItemCard'; 4 | import { OrderItem } from '../../../types/common/orderItem'; 5 | 6 | interface OrderHistoryCardProps { 7 | orderItem: OrderItem; 8 | navigationHandler: any; 9 | } 10 | 11 | const OrderHistoryCard: React.FC = ({ 12 | orderItem, 13 | navigationHandler, 14 | }) => { 15 | return ( 16 | 17 | 18 | {/* Order Date Time*/} 19 | 20 | 21 | Order Time 22 | 23 | 24 | {orderItem.orderDate} 25 | 26 | 27 | {/* Order Payment Info*/} 28 | 29 | 30 | Total Amount 31 | 32 | 33 | ${orderItem.totalPrice} 34 | 35 | 36 | 37 | {/* Order Items */} 38 | 39 | {orderItem.itemList.map((orderItem: any, index: any) => ( 40 | { 43 | navigationHandler({ 44 | index: orderItem.index, 45 | id: orderItem.id, 46 | type: orderItem.type, 47 | }); 48 | }}> 49 | 53 | 54 | ))} 55 | 56 | 57 | 58 | ); 59 | }; 60 | 61 | export default OrderHistoryCard; 62 | -------------------------------------------------------------------------------- /src/screens/Payment/components/PaymentMethod.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Image, Text, View } from 'react-native' 3 | import LinearGradient from 'react-native-linear-gradient'; 4 | import { fontSizes } from '../../../config/fonts'; 5 | import { colors } from '../../../config/colors'; 6 | import { iconSet } from '../../../config/assets'; 7 | import CustomIcon from '../../../components/common/CustomIcon'; 8 | 9 | interface PaymentMethodProps { 10 | paymentMode: string 11 | name: string; 12 | icon: any; 13 | isIcon: boolean; 14 | } 15 | 16 | const PaymentMethod: React.FC = ({ 17 | paymentMode, 18 | name, 19 | icon, 20 | isIcon, 21 | }) => { 22 | return ( 23 | 26 | {isIcon ? ( 27 | 32 | 33 | 37 | 38 | {name} 39 | 40 | 41 | 42 | $ 100.50 43 | 44 | ) 45 | : 46 | ( 51 | 52 | 56 | 57 | {name} 58 | 59 | 60 | )} 61 | 62 | ); 63 | }; 64 | 65 | export default PaymentMethod; -------------------------------------------------------------------------------- /src/config/dimensions.ts: -------------------------------------------------------------------------------- 1 | interface spacing { 2 | space2: number; 3 | space4: number; 4 | space6: number; 5 | space8: number; 6 | space10: number; 7 | space12: number; 8 | space16: number; 9 | space20: number; 10 | space24: number; 11 | space28: number; 12 | space30: number; 13 | space32: number; 14 | space36: number; 15 | space40: number; 16 | space44: number; 17 | space48: number; 18 | space50: number; 19 | space52: number; 20 | space56: number; 21 | space60: number; 22 | space64: number; 23 | space68: number; 24 | space70: number; 25 | space72: number; 26 | space76: number; 27 | space80: number; 28 | space84: number; 29 | space88: number; 30 | space90: number; 31 | space92: number; 32 | space96: number; 33 | space100: number; 34 | } 35 | 36 | export const spacing: spacing = { 37 | space2: 2, 38 | space4: 4, 39 | space6: 6, 40 | space8: 8, 41 | space10: 10, 42 | space12: 12, 43 | space16: 16, 44 | space20: 20, 45 | space24: 24, 46 | space28: 28, 47 | space30: 30, 48 | space32: 32, 49 | space36: 36, 50 | space40: 40, 51 | space44: 44, 52 | space48: 48, 53 | space50: 50, 54 | space52: 52, 55 | space56: 56, 56 | space60: 60, 57 | space64: 64, 58 | space68: 68, 59 | space70: 70, 60 | space72: 72, 61 | space76: 76, 62 | space80: 80, 63 | space84: 84, 64 | space88: 88, 65 | space90: 90, 66 | space92: 92, 67 | space96: 96, 68 | space100: 100, 69 | }; 70 | 71 | //----------------------------- 72 | 73 | 74 | interface BorderRadius { 75 | radius2: number; 76 | radius4: number; 77 | radius6: number; 78 | radius8: number; 79 | radius10: number; 80 | radius12: number; 81 | radius16: number; 82 | radius20: number; 83 | radius24: number; 84 | radius28: number; 85 | radius30: number; 86 | radius32: number; 87 | radius36: number; 88 | radius40: number; 89 | radius44: number; 90 | radius48: number; 91 | radius50: number; 92 | radius52: number; 93 | radius56: number; 94 | radius60: number; 95 | } 96 | 97 | export const borderRadius: BorderRadius = { 98 | radius2: 2, 99 | radius4: 4, 100 | radius6: 6, 101 | radius8: 8, 102 | radius10: 10, 103 | radius12: 12, 104 | radius16: 16, 105 | radius20: 20, 106 | radius24: 24, 107 | radius28: 28, 108 | radius30: 30, 109 | radius32: 32, 110 | radius36: 36, 111 | radius40: 40, 112 | radius44: 44, 113 | radius48: 48, 114 | radius50: 50, 115 | radius52: 52, 116 | radius56: 56, 117 | radius60: 60, 118 | }; 119 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /src/screens/OrderHistory/OrderHistoryScreen.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ScrollView, StatusBar, Text, TouchableOpacity, View } from 'react-native'; 3 | import { SafeAreaView } from 'react-native-safe-area-context'; 4 | import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs'; 5 | import tw from 'twrnc'; 6 | import { colors } from '../../config/colors'; 7 | import { CONSTANTS } from '../../config/constants'; 8 | import { MESSAGES } from '../../config/messages'; 9 | import HeaderBar from '../../components/common/HeaderBar'; 10 | import EmptyListAnimation from '../../components/common/EmptyListAnimation'; 11 | import PopUpAnimation from '../../components/common/PopUpAnimation'; 12 | import OrderHistoryCard from './components/OrderHistoryCard'; 13 | import { useOrderHistoryViewModel } from './OrderHistoryViewModel'; 14 | 15 | interface OrderHistoryScreenProps { 16 | navigation: any; 17 | } 18 | 19 | const OrderHistoryScreen: React.FC = ({ navigation }) => { 20 | const tabBarHeight = useBottomTabBarHeight(); 21 | const { 22 | orderHistoryList, showAnimation, navigationHandler, downloadActionHandler, lottieAnimations 23 | } = useOrderHistoryViewModel(navigation); 24 | 25 | return ( 26 | 27 | {/* Status Bar */} 28 | 29 | {/* Success Animation */} 30 | {showAnimation && ( 31 | 35 | )} 36 | {/* Scrollable Content */} 37 | 40 | 43 | 44 | {/* Header Bar */} 45 | 46 | {/* Order History Items */} 47 | {orderHistoryList.length === 0 ? ( 48 | 49 | ) : ( 50 | 51 | {orderHistoryList.map((orderItem: any, index: any) => ( 52 | 57 | ))} 58 | 59 | )} 60 | 61 | {orderHistoryList.length > 0 && ( 62 | 66 | 67 | Download 68 | 69 | 70 | )} 71 | 72 | 73 | 74 | ); 75 | }; 76 | 77 | export default OrderHistoryScreen; -------------------------------------------------------------------------------- /src/assets/lottie/download.json: -------------------------------------------------------------------------------- 1 | {"nm":"Success","ddd":0,"h":200,"w":200,"meta":{"g":"@lottiefiles/toolkit-js 0.26.1"},"layers":[{"ty":4,"nm":"Shape Layer 2","sr":1,"st":0,"op":49,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[77,2,0],"ix":1},"s":{"a":0,"k":[13.901,13.901,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,100,0],"ix":2},"r":{"a":0,"k":0.062,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-56,6],[30,92],[210,-88]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":64,"ix":5},"c":{"a":0,"k":[0.8196,0.4706,0.2588],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[0],"t":12},{"s":[100],"t":24}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":0,"k":0,"ix":1},"m":1}],"ind":1},{"ty":4,"nm":"Shape Layer 3","sr":1,"st":-3,"op":957,"ip":-3,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[25,25,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[101.5,92.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-8,-78],[-8,-254]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":20,"ix":5},"c":{"a":0,"k":[0.8196,0.4706,0.2588],"ix":3}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[0],"t":9},{"s":[100],"t":21}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[0],"t":11},{"s":[100],"t":23}],"ix":1},"m":1},{"ty":"rp","bm":0,"hd":false,"mn":"ADBE Vector Filter - Repeater","nm":"Repeater 1","ix":3,"m":1,"c":{"a":0,"k":10,"ix":1},"o":{"a":0,"k":0,"ix":2},"tr":{"a":{"a":0,"k":[-9,17],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":36,"ix":4},"sa":{"a":0,"k":0},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6}}}],"ind":2}],"v":"5.9.1","fr":24,"op":48,"ip":0,"assets":[]} -------------------------------------------------------------------------------- /android/app/src/main/assets/custom/download.json: -------------------------------------------------------------------------------- 1 | {"nm":"Success","ddd":0,"h":200,"w":200,"meta":{"g":"@lottiefiles/toolkit-js 0.26.1"},"layers":[{"ty":4,"nm":"Shape Layer 2","sr":1,"st":0,"op":49,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[77,2,0],"ix":1},"s":{"a":0,"k":[13.901,13.901,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,100,0],"ix":2},"r":{"a":0,"k":0.062,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-56,6],[30,92],[210,-88]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":64,"ix":5},"c":{"a":0,"k":[0.8196,0.4706,0.2588],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[0],"t":12},{"s":[100],"t":24}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":0,"k":0,"ix":1},"m":1}],"ind":1},{"ty":4,"nm":"Shape Layer 3","sr":1,"st":-3,"op":957,"ip":-3,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[25,25,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[101.5,92.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-8,-78],[-8,-254]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":20,"ix":5},"c":{"a":0,"k":[0.8196,0.4706,0.2588],"ix":3}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[0],"t":9},{"s":[100],"t":21}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[0],"t":11},{"s":[100],"t":23}],"ix":1},"m":1},{"ty":"rp","bm":0,"hd":false,"mn":"ADBE Vector Filter - Repeater","nm":"Repeater 1","ix":3,"m":1,"c":{"a":0,"k":10,"ix":1},"o":{"a":0,"k":0,"ix":2},"tr":{"a":{"a":0,"k":[-9,17],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":36,"ix":4},"sa":{"a":0,"k":0},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6}}}],"ind":2}],"v":"5.9.1","fr":24,"op":48,"ip":0,"assets":[]} -------------------------------------------------------------------------------- /src/navigation/TabNavigator.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; 4 | import { BlurView } from '@react-native-community/blur'; 5 | import { colors } from '../config/colors'; 6 | import { iconSet } from '../config/assets'; 7 | import { SCREENS } from '../config/screenNames'; 8 | import CustomIcon from '../components/common/CustomIcon'; 9 | 10 | // Screens 11 | import HomeScreen from '../screens/Home/HomeScreen'; 12 | import FavoriteScreen from '../screens/Favorite/FavoriteScreen'; 13 | import CartScreen from '../screens/Cart/CartScreen'; 14 | import OrderHistoryScreen from '../screens/OrderHistory/OrderHistoryScreen'; 15 | 16 | 17 | const Tab = createBottomTabNavigator(); 18 | 19 | const TabNavigator = () => { 20 | return ( 21 | ( 28 | 33 | ), 34 | }} 35 | > 36 | getTabIcon(iconSet.home, focused), 41 | }} 42 | /> 43 | getTabIcon(iconSet.cart, focused), 48 | }} 49 | /> 50 | getTabIcon(iconSet.like, focused), 55 | }} 56 | /> 57 | getTabIcon(iconSet.bell, focused), 62 | }} 63 | /> 64 | 65 | ); 66 | }; 67 | 68 | function getTabIcon(iconName: string, focused: boolean) { 69 | const ICON_SIZE = 25; 70 | return ( 71 | 78 | ); 79 | } 80 | 81 | const styles = StyleSheet.create({ 82 | tabBarStyles: { 83 | height: 70, 84 | position: 'absolute', 85 | backgroundColor: colors.primary.blackTransparent, 86 | borderTopWidth: 0, 87 | elevation: 0, 88 | borderTopColor: 'transparent', 89 | paddingTop: 16, 90 | }, 91 | blurViewStyles: { 92 | position: 'absolute', 93 | top: 0, 94 | bottom: 0, 95 | left: 0, 96 | right: 0, 97 | }, 98 | }); 99 | 100 | export default TabNavigator; 101 | -------------------------------------------------------------------------------- /src/screens/Cart/CartScreen.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StatusBar, TouchableOpacity, View, FlatList } from 'react-native'; 3 | import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs'; 4 | import { SafeAreaView } from 'react-native-safe-area-context'; 5 | import tw from 'twrnc'; 6 | import { useCartViewModel } from './CartViewModel'; 7 | import { CartItem } from '../../types/common/cartItem'; 8 | import { SCREENS } from '../../config/screenNames'; 9 | import { BUTTON_TITLES, CURRENCY } from '../../config/specialTypes'; 10 | import { MESSAGES } from '../../config/messages'; 11 | import { colors } from '../../config/colors'; 12 | import HeaderBar from '../../components/common/HeaderBar'; 13 | import EmptyListAnimation from '../../components/common/EmptyListAnimation'; 14 | import PaymentFooter from '../../components/common/PaymentFooter'; 15 | import CartItemView from './components/CartItemView'; 16 | 17 | interface CartScreenProps { 18 | navigation: any; 19 | route: any; 20 | } 21 | 22 | const CartScreen: React.FC = ({ navigation }) => { 23 | const tabBarHeight = useBottomTabBarHeight(); 24 | const { cartList, cartPrice, 25 | handleIncrementQuantity, handleDecrementQuantity, 26 | } = useCartViewModel(); 27 | 28 | const handleButtonPress = () => { 29 | navigation.push(SCREENS.PAYMENT, { amount: cartPrice }); 30 | }; 31 | 32 | const renderCartItem = ({ item }: { item: CartItem }) => ( 33 | 34 | 36 | navigation.push(SCREENS.DETAIL, { 37 | index: item.index, 38 | id: item.id, 39 | type: item.type, 40 | }) 41 | } 42 | > 43 | 48 | 49 | 50 | ); 51 | 52 | return ( 53 | 54 | {/* Status Bar */} 55 | 56 | 57 | index.toString()} 60 | renderItem={null} // No need to render items 61 | showsVerticalScrollIndicator={false} 62 | contentContainerStyle={tw`flex-grow pb-6`} 63 | ListHeaderComponent={ 64 | <> 65 | {/* Header Bar */} 66 | 67 | 68 | {/* Cart Items */} 69 | {cartList.length === 0 ? ( 70 | 71 | ) : ( 72 | item.id} 75 | contentContainerStyle={tw`gap-5 px-5 py-5`} 76 | renderItem={(item) => renderCartItem(item)} 77 | /> 78 | )} 79 | 80 | } 81 | /> 82 | 83 | {/* Payment Footer */} 84 | {cartList.length > 0 && ( 85 | 86 | 92 | 93 | )} 94 | 95 | 96 | ); 97 | }; 98 | 99 | export default CartScreen; -------------------------------------------------------------------------------- /src/screens/Home/HomeViewModel.ts: -------------------------------------------------------------------------------- 1 | import { useState, useRef, useEffect } from 'react'; 2 | import { FlatList, ToastAndroid } from 'react-native'; 3 | import { Product } from '../../types/common/product'; 4 | import { useStore } from '../../state/useStore'; 5 | import { CartItem } from '../../types/common/cartItem'; 6 | import { MESSAGES } from '../../config/messages'; 7 | import { CONSTANTS } from '../../config/constants'; 8 | 9 | 10 | export const useHomeViewModel = () => { 11 | const listRef = useRef>(null); 12 | 13 | const coffeeList = useStore((state: any) => state.coffeeList); 14 | const beanList = useStore((state: any) => state.beanList); 15 | const addToCart = useStore((state: any) => state.addToCart); 16 | const calculateCartPrice = useStore((state: any) => state.calculateCartPrice); 17 | 18 | const [searchText, setSearchText] = useState(''); 19 | const [categories, setCategories] = useState(getCategoriesFromList(coffeeList)); 20 | const [categoryIndex, setCategoryIndex] = useState({ 21 | index: 0, 22 | category: categories[0], 23 | }); 24 | const [sortedCoffee, setSortedCoffee] = useState( 25 | getSortedCoffeeList(categoryIndex.category, coffeeList), 26 | ); 27 | 28 | useEffect(() => { 29 | setCategories(getCategoriesFromList(coffeeList)); 30 | setSortedCoffee(getSortedCoffeeList(categoryIndex.category, coffeeList)); 31 | }, [coffeeList]); 32 | 33 | const handleCategoryChange = (index: number) => { 34 | scrollToTop(); 35 | setCategoryIndex({ index, category: categories[index] }); 36 | setSortedCoffee(getSortedCoffeeList(categories[index], coffeeList)); 37 | }; 38 | 39 | const searchCoffee = (search: string) => { 40 | scrollToTop(); 41 | setCategoryIndex({ index: 0, category: categories[0] }); 42 | setSortedCoffee(coffeeList.filter((item : any) => item.name.toLowerCase().includes(search.toLowerCase()))); 43 | }; 44 | 45 | const resetSearchCoffee = () => { 46 | scrollToTop(); 47 | setCategoryIndex({ index: 0, category: categories[0] }); 48 | setSortedCoffee([...coffeeList]); 49 | setSearchText(''); 50 | }; 51 | 52 | const addToCartHandler = (cartItem: CartItem) => { 53 | console.log(JSON.stringify(cartItem)); 54 | addToCart(cartItem); 55 | calculateCartPrice(); 56 | ToastAndroid.showWithGravity( 57 | MESSAGES.SUCCESS.ITEM_ADDED_TO_CART(cartItem.name), 58 | ToastAndroid.SHORT, 59 | ToastAndroid.CENTER, 60 | ); 61 | }; 62 | 63 | const scrollToTop = () => { 64 | if (listRef?.current) { 65 | listRef.current.scrollToOffset({ animated: true, offset: 0 }); 66 | } 67 | }; 68 | 69 | return { 70 | listRef, 71 | searchText, setSearchText, 72 | categories, categoryIndex, sortedCoffee, 73 | handleCategoryChange, searchCoffee, resetSearchCoffee, addToCartHandler, 74 | beanList, 75 | }; 76 | }; 77 | 78 | // UTILITY FUNCTIONS 79 | // -> 80 | const getCategoriesFromList = (coffeeList: Product[]) => { 81 | const categoryCounts: Record = {}; 82 | coffeeList.forEach((item) => { 83 | if (!categoryCounts[item.name]) { 84 | categoryCounts[item.name] = 0; 85 | } else { 86 | categoryCounts[item.name]++; 87 | } 88 | }); 89 | // Create categories list with "All" at the start 90 | return [CONSTANTS.GENERAL.CATEGORY_ALL, ...Object.keys(categoryCounts)]; 91 | }; 92 | 93 | const getSortedCoffeeList = (selectedCategory: string, coffeeList: Product[]) => { 94 | return selectedCategory === CONSTANTS.GENERAL.CATEGORY_ALL 95 | ? coffeeList 96 | : coffeeList.filter((item) => item.name === selectedCategory); 97 | }; 98 | -------------------------------------------------------------------------------- /ios/CoffeeLab.xcodeproj/xcshareddata/xcschemes/CoffeeLab.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/screens/Detail/DetailScreen.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | ScrollView, StatusBar, Text, TouchableOpacity, 4 | TouchableWithoutFeedback, View 5 | } from 'react-native'; 6 | import { SafeAreaView } from 'react-native-safe-area-context'; 7 | import tw from 'twrnc'; 8 | import { colors } from '../../config/colors'; 9 | import { BUTTON_TITLES, PRODUCT_TYPES } from '../../config/specialTypes'; 10 | import ImageBackdropInfo from '../../components/common/ImageBackdropInfo'; 11 | import PaymentFooter from '../../components/common/PaymentFooter'; 12 | import DetailViewModel from './DetailViewModel'; 13 | 14 | interface DetailScreenProps { 15 | navigation: any; 16 | route: any; 17 | } 18 | 19 | const DetailScreen: React.FC = ({ navigation, route }) => { 20 | const viewModel = DetailViewModel(navigation, route); 21 | 22 | return ( 23 | 24 | {/* Status Bar */} 25 | 26 | {/* Scrollable Content */} 27 | 30 | 31 | {/* Background Image & Header */} 32 | 38 | {/* Footer Area */} 39 | 40 | Description 41 | 42 | 43 | 45 | {viewModel.selectedItem.description} 46 | 47 | {!viewModel.fullDescription && ( 48 | ... 49 | )} 50 | 51 | 52 | 53 | {/* Sizes Area Title */} 54 | 55 | Size 56 | 57 | 58 | {/* Sizes Area */} 59 | 60 | 61 | {viewModel.selectedItem.prices.map((priceItem: any) => ( 62 | viewModel.setPrice(priceItem)} 63 | className={`flex-1 h-12 bg-primary-darkGrey items-center justify-center rounded-xl border-2 64 | ${priceItem.size == viewModel.price.size ? 'border-primary-orange' : 'border-primary-lightGrey'}`} 65 | > 66 | 70 | {priceItem.size} 71 | 72 | 73 | ))} 74 | 75 | 76 | 77 | 78 | {/* Payment Footer */} 79 | 85 | 86 | ); 87 | } 88 | 89 | export default DetailScreen; 90 | -------------------------------------------------------------------------------- /src/state/util/cartActions.ts: -------------------------------------------------------------------------------- 1 | import produce from "immer"; 2 | import { CartItem } from "../../types/common/cartItem"; 3 | import { OrderItem } from "../../types/common/orderItem"; 4 | 5 | 6 | export const addToCart = (state: any, cartItem: CartItem) => { 7 | let found = false; 8 | for (let index = 0; index < state.cartList.length; index++) { 9 | if (state.cartList[index].id === cartItem.id) { 10 | found = true; 11 | let size = false; 12 | 13 | for (let priceIndex = 0; priceIndex < state.cartList[index].prices.length; priceIndex++) { 14 | if (state.cartList[index].prices[priceIndex].size === cartItem.prices[0].size) { 15 | size = true; 16 | state.cartList[index].prices[priceIndex].quantity++; 17 | break; 18 | } 19 | } 20 | 21 | if (!size) { 22 | state.cartList[index].prices.push(cartItem.prices[0]); 23 | } 24 | 25 | state.cartList[index].prices.sort((a: any, b: any) => b.size - a.size); 26 | break; 27 | } 28 | } 29 | if (!found) { 30 | state.cartList.push(cartItem); 31 | } 32 | }; 33 | 34 | export const calculateCartPrice = (state: any) => { 35 | let totalPrice = 0; 36 | for (let index = 0; index < state.cartList.length; index++) { 37 | let price = 0; 38 | for (let priceIndex = 0; priceIndex < state.cartList[index].prices.length; priceIndex++) { 39 | price += 40 | parseFloat(state.cartList[index].prices[priceIndex].price) * 41 | state.cartList[index].prices[priceIndex].quantity; 42 | } 43 | state.cartList[index].itemPrice = price.toFixed(2).toString(); 44 | totalPrice += price; 45 | } 46 | state.cartPrice = totalPrice.toFixed(2).toString(); 47 | }; 48 | 49 | export const incrementCartItemQuantity = (state: any, id: string, size: string) => { 50 | for (let index = 0; index < state.cartList.length; index++) { 51 | if (state.cartList[index].id == id) { 52 | 53 | for (let priceIndex = 0; priceIndex < state.cartList[index].prices.length; priceIndex++) { 54 | if (state.cartList[index].prices[priceIndex].size == size) { 55 | 56 | state.cartList[index].prices[priceIndex].quantity++; 57 | break; 58 | } 59 | } 60 | 61 | } 62 | } 63 | }; 64 | 65 | export const decrementCartItemQuantity = (state: any, id: string, size: string) => { 66 | for (let index = 0; index < state.cartList.length; index++) { 67 | if (state.cartList[index].id == id) { 68 | 69 | for (let priceIndex = 0; priceIndex < state.cartList[index].prices.length; priceIndex++) { 70 | if (state.cartList[index].prices[priceIndex].size == size) { 71 | 72 | if (state.cartList[index].prices.length > 1) { 73 | if (state.cartList[index].prices[priceIndex].quantity > 1) { 74 | state.cartList[index].prices[priceIndex].quantity--; 75 | } else { 76 | state.cartList[index].prices.splice(priceIndex, 1); 77 | } 78 | } 79 | else { 80 | if (state.cartList[index].prices[priceIndex].quantity > 1) { 81 | state.cartList[index].prices[priceIndex].quantity--; 82 | } else { 83 | state.cartList.splice(index, 1); 84 | } 85 | } 86 | break; 87 | } 88 | } 89 | 90 | } 91 | } 92 | }; 93 | 94 | export const addToOrderHistoryFromCart = (state: any, paymentMethod: string) => { 95 | let totalPrice = state.cartList.reduce( 96 | (accumulator: number, currentValue: any) => 97 | accumulator + parseFloat(currentValue.itemPrice), 98 | 0, 99 | ); 100 | 101 | const dateTime = new Date().toDateString() + " " + new Date().toLocaleTimeString(); 102 | const order: OrderItem = { 103 | orderDate: dateTime, 104 | paymentMethod: paymentMethod, 105 | totalPrice: totalPrice.toFixed(2).toString(), 106 | itemList: state.cartList, 107 | } 108 | 109 | if (state.orderHistoryList.length > 0) { 110 | state.orderHistoryList.unshift(order) 111 | } else { 112 | state.orderHistoryList.push(order) 113 | } 114 | state.cartList = []; 115 | 116 | }; 117 | -------------------------------------------------------------------------------- /ios/CoffeeLab/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/components/common/ProductCard.tsx: -------------------------------------------------------------------------------- 1 | // React and React Native 2 | import React from 'react'; 3 | import { ImageBackground, Text, TouchableOpacity, View } from 'react-native'; 4 | // Third-party 5 | import LinearGradient from 'react-native-linear-gradient'; 6 | // Configuration and components 7 | import { colors } from '../../config/colors'; 8 | import { iconSet } from '../../config/assets'; 9 | import { fontSizes } from '../../config/fonts'; 10 | import { Product, ProductPrice } from '../../types/common/product'; 11 | import { CartItem } from '../../types/common/cartItem'; 12 | import CustomIcon from './CustomIcon'; 13 | import BackgroundIcon from '../specific/BackgroundIcon'; 14 | 15 | 16 | interface ProductCardProps { 17 | product: Product; 18 | onPressHandler: (cartItem: CartItem) => void; 19 | } 20 | 21 | const ProductCard: React.FC = ({ 22 | product, 23 | onPressHandler 24 | }) => { 25 | const selectedPrice = getPrice(product.prices); 26 | 27 | return ( 28 | 34 | {/* Image Background */} 35 | 40 | {/* Rating Container */} 41 | 44 | {/* Rating Icon */} 45 | 50 | {/* Rating Text */} 51 | 52 | {product.averageRating} 53 | 54 | 55 | 56 | 57 | {/* Coffee Name */} 58 | 59 | {product.name} 60 | 61 | 62 | {/* Special Ingredient */} 63 | 64 | {product.specialIngredient} 65 | 66 | 67 | {/* Card Footer */} 68 | 69 | {/* Item Price */} 70 | 71 | {`${selectedPrice.currency} `} 72 | 73 | {selectedPrice.price} 74 | 75 | 76 | {/* Add Button */} 77 | { 79 | const cartItem: CartItem = { 80 | ...product, 81 | prices: [{ ...selectedPrice, quantity: 1 }], 82 | }; 83 | onPressHandler(cartItem); 84 | }} 85 | > 86 | 92 | 93 | 94 | 95 | ); 96 | }; 97 | 98 | const getPrice = (prices: ProductPrice[]): ProductPrice => { 99 | if (prices.length === 0) { 100 | // TODO: Handle the empty prices case 101 | return { currency: '$', price: '0.00', size: '' }; 102 | } 103 | return prices[prices.length - 1]; 104 | }; 105 | 106 | export default ProductCard; 107 | -------------------------------------------------------------------------------- /src/screens/Home/HomeScreen.tsx: -------------------------------------------------------------------------------- 1 | // React and React Native 2 | import React from 'react' 3 | import { FlatList, StatusBar, Text, TouchableOpacity, View } from 'react-native' 4 | import { SafeAreaView } from 'react-native-safe-area-context'; 5 | import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs'; 6 | // Configuration and components 7 | import { useHomeViewModel } from './HomeViewModel'; 8 | import { colors } from '../../config/colors'; 9 | import { SCREENS } from '../../config/screenNames'; 10 | import { CONSTANTS } from '../../config/constants'; 11 | import { Product } from '../../types/common/product'; 12 | import HeaderBar from '../../components/common/HeaderBar'; 13 | import ProductCard from '../../components/common/ProductCard'; 14 | import SearchInput from './components/SearchInput'; 15 | import CategoryScroller from './components/CategoryScroller'; 16 | import tw from 'twrnc'; 17 | 18 | interface HomeScreenProps { 19 | navigation: any; 20 | } 21 | 22 | const HomeScreen: React.FC = ({ navigation }) => { 23 | const tabBarHeight = useBottomTabBarHeight(); 24 | const { 25 | listRef, searchText, setSearchText, categories, categoryIndex, sortedCoffee, 26 | handleCategoryChange, searchCoffee, resetSearchCoffee, addToCartHandler, beanList, 27 | } = useHomeViewModel(); 28 | 29 | const renderCoffeeItem = ({ item }: { item: Product }) => ( 30 | { 32 | navigation.push(SCREENS.DETAIL, { 33 | index: item.index, 34 | id: item.id, 35 | type: item.type, 36 | }); 37 | }}> 38 | 39 | 40 | ); 41 | 42 | const renderEmptyCoffeeList = () => ( 43 | 44 | 45 | No Coffee Available! 46 | 47 | 48 | ); 49 | 50 | return ( 51 | 52 | 53 | {/* Status Bar */} 54 | 55 | 56 | {/*Vertical Scrollable Content */} 57 | index.toString()} 60 | showsVerticalScrollIndicator={false} 61 | renderItem={() => null} 62 | ListHeaderComponent={ 63 | <> 64 | {/* App Header */} 65 | 66 | 67 | {/* Welcome Message */} 68 | 69 | Find the best{"\n"}coffee for you 70 | 71 | 72 | {/* Search Bar */} 73 | 79 | 80 | {/* Coffee Categories */} 81 | 86 | 87 | {/* Coffee Products */} 88 | item.id} 95 | renderItem={(item) => renderCoffeeItem(item)} 96 | ListEmptyComponent={renderEmptyCoffeeList()} 97 | /> 98 | 99 | } 100 | ListFooterComponent={ 101 | <> 102 | {/* Section Title for Coffee Beans */} 103 | 104 | Coffee Beans 105 | 106 | 107 | {/* Coffee Beans List */} 108 | item.id} 114 | renderItem={(item) => renderCoffeeItem(item)} 115 | /> 116 | 117 | } 118 | /> 119 | 120 | ); 121 | } 122 | 123 | export default HomeScreen; -------------------------------------------------------------------------------- /src/data/beansCollection.ts: -------------------------------------------------------------------------------- 1 | import { Product } from "../types/common/product"; 2 | 3 | const BEANS_COLLECTION: Product[] = [ 4 | { 5 | id: 'B1', 6 | name: 'Robusta Beans', 7 | description: `Robusta beans are larger and more rounded than the other bean varieties. These plants typically grow much larger than Arabica plants, measuring between 15 and 20 feet. Robusta beans are typically considered to be hardier because they can grow at lower altitudes and resist diseases. But recent research suggests that they don’t handle heat as well as was previously thought.`, 8 | roasted: 'Medium Roasted', 9 | imageLinkSquare: require('../assets/coffee_assets/robusta_coffee_beans/robusta_coffee_beans_square.png'), 10 | imageLinkPortrait: require('../assets/coffee_assets/robusta_coffee_beans/robusta_coffee_beans_portrait.png'), 11 | ingredients: 'Africa', 12 | specialIngredient: 'From Africa', 13 | prices: [ 14 | {size: '250gm', price: '5.50', currency: '$'}, 15 | {size: '500gm', price: '10.50', currency: '$'}, 16 | {size: '1Kg', price: '18.50', currency: '$'}, 17 | ], 18 | averageRating: 4.7, 19 | ratingsCount: '6,879', 20 | isFavorite: false, 21 | type: 'Bean', 22 | index: 0, 23 | }, 24 | { 25 | id: 'B2', 26 | name: 'Arabica Beans', 27 | description: `Arabica beans are by far the most popular type of coffee beans, making up about 60% of the world’s coffee. These tasty beans originated many centuries ago in the highlands of Ethiopia, and may even be the first coffee beans ever consumed! The name Arabica likely comes from the beans’ popularity in 7th-century Arabia (present-day Yemen).`, 28 | roasted: 'Medium Roasted', 29 | imageLinkSquare: require('../assets/coffee_assets/arabica_coffee_beans/arabica_coffee_beans_square.png'), 30 | imageLinkPortrait: require('../assets/coffee_assets/arabica_coffee_beans/arabica_coffee_beans_portrait.png'), 31 | ingredients: 'Africa', 32 | specialIngredient: 'From Africa', 33 | prices: [ 34 | {size: '250gm', price: '5.50', currency: '$'}, 35 | {size: '500gm', price: '10.50', currency: '$'}, 36 | {size: '1Kg', price: '18.50', currency: '$'}, 37 | ], 38 | averageRating: 4.7, 39 | ratingsCount: '6,879', 40 | isFavorite: false, 41 | type: 'Bean', 42 | index: 1, 43 | }, 44 | { 45 | id: 'B3', 46 | name: 'Liberica Beans', 47 | description: `Native to central and western Africa – specifically Liberia, hence its name – Coffea liberica is prized for its piquant floral aroma and bold, smoky flavor profile. Growing from a much larger plant than Arabica or Robusta, most Liberica cherries tend to be irregular in shape and closer to Robusta in size and general appearance. It’s also tolerant of hot, humid climates and does well at low altitude. `, 48 | roasted: 'Medium Roasted', 49 | imageLinkSquare: require('../assets/coffee_assets/liberica_coffee_beans/liberica_coffee_beans_square.png'), 50 | imageLinkPortrait: require('../assets/coffee_assets/liberica_coffee_beans/liberica_coffee_beans_portrait.png'), 51 | ingredients: 'Malaysia', 52 | specialIngredient: 'From Malaysia', 53 | prices: [ 54 | {size: '250gm', price: '5.50', currency: '$'}, 55 | {size: '500gm', price: '10.50', currency: '$'}, 56 | {size: '1Kg', price: '18.50', currency: '$'}, 57 | ], 58 | averageRating: 4.7, 59 | ratingsCount: '6,879', 60 | isFavorite: false, 61 | type: 'Bean', 62 | index: 2, 63 | }, 64 | { 65 | id: 'B4', 66 | name: 'Excelsa Beans', 67 | description: `Excelsa beans grow almost entirely in Southeast Asia, and they’re shaped somewhat like Liberica beans — elongated ovals. These beans grow on large 20 to 30-foot coffee plants at medium altitudes. In terms of flavor, Excelsa beans are pretty unique. They combine light roast traits like tart notes and fruity flavors with flavors that are more reminiscent of dark roasts.`, 68 | roasted: 'Medium Roasted', 69 | imageLinkSquare: require('../assets/coffee_assets/excelsa_coffee_beans/excelsa_coffee_beans_square.png'), 70 | imageLinkPortrait: require('../assets/coffee_assets/excelsa_coffee_beans/excelsa_coffee_beans_portrait.png'), 71 | ingredients: 'Malaysia', 72 | specialIngredient: 'From Malaysia', 73 | prices: [ 74 | {size: '250gm', price: '5.50', currency: '$'}, 75 | {size: '500gm', price: '10.50', currency: '$'}, 76 | {size: '1Kg', price: '18.50', currency: '$'}, 77 | ], 78 | averageRating: 4.7, 79 | ratingsCount: '6,879', 80 | isFavorite: false, 81 | type: 'Bean', 82 | index: 3, 83 | }, 84 | ]; 85 | export default BEANS_COLLECTION; -------------------------------------------------------------------------------- /src/screens/OrderHistory/components/OrderItemCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Image, Text, View } from 'react-native' 3 | import LinearGradient from 'react-native-linear-gradient'; 4 | import { colors } from '../../../config/colors'; 5 | import { CURRENCY, PRODUCT_TYPES } from '../../../config/specialTypes'; 6 | import { CartItem } from '../../../types/common/cartItem'; 7 | 8 | interface OrderItemCardProps { 9 | cartItem: CartItem; 10 | itemPrice: string; 11 | } 12 | 13 | const OrderItemCard: React.FC = ({ 14 | cartItem, 15 | itemPrice, 16 | }) => { 17 | return ( 18 | 23 | {/* Header Info Section */} 24 | 26 | 28 | {/* Header Image */} 29 | 33 | 34 | {/* Item Name */} 35 | 36 | {cartItem.name} 37 | 38 | {/* Special Ingredient */} 39 | 40 | {cartItem.specialIngredient} 41 | 42 | 43 | 44 | 45 | {/* Item Price */} 46 | 47 | {`${CURRENCY.USD.symbol} `} 48 | 49 | {itemPrice} 50 | 51 | 52 | 53 | 54 | {/* Detail Section */} 55 | {cartItem.prices.map((priceItem: any, index: any) => ( 56 | 59 | 60 | {/* PriceItems's Size */} 61 | 64 | 67 | {priceItem.size} 68 | 69 | 70 | {/* PriceItems's Price */} 71 | 74 | 75 | {`${priceItem.currency} `} 76 | 77 | {priceItem.price} 78 | 79 | 80 | 81 | 82 | {/* PriceItems's Quantity */} 83 | 84 | 85 | {`X `} 86 | 87 | {priceItem.quantity} 88 | 89 | 90 | {/* PriceItems's Total Price */} 91 | 92 | $ {(priceItem.quantity * priceItem.price).toFixed(2).toString()} 93 | 94 | 95 | 96 | )) 97 | } 98 | 99 | ); 100 | }; 101 | 102 | export default OrderItemCard; 103 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | apply plugin: "org.jetbrains.kotlin.android" 3 | apply plugin: "com.facebook.react" 4 | 5 | /** 6 | * This is the configuration block to customize your React Native Android app. 7 | * By default you don't need to apply any configuration, just uncomment the lines you need. 8 | */ 9 | react { 10 | /* Folders */ 11 | // The root of your project, i.e. where "package.json" lives. Default is '../..' 12 | // root = file("../../") 13 | // The folder where the react-native NPM package is. Default is ../../node_modules/react-native 14 | // reactNativeDir = file("../../node_modules/react-native") 15 | // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen 16 | // codegenDir = file("../../node_modules/@react-native/codegen") 17 | // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js 18 | // cliFile = file("../../node_modules/react-native/cli.js") 19 | 20 | /* Variants */ 21 | // The list of variants to that are debuggable. For those we're going to 22 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'. 23 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. 24 | // debuggableVariants = ["liteDebug", "prodDebug"] 25 | 26 | /* Bundling */ 27 | // A list containing the node command and its flags. Default is just 'node'. 28 | // nodeExecutableAndArgs = ["node"] 29 | // 30 | // The command to run when bundling. By default is 'bundle' 31 | // bundleCommand = "ram-bundle" 32 | // 33 | // The path to the CLI configuration file. Default is empty. 34 | // bundleConfig = file(../rn-cli.config.js) 35 | // 36 | // The name of the generated asset file containing your JS bundle 37 | // bundleAssetName = "MyApplication.android.bundle" 38 | // 39 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' 40 | // entryFile = file("../js/MyApplication.android.js") 41 | // 42 | // A list of extra flags to pass to the 'bundle' commands. 43 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle 44 | // extraPackagerArgs = [] 45 | 46 | /* Hermes Commands */ 47 | // The hermes compiler command to run. By default it is 'hermesc' 48 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" 49 | // 50 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" 51 | // hermesFlags = ["-O", "-output-source-map"] 52 | 53 | /* Autolinking */ 54 | autolinkLibrariesWithApp() 55 | } 56 | 57 | /** 58 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode. 59 | */ 60 | def enableProguardInReleaseBuilds = false 61 | 62 | /** 63 | * The preferred build flavor of JavaScriptCore (JSC) 64 | * 65 | * For example, to use the international variant, you can use: 66 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 67 | * 68 | * The international variant includes ICU i18n library and necessary data 69 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 70 | * give correct results when using with locales other than en-US. Note that 71 | * this variant is about 6MiB larger per architecture than default. 72 | */ 73 | def jscFlavor = 'org.webkit:android-jsc:+' 74 | 75 | android { 76 | ndkVersion rootProject.ext.ndkVersion 77 | buildToolsVersion rootProject.ext.buildToolsVersion 78 | compileSdk rootProject.ext.compileSdkVersion 79 | 80 | namespace "com.coffeelab" 81 | defaultConfig { 82 | applicationId "com.coffeelab" 83 | minSdkVersion rootProject.ext.minSdkVersion 84 | targetSdkVersion rootProject.ext.targetSdkVersion 85 | versionCode 1 86 | versionName "1.0" 87 | } 88 | signingConfigs { 89 | debug { 90 | storeFile file('debug.keystore') 91 | storePassword 'android' 92 | keyAlias 'androiddebugkey' 93 | keyPassword 'android' 94 | } 95 | } 96 | buildTypes { 97 | debug { 98 | signingConfig signingConfigs.debug 99 | } 100 | release { 101 | // Caution! In production, you need to generate your own keystore file. 102 | // see https://reactnative.dev/docs/signed-apk-android. 103 | signingConfig signingConfigs.debug 104 | minifyEnabled enableProguardInReleaseBuilds 105 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 106 | } 107 | } 108 | } 109 | 110 | dependencies { 111 | // The version of react-native is set by the React Native Gradle Plugin 112 | implementation("com.facebook.react:react-android") 113 | 114 | if (hermesEnabled.toBoolean()) { 115 | implementation("com.facebook.react:hermes-android") 116 | } else { 117 | implementation jscFlavor 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/components/common/ImageBackdropInfo.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { ImageBackground, Text, TouchableOpacity, View } from 'react-native' 3 | import { fontSizes } from '../../config/fonts'; 4 | import { colors } from '../../config/colors'; 5 | import { Product } from '../../types/common/product'; 6 | import { iconSet } from '../../config/assets'; 7 | import { PRODUCT_TYPES } from '../../config/specialTypes'; 8 | import GradientIconBG from './GradientIconBG'; 9 | import CustomIcon from './CustomIcon'; 10 | 11 | interface ImageBackdropInfoProps { 12 | product: Product; 13 | enableBackHandler: boolean; 14 | toggleFavorite: (id: string, type: string, isFavorite: boolean) => void; 15 | backHandler?: any; 16 | } 17 | 18 | const ImageBackdropInfo: React.FC = ({ 19 | product, 20 | enableBackHandler, 21 | toggleFavorite, 22 | backHandler, 23 | }) => { 24 | return ( 25 | 26 | {/* Background Image */} 27 | 31 | 32 | {/* Top App Bar */} 33 | {enableBackHandler ? ( 34 | 35 | backHandler()}> 37 | 41 | 42 | 43 | toggleFavorite(product.id, product.type, product.isFavorite)}> 45 | 49 | 50 | 51 | ) : ( 52 | 53 | toggleFavorite(product.id, product.type, product.isFavorite)}> 55 | 59 | 60 | 61 | )} 62 | 63 | {/* Header Container */} 64 | 65 | 66 | 67 | {/* Header Row 1 */} 68 | 69 | {/* Title */} 70 | 71 | 72 | {product.name} 73 | 74 | 75 | {product.specialIngredient} 76 | 77 | 78 | 79 | {/* Property Container */} 80 | 81 | 82 | 87 | 88 | {product.type} 89 | 90 | 91 | 92 | 97 | 98 | {product.ingredients} 99 | 100 | 101 | 102 | 103 | 104 | {/* Header Row 2 */} 105 | 106 | {/* Rating */} 107 | 108 | 113 | 114 | {product.averageRating} 115 | 116 | 117 | ({product.ratingsCount}) 118 | 119 | 120 | 121 | 122 | {product.roasted} 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | ) 131 | } 132 | 133 | export default ImageBackdropInfo; 134 | -------------------------------------------------------------------------------- /src/screens/Payment/PaymentScreen.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ScrollView, StatusBar, Text, TouchableOpacity, View } from 'react-native'; 3 | import { SafeAreaView } from 'react-native-safe-area-context'; 4 | import tw from 'twrnc'; 5 | import { iconSet, lottieAnimations } from '../../config/assets'; 6 | import { fontSizes } from '../../config/fonts'; 7 | import { colors } from '../../config/colors'; 8 | import { PAYMENT_OPTIONS } from '../../data/paymentOptions'; 9 | import { BUTTON_TITLES, CURRENCY, PAYMENT_METHODS } from '../../config/specialTypes'; 10 | import GradientIconBG from '../../components/common/GradientIconBG'; 11 | import PaymentMethod from './components/PaymentMethod'; 12 | import PaymentFooter from '../../components/common/PaymentFooter'; 13 | import LinearGradient from 'react-native-linear-gradient'; 14 | import CustomIcon from '../../components/common/CustomIcon'; 15 | import PopUpAnimation from '../../components/common/PopUpAnimation'; 16 | import { usePaymentViewModel } from './PaymentViewModel'; 17 | 18 | interface PaymentScreenProps { 19 | navigation: any; 20 | route: any; 21 | } 22 | 23 | const PaymentScreen: React.FC = ({ navigation, route }) => { 24 | const { 25 | paymentMode, setPaymentMode, showSuccessAnimation, buttonPressHandler, amount 26 | } = usePaymentViewModel(navigation, route); 27 | 28 | return ( 29 | 30 | 31 | {/* Status Bar */} 32 | 33 | 34 | {/* Success Animation */} 35 | {showSuccessAnimation && 36 | } 40 | 41 | {/* Scrollable Content */} 42 | 45 | {/* Header Content */} 46 | 47 | 48 | {/* Back Button */} 49 | navigation.pop()}> 51 | 56 | 57 | {/* Header Text */} 58 | 59 | 60 | Payments 61 | 62 | 63 | 64 | 65 | {/* Payment Option Content */} 66 | 67 | {/* Credit Card View */} 68 | setPaymentMode(PAYMENT_METHODS.CREDIT_CARD)}> 70 | 72 | 73 | {/* Credit Card Title */} 74 | 75 | Credit Card 76 | 77 | 78 | {/* Credit Card Background */} 79 | 80 | 85 | 86 | {/* Credit Card Icons */} 87 | 88 | 89 | 90 | 91 | 92 | {/* Credit Card Number */} 93 | 94 | {["0101", "0101", "8855", "3477"].map((num, index) => ( 95 | 96 | {num} 97 | 98 | ))} 99 | 100 | 101 | 102 | {/* Credit Card Holder Info */} 103 | 104 | Card Holder Name 105 | Shavinda Nova 106 | 107 | {/* Credit Card Expiry Info */} 108 | 109 | Expiry Date 110 | 01/30 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | {/* Payment Option List */} 119 | {PAYMENT_OPTIONS.map((option: any) => ( 120 | setPaymentMode(option.name)}> 121 | 122 | 123 | ))} 124 | 125 | 126 | 127 | {/* Payment Footer */} 128 | 134 | 135 | ); 136 | }; 137 | 138 | export default PaymentScreen; -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | --------------------------------------------------------------------------------