Showing
4 changed files
with
29 additions
and
0 deletions
| @@ -233,6 +233,8 @@ PODS: | @@ -233,6 +233,8 @@ PODS: | ||
| 233 | - React-cxxreact (= 0.62.1) | 233 | - React-cxxreact (= 0.62.1) |
| 234 | - React-jsi (= 0.62.1) | 234 | - React-jsi (= 0.62.1) |
| 235 | - React-jsinspector (0.62.1) | 235 | - React-jsinspector (0.62.1) |
| 236 | + - react-native-netinfo (5.7.1): | ||
| 237 | + - React | ||
| 236 | - react-native-safe-area-context (0.7.3): | 238 | - react-native-safe-area-context (0.7.3): |
| 237 | - React | 239 | - React |
| 238 | - react-native-webview (9.1.1): | 240 | - react-native-webview (9.1.1): |
| @@ -340,6 +342,7 @@ DEPENDENCIES: | @@ -340,6 +342,7 @@ DEPENDENCIES: | ||
| 340 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) | 342 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) |
| 341 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) | 343 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) |
| 342 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) | 344 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) |
| 345 | + - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" | ||
| 343 | - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) | 346 | - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) |
| 344 | - react-native-webview (from `../node_modules/react-native-webview`) | 347 | - react-native-webview (from `../node_modules/react-native-webview`) |
| 345 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) | 348 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) |
| @@ -408,6 +411,8 @@ EXTERNAL SOURCES: | @@ -408,6 +411,8 @@ EXTERNAL SOURCES: | ||
| 408 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" | 411 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" |
| 409 | React-jsinspector: | 412 | React-jsinspector: |
| 410 | :path: "../node_modules/react-native/ReactCommon/jsinspector" | 413 | :path: "../node_modules/react-native/ReactCommon/jsinspector" |
| 414 | + react-native-netinfo: | ||
| 415 | + :path: "../node_modules/@react-native-community/netinfo" | ||
| 411 | react-native-safe-area-context: | 416 | react-native-safe-area-context: |
| 412 | :path: "../node_modules/react-native-safe-area-context" | 417 | :path: "../node_modules/react-native-safe-area-context" |
| 413 | react-native-webview: | 418 | react-native-webview: |
| @@ -479,6 +484,7 @@ SPEC CHECKSUMS: | @@ -479,6 +484,7 @@ SPEC CHECKSUMS: | ||
| 479 | React-jsi: 600d8e42510c3254fd2abd702f4b9d3f598d8f52 | 484 | React-jsi: 600d8e42510c3254fd2abd702f4b9d3f598d8f52 |
| 480 | React-jsiexecutor: e9698dee4fd43ceb44832baf15d5745f455b0157 | 485 | React-jsiexecutor: e9698dee4fd43ceb44832baf15d5745f455b0157 |
| 481 | React-jsinspector: f74a62727e5604119abd4a1eda52c0a12144bcd5 | 486 | React-jsinspector: f74a62727e5604119abd4a1eda52c0a12144bcd5 |
| 487 | + react-native-netinfo: 4fa023c153d582aeae8435df95c9a975c5986449 | ||
| 482 | react-native-safe-area-context: e200d4433aba6b7e60b52da5f37af11f7a0b0392 | 488 | react-native-safe-area-context: e200d4433aba6b7e60b52da5f37af11f7a0b0392 |
| 483 | react-native-webview: 0633fd7861a9bd7a80bacaee7da763c3afc248fa | 489 | react-native-webview: 0633fd7861a9bd7a80bacaee7da763c3afc248fa |
| 484 | React-RCTActionSheet: af8f28dd82fec89b8fe29637b8c779829e016a88 | 490 | React-RCTActionSheet: af8f28dd82fec89b8fe29637b8c779829e016a88 |
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | "@huse/previous-value": "^1.0.1", | 16 | "@huse/previous-value": "^1.0.1", |
| 17 | "@react-native-community/art": "^1.2.0", | 17 | "@react-native-community/art": "^1.2.0", |
| 18 | "@react-native-community/masked-view": "^0.1.7", | 18 | "@react-native-community/masked-view": "^0.1.7", |
| 19 | + "@react-native-community/netinfo": "^5.7.1", | ||
| 19 | "@react-navigation/bottom-tabs": "^5.2.5", | 20 | "@react-navigation/bottom-tabs": "^5.2.5", |
| 20 | "@react-navigation/drawer": "^5.4.0", | 21 | "@react-navigation/drawer": "^5.4.0", |
| 21 | "@react-navigation/material-top-tabs": "^5.1.7", | 22 | "@react-navigation/material-top-tabs": "^5.1.7", |
| 1 | import React from 'react'; | 1 | import React from 'react'; |
| 2 | import { useWindowDimensions } from 'react-native'; | 2 | import { useWindowDimensions } from 'react-native'; |
| 3 | import { screensEnabled } from 'react-native-screens'; | 3 | import { screensEnabled } from 'react-native-screens'; |
| 4 | +import { useNetInfo } from '@react-native-community/netinfo'; | ||
| 4 | import { ListItem, BGScroll, Card, Divider } from '../component/View'; | 5 | import { ListItem, BGScroll, Card, Divider } from '../component/View'; |
| 5 | import { MainTabScreenProps } from '../type/Navigation'; | 6 | import { MainTabScreenProps } from '../type/Navigation'; |
| 6 | import { useI18nStrings } from '../i18n'; | 7 | import { useI18nStrings } from '../i18n'; |
| @@ -12,6 +13,7 @@ const SystemInfo = ({ | @@ -12,6 +13,7 @@ const SystemInfo = ({ | ||
| 12 | route, | 13 | route, |
| 13 | }: MainTabScreenProps<'SystemInfo'>) => { | 14 | }: MainTabScreenProps<'SystemInfo'>) => { |
| 14 | const strings = useI18nStrings(); | 15 | const strings = useI18nStrings(); |
| 16 | + const netInfo = useNetInfo(); | ||
| 15 | const { width, height, fontScale, scale } = useWindowDimensions(); | 17 | const { width, height, fontScale, scale } = useWindowDimensions(); |
| 16 | return ( | 18 | return ( |
| 17 | <BGScroll white> | 19 | <BGScroll white> |
| @@ -45,6 +47,21 @@ const SystemInfo = ({ | @@ -45,6 +47,21 @@ const SystemInfo = ({ | ||
| 45 | /> | 47 | /> |
| 46 | </Card> | 48 | </Card> |
| 47 | <Card shadow> | 49 | <Card shadow> |
| 50 | + <ListItem title="type" rightTitle={netInfo.type} /> | ||
| 51 | + <Divider /> | ||
| 52 | + <ListItem | ||
| 53 | + title="isInternetReachable" | ||
| 54 | + rightTitle={`${netInfo.isInternetReachable}`} | ||
| 55 | + /> | ||
| 56 | + <Divider /> | ||
| 57 | + <ListItem title="isConnected" rightTitle={`${netInfo.isConnected}`} /> | ||
| 58 | + <Divider /> | ||
| 59 | + <ListItem | ||
| 60 | + title="details" | ||
| 61 | + rightTitle={JSON.stringify(netInfo.details)} | ||
| 62 | + /> | ||
| 63 | + </Card> | ||
| 64 | + <Card shadow> | ||
| 48 | <ListItem | 65 | <ListItem |
| 49 | title="RNDeviceInfo" | 66 | title="RNDeviceInfo" |
| 50 | onPress={() => navigation.navigate('RNDeviceInfoList')} | 67 | onPress={() => navigation.navigate('RNDeviceInfoList')} |
| @@ -1170,6 +1170,11 @@ | @@ -1170,6 +1170,11 @@ | ||
| 1170 | resolved "https://registry.npm.taobao.org/@react-native-community/masked-view/download/@react-native-community/masked-view-0.1.7.tgz#a65ce0702f55cb67fd777995de6fc7b3e5781903" | 1170 | resolved "https://registry.npm.taobao.org/@react-native-community/masked-view/download/@react-native-community/masked-view-0.1.7.tgz#a65ce0702f55cb67fd777995de6fc7b3e5781903" |
| 1171 | integrity sha1-plzgcC9Vy2f9d3mV3m/Hs+V4GQM= | 1171 | integrity sha1-plzgcC9Vy2f9d3mV3m/Hs+V4GQM= |
| 1172 | 1172 | ||
| 1173 | +"@react-native-community/netinfo@^5.7.1": | ||
| 1174 | + version "5.7.1" | ||
| 1175 | + resolved "https://registry.npm.taobao.org/@react-native-community/netinfo/download/@react-native-community/netinfo-5.7.1.tgz#715a6061307055c6aa59c901bca313050695f75e" | ||
| 1176 | + integrity sha1-cVpgYTBwVcaqWckBvKMTBQaV914= | ||
| 1177 | + | ||
| 1173 | "@react-navigation/bottom-tabs@^5.2.5": | 1178 | "@react-navigation/bottom-tabs@^5.2.5": |
| 1174 | version "5.2.5" | 1179 | version "5.2.5" |
| 1175 | resolved "https://registry.npm.taobao.org/@react-navigation/bottom-tabs/download/@react-navigation/bottom-tabs-5.2.5.tgz#d434dbf99bd963005d13d05eec3558ae12b9f1af" | 1180 | resolved "https://registry.npm.taobao.org/@react-navigation/bottom-tabs/download/@react-navigation/bottom-tabs-5.2.5.tgz#d434dbf99bd963005d13d05eec3558ae12b9f1af" |
-
Please register or login to post a comment