Skip to content

Commit

Permalink
chore: fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Apr 16, 2024
1 parent 7194b75 commit 60d491b
Show file tree
Hide file tree
Showing 31 changed files with 473 additions and 47 deletions.
3 changes: 1 addition & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ dependencies {
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

implementation("androidx.core:core-splashscreen:1.0.0")
implementation("com.google.mlkit:barcode-scanning:17.2.0")

if (hermesEnabled.toBoolean()) {
Expand All @@ -168,4 +167,4 @@ project.ext.vectoricons = [
iconFontNames: [ 'Ionicons.ttf' ]
]

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
5 changes: 3 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/BootTheme"> <!-- Replace @style/AppTheme with @style/BootTheme -->
android:theme="@style/AppTheme"> <!-- Apply @style/AppTheme on .MainApplication -->
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:screenOrientation = "portrait"
android:windowSoftInputMode="adjustResize"
android:exported="true">
android:exported="true"
android:theme="@style/BootTheme"> <!-- Apply @style/BootTheme on .MainActivity -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
8 changes: 8 additions & 0 deletions android/app/src/main/java/com/galoyapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

import android.os.Bundle
import com.zoontek.rnbootsplash.RNBootSplash

class MainActivity : ReactActivity() {

/**
Expand All @@ -19,4 +22,9 @@ class MainActivity : ReactActivity() {
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)

override fun onCreate(savedInstanceState: Bundle?) {
RNBootSplash.init(this, R.style.BootTheme) // ⬅️ initialize the splash screen
super.onCreate(savedInstanceState) // super.onCreate(null) with react-native-screens
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<item name="android:windowBackground">@color/windowBackgroundColor</item>
</style>

<!-- BootTheme should inherit from Theme.SplashScreen -->
<style name="BootTheme" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/bootsplash_background</item>
<item name="windowSplashScreenAnimatedIcon">@mipmap/bootsplash_logo</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
<!-- BootTheme should inherit from Theme.BootSplash or Theme.BootSplash.EdgeToEdge -->
<style name="BootTheme" parent="Theme.BootSplash">
<item name="bootSplashBackground">@color/bootsplash_background</item>
<item name="bootSplashLogo">@drawable/bootsplash_logo</item>
<item name="postBootSplashTheme">@style/AppTheme</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion app/navigation/navigation-container-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const NavigationContainerWrapper: React.FC<React.PropsWithChildren> = ({
{...(mode === "dark" ? { theme: DarkTheme } : {})}
linking={linking}
onReady={() => {
RNBootSplash.hide({ fade: true, duration: 220 })
RNBootSplash.hide({ fade: true })
console.log("NavigationContainer onReady")
}}
onStateChange={(state) => {
Expand Down
4 changes: 2 additions & 2 deletions app/screens/webview/webview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react"
import { Alert, TouchableOpacity } from "react-native"
import { injectJs, onMessageHandler } from "react-native-webln"
import { WebView, WebViewNavigation } from "react-native-webview"
import { WebView, WebViewNavigation, WebViewMessageEvent } from "react-native-webview"

import { GaloyIcon } from "@app/components/atomic/galoy-icon"
import { useI18nContext } from "@app/i18n/i18n-react"
Expand Down Expand Up @@ -76,7 +76,7 @@ export const WebViewScreen: React.FC<Props> = ({ route }) => {
ref={webview}
source={{ uri: url }}
onLoadStart={() => setJsInjected(false)}
onLoadProgress={(e) => {
onLoadProgress={(e: WebViewMessageEvent) => {
if (!jsInjected && e.nativeEvent.progress > 0.75) {
if (webview.current) {
webview.current.injectJavaScript(injectThemeJs())
Expand Down
2 changes: 1 addition & 1 deletion e2e/story-book/open-all-screens.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const openAndCloseStory = async (story: WebdriverIO.Element) => {

const openAllStoriesOnScreen = async (lastSeenStory: string | null) => {
const visibleStories = await $$(`//*[contains(@content-desc,"Storybook.ListItem")]`)
const lastSeenStoryIndex = visibleStories.findIndex(
const lastSeenStoryIndex = await visibleStories.findIndex(
(story) => story.elementId === lastSeenStory,
)
const newStories = visibleStories.slice(lastSeenStoryIndex + 1)
Expand Down
15 changes: 6 additions & 9 deletions ios/GaloyApp/BootSplash.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -12,22 +12,19 @@
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController modalTransitionStyle="crossDissolve" id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" autoresizesSubviews="NO" userInteractionEnabled="NO" contentMode="scaleToFill" id="Ze5-6b-2t3">
<view key="view" autoresizesSubviews="NO" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView autoresizesSubviews="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" image="BootSplashLogo" translatesAutoresizingMaskIntoConstraints="NO" id="3lX-Ut-9ad">
<rect key="frame" x="37.5" y="271" width="300" height="125"/>
<rect key="frame" x="43.5" y="273.5" width="288" height="120"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" image="YES" notEnabled="YES"/>
</accessibility>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" red="0.00000000000000" green="0.00000000000000" blue="0.00000000000000" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" notEnabled="YES"/>
</accessibility>
<constraints>
<constraint firstItem="3lX-Ut-9ad" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="Fh9-Fy-1nT"/>
<constraint firstItem="3lX-Ut-9ad" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="nvB-Ic-PnI"/>
Expand All @@ -40,6 +37,6 @@
</scene>
</scenes>
<resources>
<image name="BootSplashLogo" width="300" height="125"/>
<image name="BootSplashLogo" width="288" height="120"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
"images": [
{
"idiom": "universal",
"filename": "bootsplash_logo.png",
"filename": "bootsplash_logo-ldf3jg.png",
"scale": "1x"
},
{
"idiom": "universal",
"filename": "[email protected]",
"filename": "bootsplash_logo-ldf3jg@2x.png",
"scale": "2x"
},
{
"idiom": "universal",
"filename": "[email protected]",
"filename": "bootsplash_logo-ldf3jg@3x.png",
"scale": "3x"
}
],
"info": {
"version": 1,
"author": "xcode"
"author": "xcode",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 2 additions & 5 deletions ios/GaloyApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
Expand All @@ -86,13 +85,11 @@
<key>NSLocationWhenInUseUsageDescription</key>
<string>Find merchants who accept bitcoin near you</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Find merchants who accept bitcoin near you</string>
<string>This app includes a component that requires background location access, but your location is only used while in app to find merchants near you.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Import a screenshot with a QR code</string>
<key>NFCReaderUsageDescription</key>
<string>Receive payments over NFC</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app includes a component that requires background location access, but your location is only used while in app to find merchants near you.</string>
<key>UIAppFonts</key>
<array>
<string>Ionicons.ttf</string>
Expand All @@ -109,7 +106,7 @@
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>BootSplash.storyboard</string>
<string>BootSplash</string>
<key>UIMainStoryboardFile</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ SPEC CHECKSUMS:
AppCheckCore: ef7a5f4ae432941d2835c7c9ba14131028aa33bd
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: f64d1e2ea739b4d8f7e4740cde18089cd97fe864
FBReactNativeSpec: 9f2b8b243131565335437dba74923a8d3015e780
Firebase: 91fefd38712feb9186ea8996af6cbdef41473442
Expand All @@ -1638,7 +1638,7 @@ SPEC CHECKSUMS:
FirebaseSessions: 2651b464e241c93fd44112f995d5ab663c970487
FirebaseSharedSwift: 76e1529c32101d80e4f1ca2fba7c39d59f0a390a
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
GoogleAppMeasurement: f3abf08495ef2cba7829f15318c373b8d9226491
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"android:buildDebug": "yarn android:prepareAssets && ./android/gradlew -b ./android/build.gradle assembleDebug -Dorg.gradle.jvmargs='-Xmx4g -XX:MaxPermSize=512m'",
"ios:prepareAssets": "react-native bundle --entry-file index.js --bundle-output ./ios/main.jsbundle --assets-dest ./ios/ --platform ios --dev false",
"bundle-visualizer": "yarn run react-native-bundle-visualizer",
"splash": "yarn react-native generate-bootsplash --background-color \"#000\" --logo-width 300 app/assets/logo/app-logo-dark.svg",
"splash": "yarn react-native generate-bootsplash --background \"#000\" --logo-width 288 app/assets/logo/app-logo-dark.svg",
"e2e:build": "detox build --configuration",
"e2e:test": "detox test --configuration",
"find-unused-ll-keys": "yarn node utils/find-unused-ll-keys.js"
Expand Down Expand Up @@ -150,7 +150,7 @@
"use-count-up": "^3.0.1",
"uuid": "^9.0.0",
"validator": "^13.9.0",
"victory-native": "^40.1.0",
"victory-native": "36",
"webln": "^0.3.2"
},
"devDependencies": {
Expand Down
14 changes: 14 additions & 0 deletions patches/react-native-vector-icons+10.0.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/node_modules/react-native-vector-icons/fonts.gradle
+++ b/node_modules/react-native-vector-icons/fonts.gradle
@@ -32,6 +32,11 @@ afterEvaluate {
lintVitalAnalyzeTask.dependsOn(fontCopyTask)
}

+ def generateReportTask = tasks.findByName("generate${targetName}LintVitalReportModel")
+ if (generateReportTask) {
+ generateReportTask.dependsOn(fontCopyTask)
+ }
+
def generateAssetsTask = tasks.findByName("generate${targetName}Assets")
generateAssetsTask.dependsOn(fontCopyTask)
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@react-native/typescript-config/tsconfig.json",
"compilerOptions": {
"module": "esnext",
"allowJs": false,
"sourceMap": true,
"baseUrl": "./",
Expand Down
Loading

0 comments on commit 60d491b

Please sign in to comment.