refactor(mobile): default to web frame if isDev (#1586)

* refactor(mobile): default to web frame if isDev

* fix: ignore native challenges

* fix: use contentInset for padding
This commit is contained in:
Mo
2022-09-16 12:44:06 -05:00
committed by GitHub
parent 5a8752b95a
commit 0c3c98d7af
5 changed files with 26 additions and 2 deletions

View File

@@ -0,0 +1 @@
dist

View File

@@ -1,3 +1,8 @@
metro.config.js
packages/mobile/html/Web.bundle/src/components
packages/mobile/html/Web.bundle/src/web-src
html/**/*
node_modules
ios
e2e
android
fastlane
WebFrame

View File

@@ -146,6 +146,19 @@ export const AppStackComponent = (props: ModalStackNavigationProp<'AppStack'>) =
return removeObserver
}, [application, navigation])
if (IsDev) {
return (
<AppStack.Navigator
screenOptions={() => ({
headerShown: false,
})}
initialRouteName={SCREEN_NOTES}
>
<AppStack.Screen name={SCREEN_NOTES} component={IsDev ? MobileWebAppContainer : Root} />
</AppStack.Navigator>
)
}
return (
<DrawerLayout
ref={drawerRef}

View File

@@ -135,6 +135,10 @@ export class MobileApplication extends SNApplication {
}
promptForChallenge(challenge: Challenge) {
if (IsDev) {
return
}
push(SCREEN_AUTHENTICATE, { challenge, title: challenge.modalTitle })
}

View File

@@ -123,6 +123,7 @@ export const MobileWebAppContainer = () => {
ref={webViewRef}
source={{ uri: sourceUri }}
originWhitelist={['*']}
contentInset={{ top: 30, bottom: 10 }}
onLoad={() => {}}
onError={(err) => console.error('An error has occurred', err)}
onHttpError={() => console.error('An HTTP error occurred')}