Open Raheb2034Tec opened 3 months ago
npx react-native init LogisticsApp cd LogisticsApp
npm install @react-navigation/native npm install @react-navigation/stack npm install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import HomeScreen from './screens/HomeScreen'; import LoginScreen from './screens/LoginScreen'; import ShipmentScreen from './screens/ShipmentScreen';
const Stack = createStackNavigator();
export default function App() { return (
); } import React from 'react'; import { View, Text, TextInput, Button, StyleSheet } from 'react-native';
export default function LoginScreen({ navigation }) { const [username, setUsername] = React.useState(''); const [password, setPassword] = React.useState('');
const handleLogin = () => { // تحقق من بيانات المستخدم navigation.navigate('Home'); };
return (
); }
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', padding: 16, }, input: { height: 40, borderColor: 'gray', borderWidth: 1, marginBottom: 12, padding: 8, }, });
import React from 'react'; import { View, Text, Button, StyleSheet } from 'react-native';
export default function HomeScreen({ navigation }) { return (
); }
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, }); import React from 'react'; import { View, Text, StyleSheet } from 'react-native';
export default function ShipmentScreen() { return (
); }
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, }); npx react-native run-android # لتشغيل التطبيق على محاكي Android npx react-native run-ios # لتشغيل التطبيق على محاكي iOS
npx react-native init LogisticsApp cd LogisticsApp