From abcd5a80a551e1410a9d07863b108d5d74742377 Mon Sep 17 00:00:00 2001 From: Wim Selles Date: Mon, 12 Aug 2019 08:51:56 +0200 Subject: [PATCH 01/13] feat: initial setup for deeplinking --- android/app/src/main/AndroidManifest.xml | 10 +- .../project.pbxproj | 102 +++++++++--------- ios/SwagLabsMobileApp/AppDelegate.m | 8 +- ios/SwagLabsMobileApp/Info.plist | 47 +++++--- src/js/Router.js | 43 ++++++-- 5 files changed, 131 insertions(+), 79 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ff38ce8..98502e0 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -24,7 +24,15 @@ android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize" - android:exported="true"/> + android:exported="true" + android:launchMode="singleTask"> + + + + + + + diff --git a/ios/SwagLabsMobileApp.xcodeproj/project.pbxproj b/ios/SwagLabsMobileApp.xcodeproj/project.pbxproj index 0df909c..59913ee 100644 --- a/ios/SwagLabsMobileApp.xcodeproj/project.pbxproj +++ b/ios/SwagLabsMobileApp.xcodeproj/project.pbxproj @@ -5,46 +5,47 @@ }; objectVersion = 46; objects = { + /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* SwagLabsMobileAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SwagLabsMobileAppTests.m */; }; + 0202C1673DB64938B3D6624C /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 75718E8260114B6E9BFD4790 /* Feather.ttf */; }; + 08C189B324AF496591C6071B /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0326630E9A5049CDB42317F9 /* FontAwesome5_Solid.ttf */; }; + 0A631E18E18C4BE19858B9BE /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8AC1AD59D3B44D9DB0A49B46 /* Octicons.ttf */; }; + 0B0306A6047848E39E8FFEEA /* MuseoSans_900.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2CF84A592439483FB3B3A5DF /* MuseoSans_900.otf */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 199BA2FDCDBE4E06ABD8544E /* MuseoSans-700Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 84059F4F0CE74D01B641A3E3 /* MuseoSans-700Italic.otf */; }; + 1AC6E8E49D174DBC8C7E6668 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F2D978234CE84D62BBA572F4 /* FontAwesome5_Brands.ttf */; }; 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 2DCD954D1E0B4F2C00145EB5 /* SwagLabsMobileAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SwagLabsMobileAppTests.m */; }; - 5FDE68745115237ECFD34CBE /* libPods-SwagLabsMobileApp-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A992DBEF3F60561AF8DD9911 /* libPods-SwagLabsMobileApp-tvOSTests.a */; }; - 87F44F11591590E06DD999D6 /* libPods-SwagLabsMobileApp-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FEFF427676EA50A418547B3E /* libPods-SwagLabsMobileApp-tvOS.a */; }; - 88877079BD24F0B66421547A /* libPods-SwagLabsMobileApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 955A14D086CE676B96B15E3C /* libPods-SwagLabsMobileApp.a */; }; - C4F8A69521AAF7F3500EDA1F /* libPods-SwagLabsMobileAppTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C1D6928D24C8E0E84D3863F0 /* libPods-SwagLabsMobileAppTests.a */; }; - A25BEE6D6B6A4258A80BB927 /* MuseoSans_500_Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2052DCED8B4C41E7AACF5CB7 /* MuseoSans_500_Italic.otf */; }; - 9713E9B599EF4496856995C0 /* MuseoSans_500.otf in Resources */ = {isa = PBXBuildFile; fileRef = 65E91478319D4DA0B0365D2B /* MuseoSans_500.otf */; }; - 6CBE4FEB20B04F10A43B5D3E /* MuseoSans_700.otf in Resources */ = {isa = PBXBuildFile; fileRef = C6A7396D2EA344D69A65CDD4 /* MuseoSans_700.otf */; }; - 0B0306A6047848E39E8FFEEA /* MuseoSans_900.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2CF84A592439483FB3B3A5DF /* MuseoSans_900.otf */; }; 378F62E24FE54B57B509945D /* MuseoSans-100.otf in Resources */ = {isa = PBXBuildFile; fileRef = FCCFC36BA5BE419DBE12A348 /* MuseoSans-100.otf */; }; - F4FB854CDEEB4B1C825CACC1 /* MuseoSans-100Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 819AD89F4773427798EF4E6A /* MuseoSans-100Italic.otf */; }; - F53CE61010514357AD30270B /* MuseoSans-300.otf in Resources */ = {isa = PBXBuildFile; fileRef = E9293998A145403EA14C7E77 /* MuseoSans-300.otf */; }; - 8A6865F1677E47EE9F68146B /* MuseoSans-300Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 653CC85EF80948D28931019F /* MuseoSans-300Italic.otf */; }; - 199BA2FDCDBE4E06ABD8544E /* MuseoSans-700Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 84059F4F0CE74D01B641A3E3 /* MuseoSans-700Italic.otf */; }; - 6877240559704A68A9845A8F /* MuseoSans-900Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = E6C3FCF8958B454BB4BA306C /* MuseoSans-900Italic.otf */; }; - 77C2269094C44C24BD26296C /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9E55EF42EF064AF2B3EAAD2B /* AntDesign.ttf */; }; 45A3BCADC1744537A55DB719 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F5511BC1135A40D3A92934C6 /* Entypo.ttf */; }; 555F9E23C8D54138A6C186D5 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE00B4188DF6479C96A46045 /* EvilIcons.ttf */; }; - 0202C1673DB64938B3D6624C /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 75718E8260114B6E9BFD4790 /* Feather.ttf */; }; - FE98AEDB4F7A4FD984C6FA52 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1B920C86E43D49809FB60B06 /* FontAwesome.ttf */; }; - 1AC6E8E49D174DBC8C7E6668 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F2D978234CE84D62BBA572F4 /* FontAwesome5_Brands.ttf */; }; 575969D9FD1144E88F1698CD /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F2B1E54F0BDD40FCB5A8C7C1 /* FontAwesome5_Regular.ttf */; }; - 08C189B324AF496591C6071B /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0326630E9A5049CDB42317F9 /* FontAwesome5_Solid.ttf */; }; + 5FDE68745115237ECFD34CBE /* libPods-SwagLabsMobileApp-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A992DBEF3F60561AF8DD9911 /* libPods-SwagLabsMobileApp-tvOSTests.a */; }; + 6877240559704A68A9845A8F /* MuseoSans-900Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = E6C3FCF8958B454BB4BA306C /* MuseoSans-900Italic.otf */; }; 6920B0D62BFF4FBAAC6B3A2B /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B3BE1B4FAFB74E539518A5F2 /* Fontisto.ttf */; }; - 773BC679CA474B7695BB30B9 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E18A88A7FE2E434DABACBC8B /* Foundation.ttf */; }; - E156C82320F64892B7010540 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 31E582541B204E8FAE64C165 /* Ionicons.ttf */; }; 69601FE0EBA6440A98D42474 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 81CAF6EB56BE4AF89F20010C /* MaterialCommunityIcons.ttf */; }; - A2365426ADE34D2D92F74084 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 92B7EADD9FEC40519BF1DAA7 /* MaterialIcons.ttf */; }; - 0A631E18E18C4BE19858B9BE /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8AC1AD59D3B44D9DB0A49B46 /* Octicons.ttf */; }; + 6CBE4FEB20B04F10A43B5D3E /* MuseoSans_700.otf in Resources */ = {isa = PBXBuildFile; fileRef = C6A7396D2EA344D69A65CDD4 /* MuseoSans_700.otf */; }; + 773BC679CA474B7695BB30B9 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E18A88A7FE2E434DABACBC8B /* Foundation.ttf */; }; + 77C2269094C44C24BD26296C /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9E55EF42EF064AF2B3EAAD2B /* AntDesign.ttf */; }; + 87F44F11591590E06DD999D6 /* libPods-SwagLabsMobileApp-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FEFF427676EA50A418547B3E /* libPods-SwagLabsMobileApp-tvOS.a */; }; + 88877079BD24F0B66421547A /* libPods-SwagLabsMobileApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 955A14D086CE676B96B15E3C /* libPods-SwagLabsMobileApp.a */; }; + 8A6865F1677E47EE9F68146B /* MuseoSans-300Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 653CC85EF80948D28931019F /* MuseoSans-300Italic.otf */; }; 96B99304CC4A4EC7A2037B7D /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 57BA427D85794918A63D0DB3 /* SimpleLineIcons.ttf */; }; + 9713E9B599EF4496856995C0 /* MuseoSans_500.otf in Resources */ = {isa = PBXBuildFile; fileRef = 65E91478319D4DA0B0365D2B /* MuseoSans_500.otf */; }; + A2365426ADE34D2D92F74084 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 92B7EADD9FEC40519BF1DAA7 /* MaterialIcons.ttf */; }; + A25BEE6D6B6A4258A80BB927 /* MuseoSans_500_Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2052DCED8B4C41E7AACF5CB7 /* MuseoSans_500_Italic.otf */; }; + C4F8A69521AAF7F3500EDA1F /* libPods-SwagLabsMobileAppTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C1D6928D24C8E0E84D3863F0 /* libPods-SwagLabsMobileAppTests.a */; }; DCCB49FC72394971918B6A16 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8C559E59F64A498F931649D1 /* Zocial.ttf */; }; + E156C82320F64892B7010540 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 31E582541B204E8FAE64C165 /* Ionicons.ttf */; }; + F4FB854CDEEB4B1C825CACC1 /* MuseoSans-100Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 819AD89F4773427798EF4E6A /* MuseoSans-100Italic.otf */; }; + F53CE61010514357AD30270B /* MuseoSans-300.otf in Resources */ = {isa = PBXBuildFile; fileRef = E9293998A145403EA14C7E77 /* MuseoSans-300.otf */; }; + FE98AEDB4F7A4FD984C6FA52 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1B920C86E43D49809FB60B06 /* FontAwesome.ttf */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -69,6 +70,7 @@ 00E356EE1AD99517003FC87E /* SwagLabsMobileAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwagLabsMobileAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* SwagLabsMobileAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SwagLabsMobileAppTests.m; sourceTree = ""; }; + 0326630E9A5049CDB42317F9 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = ""; }; 0C5BDB74CFDBF4E80A7C5913 /* Pods-SwagLabsMobileApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileApp.debug.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileApp/Pods-SwagLabsMobileApp.debug.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* SwagLabsMobileApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwagLabsMobileApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = SwagLabsMobileApp/AppDelegate.h; sourceTree = ""; }; @@ -77,47 +79,46 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwagLabsMobileApp/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SwagLabsMobileApp/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SwagLabsMobileApp/main.m; sourceTree = ""; }; + 1B920C86E43D49809FB60B06 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; }; + 2052DCED8B4C41E7AACF5CB7 /* MuseoSans_500_Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MuseoSans_500_Italic.otf; path = ../assets/fonts/MuseoSans_500_Italic.otf; sourceTree = ""; }; + 2CF84A592439483FB3B3A5DF /* MuseoSans_900.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MuseoSans_900.otf; path = ../assets/fonts/MuseoSans_900.otf; sourceTree = ""; }; 2D02E47B1E0B4A5D006451C7 /* SwagLabsMobileApp-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwagLabsMobileApp-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E4901E0B4A5D006451C7 /* SwagLabsMobileApp-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwagLabsMobileApp-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 31E582541B204E8FAE64C165 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = ""; }; 33077A5630A33B367E89D865 /* Pods-SwagLabsMobileAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileAppTests.release.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileAppTests/Pods-SwagLabsMobileAppTests.release.xcconfig"; sourceTree = ""; }; 474A69707A4B0A3457DE408A /* Pods-SwagLabsMobileApp-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileApp-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileApp-tvOSTests/Pods-SwagLabsMobileApp-tvOSTests.debug.xcconfig"; sourceTree = ""; }; + 57BA427D85794918A63D0DB3 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = ""; }; + 653CC85EF80948D28931019F /* MuseoSans-300Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-300Italic.otf"; path = "../assets/fonts/MuseoSans-300Italic.otf"; sourceTree = ""; }; + 65E91478319D4DA0B0365D2B /* MuseoSans_500.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MuseoSans_500.otf; path = ../assets/fonts/MuseoSans_500.otf; sourceTree = ""; }; + 75718E8260114B6E9BFD4790 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = ""; }; 767B8F40A8BF693B9D3DDCAB /* Pods-SwagLabsMobileAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileAppTests.debug.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileAppTests/Pods-SwagLabsMobileAppTests.debug.xcconfig"; sourceTree = ""; }; + 819AD89F4773427798EF4E6A /* MuseoSans-100Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-100Italic.otf"; path = "../assets/fonts/MuseoSans-100Italic.otf"; sourceTree = ""; }; + 81CAF6EB56BE4AF89F20010C /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = ""; }; + 84059F4F0CE74D01B641A3E3 /* MuseoSans-700Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-700Italic.otf"; path = "../assets/fonts/MuseoSans-700Italic.otf"; sourceTree = ""; }; + 8AC1AD59D3B44D9DB0A49B46 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; }; + 8C559E59F64A498F931649D1 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; }; + 92B7EADD9FEC40519BF1DAA7 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = ""; }; 955A14D086CE676B96B15E3C /* libPods-SwagLabsMobileApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwagLabsMobileApp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 98256018CACD360E9DC5F505 /* Pods-SwagLabsMobileApp-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileApp-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileApp-tvOS/Pods-SwagLabsMobileApp-tvOS.debug.xcconfig"; sourceTree = ""; }; + 9E55EF42EF064AF2B3EAAD2B /* AntDesign.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = AntDesign.ttf; path = "../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf"; sourceTree = ""; }; A9871B389615280032D26533 /* Pods-SwagLabsMobileApp-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileApp-tvOS.release.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileApp-tvOS/Pods-SwagLabsMobileApp-tvOS.release.xcconfig"; sourceTree = ""; }; A992DBEF3F60561AF8DD9911 /* libPods-SwagLabsMobileApp-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwagLabsMobileApp-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + B3BE1B4FAFB74E539518A5F2 /* Fontisto.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Fontisto.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf"; sourceTree = ""; }; B8A3238E743430C752B712B0 /* Pods-SwagLabsMobileApp-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileApp-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileApp-tvOSTests/Pods-SwagLabsMobileApp-tvOSTests.release.xcconfig"; sourceTree = ""; }; + BE00B4188DF6479C96A46045 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; }; C1D6928D24C8E0E84D3863F0 /* libPods-SwagLabsMobileAppTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwagLabsMobileAppTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C6A7396D2EA344D69A65CDD4 /* MuseoSans_700.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MuseoSans_700.otf; path = ../assets/fonts/MuseoSans_700.otf; sourceTree = ""; }; + E18A88A7FE2E434DABACBC8B /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; }; + E6C3FCF8958B454BB4BA306C /* MuseoSans-900Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-900Italic.otf"; path = "../assets/fonts/MuseoSans-900Italic.otf"; sourceTree = ""; }; + E9293998A145403EA14C7E77 /* MuseoSans-300.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-300.otf"; path = "../assets/fonts/MuseoSans-300.otf"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; EE4945281AA2278ED763F2A4 /* Pods-SwagLabsMobileApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwagLabsMobileApp.release.xcconfig"; path = "Target Support Files/Pods-SwagLabsMobileApp/Pods-SwagLabsMobileApp.release.xcconfig"; sourceTree = ""; }; + F2B1E54F0BDD40FCB5A8C7C1 /* FontAwesome5_Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Regular.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf"; sourceTree = ""; }; + F2D978234CE84D62BBA572F4 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Brands.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; }; + F5511BC1135A40D3A92934C6 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; }; + FCCFC36BA5BE419DBE12A348 /* MuseoSans-100.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-100.otf"; path = "../assets/fonts/MuseoSans-100.otf"; sourceTree = ""; }; FEFF427676EA50A418547B3E /* libPods-SwagLabsMobileApp-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwagLabsMobileApp-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2052DCED8B4C41E7AACF5CB7 /* MuseoSans_500_Italic.otf */ = {isa = PBXFileReference; name = "MuseoSans_500_Italic.otf"; path = "../assets/fonts/MuseoSans_500_Italic.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 65E91478319D4DA0B0365D2B /* MuseoSans_500.otf */ = {isa = PBXFileReference; name = "MuseoSans_500.otf"; path = "../assets/fonts/MuseoSans_500.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - C6A7396D2EA344D69A65CDD4 /* MuseoSans_700.otf */ = {isa = PBXFileReference; name = "MuseoSans_700.otf"; path = "../assets/fonts/MuseoSans_700.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 2CF84A592439483FB3B3A5DF /* MuseoSans_900.otf */ = {isa = PBXFileReference; name = "MuseoSans_900.otf"; path = "../assets/fonts/MuseoSans_900.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - FCCFC36BA5BE419DBE12A348 /* MuseoSans-100.otf */ = {isa = PBXFileReference; name = "MuseoSans-100.otf"; path = "../assets/fonts/MuseoSans-100.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 819AD89F4773427798EF4E6A /* MuseoSans-100Italic.otf */ = {isa = PBXFileReference; name = "MuseoSans-100Italic.otf"; path = "../assets/fonts/MuseoSans-100Italic.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - E9293998A145403EA14C7E77 /* MuseoSans-300.otf */ = {isa = PBXFileReference; name = "MuseoSans-300.otf"; path = "../assets/fonts/MuseoSans-300.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 653CC85EF80948D28931019F /* MuseoSans-300Italic.otf */ = {isa = PBXFileReference; name = "MuseoSans-300Italic.otf"; path = "../assets/fonts/MuseoSans-300Italic.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 84059F4F0CE74D01B641A3E3 /* MuseoSans-700Italic.otf */ = {isa = PBXFileReference; name = "MuseoSans-700Italic.otf"; path = "../assets/fonts/MuseoSans-700Italic.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - E6C3FCF8958B454BB4BA306C /* MuseoSans-900Italic.otf */ = {isa = PBXFileReference; name = "MuseoSans-900Italic.otf"; path = "../assets/fonts/MuseoSans-900Italic.otf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 9E55EF42EF064AF2B3EAAD2B /* AntDesign.ttf */ = {isa = PBXFileReference; name = "AntDesign.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - F5511BC1135A40D3A92934C6 /* Entypo.ttf */ = {isa = PBXFileReference; name = "Entypo.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - BE00B4188DF6479C96A46045 /* EvilIcons.ttf */ = {isa = PBXFileReference; name = "EvilIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 75718E8260114B6E9BFD4790 /* Feather.ttf */ = {isa = PBXFileReference; name = "Feather.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 1B920C86E43D49809FB60B06 /* FontAwesome.ttf */ = {isa = PBXFileReference; name = "FontAwesome.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - F2D978234CE84D62BBA572F4 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Brands.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - F2B1E54F0BDD40FCB5A8C7C1 /* FontAwesome5_Regular.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Regular.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 0326630E9A5049CDB42317F9 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Solid.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - B3BE1B4FAFB74E539518A5F2 /* Fontisto.ttf */ = {isa = PBXFileReference; name = "Fontisto.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - E18A88A7FE2E434DABACBC8B /* Foundation.ttf */ = {isa = PBXFileReference; name = "Foundation.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 31E582541B204E8FAE64C165 /* Ionicons.ttf */ = {isa = PBXFileReference; name = "Ionicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 81CAF6EB56BE4AF89F20010C /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; name = "MaterialCommunityIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 92B7EADD9FEC40519BF1DAA7 /* MaterialIcons.ttf */ = {isa = PBXFileReference; name = "MaterialIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 8AC1AD59D3B44D9DB0A49B46 /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 57BA427D85794918A63D0DB3 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; name = "SimpleLineIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; - 8C559E59F64A498F931649D1 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -246,12 +247,11 @@ 767B8F40A8BF693B9D3DDCAB /* Pods-SwagLabsMobileAppTests.debug.xcconfig */, 33077A5630A33B367E89D865 /* Pods-SwagLabsMobileAppTests.release.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; DD280D371147481BA1A14F9D /* Resources */ = { - isa = "PBXGroup"; + isa = PBXGroup; children = ( 2052DCED8B4C41E7AACF5CB7 /* MuseoSans_500_Italic.otf */, 65E91478319D4DA0B0365D2B /* MuseoSans_500.otf */, @@ -282,7 +282,6 @@ ); name = Resources; sourceTree = ""; - path = ""; }; /* End PBXGroup section */ @@ -395,6 +394,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); diff --git a/ios/SwagLabsMobileApp/AppDelegate.m b/ios/SwagLabsMobileApp/AppDelegate.m index 7045d3b..d65dc1a 100644 --- a/ios/SwagLabsMobileApp/AppDelegate.m +++ b/ios/SwagLabsMobileApp/AppDelegate.m @@ -6,7 +6,7 @@ */ #import "AppDelegate.h" - +#import #import #import #import @@ -39,4 +39,10 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge #endif } +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication annotation:(id)annotation +{ + return [RCTLinkingManager application:application openURL:url + sourceApplication:sourceApplication annotation:annotation]; +} @end diff --git a/ios/SwagLabsMobileApp/Info.plist b/ios/SwagLabsMobileApp/Info.plist index a21e240..3076083 100644 --- a/ios/SwagLabsMobileApp/Info.plist +++ b/ios/SwagLabsMobileApp/Info.plist @@ -20,10 +20,21 @@ 2.0.0 CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + swagLabs + CFBundleURLSchemes + + swagLabs + + + CFBundleVersion 2 - NSFaceIDUsageDescription - $(PRODUCT_NAME) requires FaceID access to allows you quick and secure access. LSRequiresIPhoneOS NSAppTransportSecurity @@ -39,22 +50,10 @@ + NSFaceIDUsageDescription + $(PRODUCT_NAME) requires FaceID access to allows you quick and secure access. NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - + UIAppFonts MuseoSans_500_Italic.otf @@ -84,5 +83,19 @@ SimpleLineIcons.ttf Zocial.ttf + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + diff --git a/src/js/Router.js b/src/js/Router.js index ba9bc9d..d3d9faf 100644 --- a/src/js/Router.js +++ b/src/js/Router.js @@ -29,14 +29,38 @@ export const SCREENS = { const StackNavigator = createStackNavigator({ [SCREENS.LOGIN]: { screen: Login }, - [SCREENS.INVENTORY_LIST]: { screen: InventoryList }, - [SCREENS.INVENTORY_ITEM]: { screen: InventoryItem }, - [SCREENS.CART_CONTENTS]: { screen: CartContents }, - [SCREENS.CHECKOUT_SCREEN_ONE]: { screen: CheckoutScreenOne }, - [SCREENS.CHECKOUT_SCREEN_TWO]: { screen: CheckoutScreenTwo }, - [SCREENS.CHECKOUT_COMPLETE]: { screen: CheckoutComplete }, - [SCREENS.WEBVIEW_SELECTION]: { screen: WebviewSelection }, - [SCREENS.WEBVIEW_SCREEN]: { screen: WebviewScreen }, + [SCREENS.INVENTORY_LIST]: { + screen: InventoryList , + path: 'swag-overview', + }, + [SCREENS.INVENTORY_ITEM]: { + screen: InventoryItem , + path: 'swag-item/:item', + }, + [SCREENS.CART_CONTENTS]: { + screen: CartContents , + path: 'cart/:items', + }, + [SCREENS.CHECKOUT_SCREEN_ONE]: { + screen: CheckoutScreenOne, + path: 'personal-info/', + }, + [SCREENS.CHECKOUT_SCREEN_TWO]: { + screen: CheckoutScreenTwo, + path: 'checkout-overview/:items', + }, + [SCREENS.CHECKOUT_COMPLETE]: { + screen: CheckoutComplete, + path: 'complete', + }, + [SCREENS.WEBVIEW_SELECTION]: { + screen: WebviewSelection, + path: 'webview', + }, + [SCREENS.WEBVIEW_SCREEN]: { + screen: WebviewScreen, + path: 'webview-selection/:url', + }, }, { initialRouteName: SCREENS.LOGIN, @@ -55,11 +79,12 @@ const DrawerNavigator = createDrawerNavigator({ }); const Router = createAppContainer(DrawerNavigator); +const prefix = 'swagLabs://'; export default class NavigationContainer extends Component { render() { return ( - + ); } } From fdc1711cdf24ccedfb1470688f45bcd7e08a7d68 Mon Sep 17 00:00:00 2001 From: Wim Selles Date: Tue, 13 Aug 2019 11:22:58 +0200 Subject: [PATCH 02/13] fix: fix for bubbling path from drawer to stack --- src/js/Router.js | 121 ++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/src/js/Router.js b/src/js/Router.js index d3d9faf..92c315a 100644 --- a/src/js/Router.js +++ b/src/js/Router.js @@ -16,75 +16,78 @@ import WebviewScreen from './screens/Webview'; import DrawerLinks from './components/DrawerLinks'; export const SCREENS = { - LOGIN: 'Login', - INVENTORY_LIST: 'InventoryList', - INVENTORY_ITEM: 'InventoryItem', - CART_CONTENTS: 'CartContents', - CHECKOUT_SCREEN_ONE: 'CheckoutScreenOne', - CHECKOUT_SCREEN_TWO: 'CheckoutScreenTwo', - CHECKOUT_COMPLETE: 'CheckoutComplete', - WEBVIEW_SELECTION: 'WebviewSelection', - WEBVIEW_SCREEN: 'WebviewScreen', + LOGIN: 'Login', + INVENTORY_LIST: 'InventoryList', + INVENTORY_ITEM: 'InventoryItem', + CART_CONTENTS: 'CartContents', + CHECKOUT_SCREEN_ONE: 'CheckoutScreenOne', + CHECKOUT_SCREEN_TWO: 'CheckoutScreenTwo', + CHECKOUT_COMPLETE: 'CheckoutComplete', + WEBVIEW_SELECTION: 'WebviewSelection', + WEBVIEW_SCREEN: 'WebviewScreen', }; const StackNavigator = createStackNavigator({ - [SCREENS.LOGIN]: { screen: Login }, - [SCREENS.INVENTORY_LIST]: { - screen: InventoryList , - path: 'swag-overview', - }, - [SCREENS.INVENTORY_ITEM]: { - screen: InventoryItem , - path: 'swag-item/:item', - }, - [SCREENS.CART_CONTENTS]: { - screen: CartContents , - path: 'cart/:items', - }, - [SCREENS.CHECKOUT_SCREEN_ONE]: { - screen: CheckoutScreenOne, - path: 'personal-info/', - }, - [SCREENS.CHECKOUT_SCREEN_TWO]: { - screen: CheckoutScreenTwo, - path: 'checkout-overview/:items', - }, - [SCREENS.CHECKOUT_COMPLETE]: { - screen: CheckoutComplete, - path: 'complete', - }, - [SCREENS.WEBVIEW_SELECTION]: { - screen: WebviewSelection, - path: 'webview', - }, - [SCREENS.WEBVIEW_SCREEN]: { - screen: WebviewScreen, - path: 'webview-selection/:url', - }, - }, - { - initialRouteName: SCREENS.LOGIN, - defaultNavigationOptions: ({ navigate, navigation }) => ({ - header: (), - gesturesEnabled: false, - }), - }); + [ SCREENS.LOGIN ]: { screen: Login }, + [ SCREENS.INVENTORY_LIST ]: { + screen: InventoryList, + path: 'swag-overview', + }, + [ SCREENS.INVENTORY_ITEM ]: { + screen: InventoryItem, + path: 'swag-item/:item', + }, + [ SCREENS.CART_CONTENTS ]: { + screen: CartContents, + path: 'cart/:items', + }, + [ SCREENS.CHECKOUT_SCREEN_ONE ]: { + screen: CheckoutScreenOne, + path: 'personal-info/', + }, + [ SCREENS.CHECKOUT_SCREEN_TWO ]: { + screen: CheckoutScreenTwo, + path: 'checkout-overview/:items', + }, + [ SCREENS.CHECKOUT_COMPLETE ]: { + screen: CheckoutComplete, + path: 'complete', + }, + [ SCREENS.WEBVIEW_SELECTION ]: { + screen: WebviewSelection, + path: 'webview', + }, + [ SCREENS.WEBVIEW_SCREEN ]: { + screen: WebviewScreen, + path: 'webview-selection/:url', + }, + }, + { + initialRouteName: SCREENS.LOGIN, + defaultNavigationOptions: ({ navigate, navigation }) => ({ + header: (), + gesturesEnabled: false, + }), + }); const DrawerNavigator = createDrawerNavigator({ - StackNavigator: { screen: StackNavigator }, + StackNavigator: { + screen: StackNavigator, + path: '', + }, }, { - contentComponent: DrawerLinks, - drawerWidth: WINDOW_WIDTH, - gesturesEnabled: false, + contentComponent: DrawerLinks, + drawerWidth: WINDOW_WIDTH, + gesturesEnabled: false, }); const Router = createAppContainer(DrawerNavigator); const prefix = 'swagLabs://'; export default class NavigationContainer extends Component { - render() { - return ( - - ); - } + render() { + return ( + + ); + } } From f8fdce7b276fcb21b491117de54cbfb50cc31bb8 Mon Sep 17 00:00:00 2001 From: Wim Selles Date: Tue, 13 Aug 2019 17:44:33 +0200 Subject: [PATCH 03/13] fix: add items to cart for using deepling with cart, checkout one/two and inventorylist --- src/js/Router.js | 11 +- src/js/components/HeaderCartButton.js | 4 +- src/js/screens/CartContents.js | 107 ++++++++--------- src/js/screens/CheckoutScreenOne.js | 6 +- src/js/screens/CheckoutScreenTwo.js | 5 +- src/js/screens/InventoryList.js | 4 + src/js/shopping-cart.js | 160 ++++++++++++++------------ 7 files changed, 162 insertions(+), 135 deletions(-) diff --git a/src/js/Router.js b/src/js/Router.js index 92c315a..da88475 100644 --- a/src/js/Router.js +++ b/src/js/Router.js @@ -31,23 +31,23 @@ const StackNavigator = createStackNavigator({ [ SCREENS.LOGIN ]: { screen: Login }, [ SCREENS.INVENTORY_LIST ]: { screen: InventoryList, - path: 'swag-overview', + path: 'swag-overview/:ids', }, [ SCREENS.INVENTORY_ITEM ]: { screen: InventoryItem, - path: 'swag-item/:item', + path: 'swag-item/:id', }, [ SCREENS.CART_CONTENTS ]: { screen: CartContents, - path: 'cart/:items', + path: 'cart/:ids', }, [ SCREENS.CHECKOUT_SCREEN_ONE ]: { screen: CheckoutScreenOne, - path: 'personal-info/', + path: 'personal-info/:ids', }, [ SCREENS.CHECKOUT_SCREEN_TWO ]: { screen: CheckoutScreenTwo, - path: 'checkout-overview/:items', + path: 'checkout-overview/:ids', }, [ SCREENS.CHECKOUT_COMPLETE ]: { screen: CheckoutComplete, @@ -59,7 +59,6 @@ const StackNavigator = createStackNavigator({ }, [ SCREENS.WEBVIEW_SCREEN ]: { screen: WebviewScreen, - path: 'webview-selection/:url', }, }, { diff --git a/src/js/components/HeaderCartButton.js b/src/js/components/HeaderCartButton.js index 4fd9ec0..4b586dc 100644 --- a/src/js/components/HeaderCartButton.js +++ b/src/js/components/HeaderCartButton.js @@ -15,8 +15,8 @@ export default class CartButton extends Component { render() { - var cartBadge = ; - var cartContents = ShoppingCart.getCartContents(); + let cartBadge = ; + let cartContents = ShoppingCart.getCartContents(); if (cartContents.length > 0) { cartBadge = ( diff --git a/src/js/screens/CartContents.js b/src/js/screens/CartContents.js index 57e308b..4a07e51 100644 --- a/src/js/screens/CartContents.js +++ b/src/js/screens/CartContents.js @@ -15,62 +15,65 @@ import SecondaryHeader from '../components/SecondaryHeader'; import { SCREENS } from '../Router'; export default class CartContents extends Component { - constructor(props) { - super(props); - } + constructor(props) { + super(props); - render() { + // If provided through deeplink, add the items to the cart + ShoppingCart.addDeeplinkItems(this.props.navigation.getParam('ids', '')); + } + + render() { const contents = ShoppingCart.getCartContents(); - return ( - - - - - - { contents.map((item, i) => ) } - - - this.props.navigation.navigate(SCREENS.INVENTORY_LIST) } - /> - - this.props.navigation.navigate(SCREENS.CHECKOUT_SCREEN_ONE) } - /> - -