diff --git a/client/mobile/package.json b/client/mobile/package.json index 02fd66a2..e1ca7fc0 100644 --- a/client/mobile/package.json +++ b/client/mobile/package.json @@ -13,6 +13,7 @@ "dependencies": { "@notifee/react-native": "^7.4.0", "immer": "^9.0.19", + "lodash": "^4.17.21", "mini-star": "^2.0.8", "react": "18.2.0", "react-native": "0.71.2", @@ -20,6 +21,7 @@ "react-native-reanimated": "^2.14.4", "react-native-ui-lib": "^6.29.1", "react-native-webview": "^11.26.1", + "url-regex": "^5.0.0", "zustand": "^4.3.2" }, "devDependencies": { @@ -29,6 +31,7 @@ "@react-native-community/eslint-config": "^3.2.0", "@tsconfig/react-native": "^2.0.2", "@types/jest": "^29.2.1", + "@types/lodash": "^4.14.191", "@types/react": "^18.0.24", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.2.1", diff --git a/client/mobile/src/Entry.tsx b/client/mobile/src/Entry.tsx index 2fb59d2b..277f8b96 100644 --- a/client/mobile/src/Entry.tsx +++ b/client/mobile/src/Entry.tsx @@ -1,14 +1,16 @@ import React, { useState } from 'react'; -import { ScrollView, StyleSheet, TextInput } from 'react-native'; +import { Alert, ScrollView, StyleSheet, TextInput } from 'react-native'; import { ServerCard } from './components/ServerCard'; import { useServerStore } from './store/server'; import Dialog from 'react-native-ui-lib/dialog'; import { Button, PanningProvider, Text, View } from 'react-native-ui-lib'; +import { isValidUrl } from './lib/utils'; export const Entry: React.FC = React.memo(() => { const { serverList, selectServer, addServer } = useServerStore(); const [dialogVisible, setDialogVisible] = useState(false); const [serverUrl, setServerUrl] = useState(''); + const [loading, setLoading] = useState(false); return ( @@ -19,6 +21,7 @@ export const Entry: React.FC = React.memo(() => { style={styles.item} name={serverInfo.name ?? serverInfo.url} url={serverInfo.url} + version={serverInfo.version} onPress={() => selectServer(serverInfo)} /> ); @@ -43,9 +46,24 @@ export const Entry: React.FC = React.memo(() => {