react-native-my-survey-sdk 1.0.6 → 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.
Files changed (2) hide show
  1. package/index.js +9 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,14 +1,20 @@
1
+ // src/SurveyWebView.js (inside your NPM package)
1
2
  import React from 'react';
2
3
  import { TouchableOpacity, SafeAreaView, Image } from 'react-native';
3
4
  import { WebView } from 'react-native-webview';
5
+ import { useNavigation, useRoute } from '@react-navigation/native';
6
+
7
+ const SurveyWebView = () => {
8
+ const navigation = useNavigation();
9
+ const route = useRoute();
10
+ const { url } = route.params; // Get the URL passed from MainScreen
4
11
 
5
- const SurveyWebView = ({ url, goBack }) => {
6
12
  return (
7
13
  <SafeAreaView style={{ flex: 1 }}>
8
- <TouchableOpacity style={{ alignItems: 'flex-end', right: 15 }} onPress={goBack}>
14
+ <TouchableOpacity style={{ alignItems: 'flex-end', right: 15 }} onPress={() => navigation.goBack()}>
9
15
  <Image source={require('./assets/close.png')} style={{ height: 15, width: 20 }} />
10
16
  </TouchableOpacity>
11
- <WebView style = {{height:'20%',width:'40%'}} source={{ uri: url }} />
17
+ <WebView style={{ height: '20%', width: '40%' }} source={{ uri: url }} />
12
18
  </SafeAreaView>
13
19
  );
14
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-my-survey-sdk",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "For xebo.ai",
5
5
  "main": "index.js",
6
6
  "scripts": {