added orai
38
20250312/my-app/.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
|
||||
# Expo
|
||||
.expo/
|
||||
dist/
|
||||
web-build/
|
||||
expo-env.d.ts
|
||||
|
||||
# Native
|
||||
*.orig.*
|
||||
*.jks
|
||||
*.p8
|
||||
*.p12
|
||||
*.key
|
||||
*.mobileprovision
|
||||
|
||||
# Metro
|
||||
.metro-health-check*
|
||||
|
||||
# debug
|
||||
npm-debug.*
|
||||
yarn-debug.*
|
||||
yarn-error.*
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
|
||||
app-example
|
||||
77
20250312/my-app/App.tsx
Normal file
@@ -0,0 +1,77 @@
|
||||
import React, {useState} from 'react';
|
||||
import { View, Text, Button, TextInput, StyleSheet } from 'react-native';
|
||||
import { NavigationContainer } from '@react-navigation/native';
|
||||
import { createStackNavigator } from '@react-navigation/stack';
|
||||
|
||||
const Stack = createStackNavigator();
|
||||
|
||||
const HomeScreen = ({ navigation }: any) => {
|
||||
const [userInput, setUserInput] = useState("");
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>Kezdőképernyő</Text>
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
placeholder="Írj be valamit..."
|
||||
value={userInput}
|
||||
onChangeText={setUserInput}
|
||||
/>
|
||||
<Button
|
||||
title="További részletekhez"
|
||||
onPress={() => navigation.navigate("Details", {text: userInput})}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const DetailsScreen = ({ route, navigation}: any)=> {
|
||||
const {text} = route.params;
|
||||
|
||||
return(
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>Részletek képernyő</Text>
|
||||
<Text style={styles.text}>Beírt szöveg: {text}</Text>
|
||||
<Button title="Vissza" onPress={() => navigation.goBack()}/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return(
|
||||
<NavigationContainer>
|
||||
<Stack.Navigator>
|
||||
<Stack.Screen name="Home" component={HomeScreen} options={{ title: "Kezdőlap"}}/>
|
||||
<Stack.Screen name="Details" component={DetailsScreen} options={{ title: "Részletek"}}/>
|
||||
|
||||
</Stack.Navigator>
|
||||
</NavigationContainer>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 20,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
title:{
|
||||
fontSize: 24,
|
||||
fontWeight: "bold",
|
||||
marginBottom: 20,
|
||||
},
|
||||
input: {
|
||||
width: "80%",
|
||||
borderWidth: 1,
|
||||
borderColor: "#ccc",
|
||||
padding: 10,
|
||||
marginBottom: 20,
|
||||
borderRadius: 5,
|
||||
backgroundColor: "#ff00ff"
|
||||
},
|
||||
text: {
|
||||
fontSize: 18,
|
||||
marginBottom: 20,
|
||||
},
|
||||
});
|
||||
50
20250312/my-app/README.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Welcome to your Expo app 👋
|
||||
|
||||
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
|
||||
|
||||
## Get started
|
||||
|
||||
1. Install dependencies
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Start the app
|
||||
|
||||
```bash
|
||||
npx expo start
|
||||
```
|
||||
|
||||
In the output, you'll find options to open the app in a
|
||||
|
||||
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
|
||||
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
|
||||
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
|
||||
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
|
||||
|
||||
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
|
||||
|
||||
## Get a fresh project
|
||||
|
||||
When you're ready, run:
|
||||
|
||||
```bash
|
||||
npm run reset-project
|
||||
```
|
||||
|
||||
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
|
||||
|
||||
## Learn more
|
||||
|
||||
To learn more about developing your project with Expo, look at the following resources:
|
||||
|
||||
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
|
||||
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
|
||||
|
||||
## Join the community
|
||||
|
||||
Join our community of developers creating universal apps.
|
||||
|
||||
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
|
||||
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
|
||||
41
20250312/my-app/app.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "my-app",
|
||||
"slug": "my-app",
|
||||
"version": "1.0.0",
|
||||
"orientation": "portrait",
|
||||
"icon": "./assets/images/icon.png",
|
||||
"scheme": "myapp",
|
||||
"userInterfaceStyle": "automatic",
|
||||
"newArchEnabled": true,
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/images/adaptive-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"bundler": "metro",
|
||||
"output": "static",
|
||||
"favicon": "./assets/images/favicon.png"
|
||||
},
|
||||
"plugins": [
|
||||
"expo-router",
|
||||
[
|
||||
"expo-splash-screen",
|
||||
{
|
||||
"image": "./assets/images/splash-icon.png",
|
||||
"imageWidth": 200,
|
||||
"resizeMode": "contain",
|
||||
"backgroundColor": "#ffffff"
|
||||
}
|
||||
]
|
||||
],
|
||||
"experiments": {
|
||||
"typedRoutes": true
|
||||
}
|
||||
}
|
||||
}
|
||||
5
20250312/my-app/app/_layout.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function RootLayout() {
|
||||
return <Stack />;
|
||||
}
|
||||
31
20250312/my-app/app/components/CounterContext.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import React, {createContext, useContext, useState} from "react";
|
||||
|
||||
interface CounterContextProps {
|
||||
count: number,
|
||||
increment: () => void,
|
||||
decrement: () => void,
|
||||
}
|
||||
|
||||
const CounterContext = createContext<CounterContextProps | undefined>(undefined);
|
||||
|
||||
export const CounterProvider: React.FC<{children: React.ReactNode}> = ({children}) => {
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
const increment = () => setCount(count + 1);
|
||||
const decrement = () => setCount(count - 1);
|
||||
|
||||
return (
|
||||
<CounterContext.Provider value={{ count, increment, decrement }}>
|
||||
{children}
|
||||
</CounterContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useCounter = () => {
|
||||
const context = useContext(CounterContext);
|
||||
if(!context) {
|
||||
throw new Error("useContext must be used within a CounterProvider");
|
||||
}
|
||||
|
||||
return context;
|
||||
};
|
||||
75
20250312/my-app/app/index.tsx
Normal file
@@ -0,0 +1,75 @@
|
||||
import React, {useState} from 'react';
|
||||
import { View, Text, Button, TextInput, StyleSheet } from 'react-native';
|
||||
import { NavigationContainer } from '@react-navigation/native';
|
||||
import { createStackNavigator } from '@react-navigation/stack';
|
||||
|
||||
import { CounterProvider, useCounter } from './components/CounterContext';
|
||||
|
||||
const Stack = createStackNavigator();
|
||||
|
||||
const HomeScreen = ({ navigation }: any) => {
|
||||
const [userInput, setUserInput] = useState("");
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>Kezdőképernyő</Text>
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
placeholder="Írj be valamit..."
|
||||
value={userInput}
|
||||
onChangeText={setUserInput}
|
||||
/>
|
||||
<Button
|
||||
title="További részletekhez"
|
||||
onPress={() => navigation.navigate("Details", {text: userInput})}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const DetailsScreen = ({ route, navigation}: any)=> {
|
||||
const {text} = route.params;
|
||||
|
||||
return(
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>Részletek képernyő</Text>
|
||||
<Text style={styles.text}>Beírt szöveg: {text}</Text>
|
||||
<Button title="Vissza" onPress={() => navigation.goBack()}/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 20,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
title:{
|
||||
fontSize: 24,
|
||||
fontWeight: "bold",
|
||||
marginBottom: 20,
|
||||
},
|
||||
input: {
|
||||
width: "80%",
|
||||
borderWidth: 1,
|
||||
borderColor: "#ccc",
|
||||
padding: 10,
|
||||
marginBottom: 20,
|
||||
borderRadius: 5,
|
||||
backgroundColor: "#ff00ff"
|
||||
},
|
||||
text: {
|
||||
fontSize: 18,
|
||||
marginBottom: 20,
|
||||
},
|
||||
});
|
||||
|
||||
export default function Index() {
|
||||
return(
|
||||
<Stack.Navigator>
|
||||
<Stack.Screen name="Home" component={HomeScreen} options={{ title: "Kezdőlap"}}/>
|
||||
<Stack.Screen name="Details" component={DetailsScreen} options={{ title: "Részletek"}}/>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
BIN
20250312/my-app/assets/fonts/SpaceMono-Regular.ttf
Normal file
BIN
20250312/my-app/assets/images/adaptive-icon.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
20250312/my-app/assets/images/favicon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
20250312/my-app/assets/images/icon.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
20250312/my-app/assets/images/partial-react-logo.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
20250312/my-app/assets/images/react-logo.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
20250312/my-app/assets/images/react-logo@2x.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
20250312/my-app/assets/images/react-logo@3x.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
20250312/my-app/assets/images/splash-icon.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
14492
20250312/my-app/package-lock.json
generated
Normal file
56
20250312/my-app/package.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "my-app",
|
||||
"main": "expo-router/entry",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"reset-project": "node ./scripts/reset-project.js",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"web": "expo start --web",
|
||||
"test": "jest --watchAll",
|
||||
"lint": "expo lint"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-expo"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^14.0.2",
|
||||
"@react-navigation/bottom-tabs": "^7.2.0",
|
||||
"@react-navigation/native": "^7.0.15",
|
||||
"@react-navigation/stack": "^7.1.2",
|
||||
"expo": "~52.0.38",
|
||||
"expo-blur": "~14.0.3",
|
||||
"expo-constants": "~17.0.8",
|
||||
"expo-font": "~13.0.4",
|
||||
"expo-haptics": "~14.0.1",
|
||||
"expo-linking": "~7.0.5",
|
||||
"expo-router": "~4.0.18",
|
||||
"expo-splash-screen": "~0.29.22",
|
||||
"expo-status-bar": "~2.0.1",
|
||||
"expo-symbols": "~0.2.2",
|
||||
"expo-system-ui": "~4.0.8",
|
||||
"expo-web-browser": "~14.0.2",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-native": "0.76.7",
|
||||
"react-native-gesture-handler": "~2.20.2",
|
||||
"react-native-reanimated": "~3.16.1",
|
||||
"react-native-safe-area-context": "^4.12.0",
|
||||
"react-native-screens": "~4.4.0",
|
||||
"react-native-vector-icons": "^10.2.0",
|
||||
"react-native-web": "~0.19.13",
|
||||
"react-native-webview": "13.12.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/react": "~18.3.12",
|
||||
"@types/react-test-renderer": "^18.3.0",
|
||||
"jest": "^29.2.1",
|
||||
"jest-expo": "~52.0.6",
|
||||
"react-test-renderer": "18.3.1",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
17
20250312/my-app/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "expo/tsconfig.base",
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".expo/types/**/*.ts",
|
||||
"expo-env.d.ts"
|
||||
]
|
||||
}
|
||||