added main

This commit is contained in:
szabomarton
2025-03-27 10:19:01 +01:00
parent 98b119aa96
commit 94cf2e3924
17 changed files with 14941 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import { Stack } from "expo-router";
export default function RootLayout() {
return <Stack />;
}

View File

@@ -0,0 +1,43 @@
import { useEffect, useState } from "react";
import { View, Text, TextInput, Button, FlatList, StyleSheet, Alert } from "react-native";
const baseUrl = "http://api.weatherapi.com/v1/current.json?key=1232eaa82978466da1f81125252703&q=";
export default function Index() {
const [city, setCity] = useState("");
const handlePress = () => {
console.log(city);
}
useEffect(() => {
async function fetchData() {
try {
const response = await fetch(`${baseUrl}Békéscsaba`);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
}
fetchData();
}, []);
return (
<View>
<Text>
Időjárás app
</Text>
<Button
title="Keresés"
onPress={handlePress} />
<TextInput
placeholder="Város"
value={city}
onChangeText={setCity} />
</View>
);
}