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:
1
packages/components/.eslintignore
Normal file
1
packages/components/.eslintignore
Normal file
@@ -0,0 +1 @@
|
||||
dist
|
||||
@@ -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
|
||||
@@ -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}
|
||||
|
||||
@@ -135,6 +135,10 @@ export class MobileApplication extends SNApplication {
|
||||
}
|
||||
|
||||
promptForChallenge(challenge: Challenge) {
|
||||
if (IsDev) {
|
||||
return
|
||||
}
|
||||
|
||||
push(SCREEN_AUTHENTICATE, { challenge, title: challenge.modalTitle })
|
||||
}
|
||||
|
||||
|
||||
@@ -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')}
|
||||
|
||||
Reference in New Issue
Block a user