react-native-my-survey-sdk 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -16
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
// src/SurveyWebView.js (inside your NPM package)
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TouchableOpacity, SafeAreaView, Image } from 'react-native';
|
|
3
4
|
import { WebView } from 'react-native-webview';
|
|
4
|
-
import {
|
|
5
|
+
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
5
6
|
|
|
6
|
-
const SurveyWebView = (
|
|
7
|
-
const navigation =
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
if (navigation && navigation.goBack) {
|
|
11
|
-
navigation.goBack();
|
|
12
|
-
} else {
|
|
13
|
-
Alert.alert("Navigation Error", "Navigation context not found.");
|
|
14
|
-
}
|
|
15
|
-
};
|
|
7
|
+
const SurveyWebView = () => {
|
|
8
|
+
const navigation = useNavigation();
|
|
9
|
+
const route = useRoute();
|
|
10
|
+
const { url } = route.params; // Get the URL passed from MainScreen
|
|
16
11
|
|
|
17
12
|
return (
|
|
18
13
|
<SafeAreaView style={{ flex: 1 }}>
|
|
19
|
-
<TouchableOpacity style={{ alignItems: 'flex-end', right: 15 }} onPress={
|
|
14
|
+
<TouchableOpacity style={{ alignItems: 'flex-end', right: 15 }} onPress={() => navigation.goBack()}>
|
|
20
15
|
<Image source={require('./assets/close.png')} style={{ height: 15, width: 20 }} />
|
|
21
16
|
</TouchableOpacity>
|
|
22
|
-
|
|
23
|
-
<WebView source={{ uri: url }} />
|
|
17
|
+
<WebView style={{ height: '20%', width: '40%' }} source={{ uri: url }} />
|
|
24
18
|
</SafeAreaView>
|
|
25
19
|
);
|
|
26
20
|
};
|