diff --git a/App.tsx b/App.tsx index 10b5f54..b1f10fe 100644 --- a/App.tsx +++ b/App.tsx @@ -1,35 +1,31 @@ -import React from 'react'; -import { ActionSheetProvider } from '@expo/react-native-action-sheet'; +import React from "react"; +import { NavigationContainer } from "@react-navigation/native"; +import { createStackNavigator } from "@react-navigation/stack"; +import MapScreen from "./src/screens/MapScreen"; +import EventCreateScreen from "./src/screens/EventCreateScreen"; -import { - useFonts, - Nunito_400Regular, - Nunito_600SemiBold, - Nunito_700Bold, - Nunito_800ExtraBold, -} from '@expo-google-fonts/nunito'; +export type RootStackParamList = { + Map: undefined; + CreateEvent: undefined; +}; -import AppStack from './src/routes/AppStack'; -import { StatusBar } from 'expo-status-bar'; +const Stack = createStackNavigator(); export default function App() { - const [fontsLoaded] = useFonts({ - Nunito_400Regular, - Nunito_600SemiBold, - Nunito_700Bold, - Nunito_800ExtraBold, - }); - - if (!fontsLoaded) { - return null; - } else { - return ( - <> - - - - - - ); - } + return ( + + + + + + + ); } diff --git a/src/screens/EventCreateScreen.tsx b/src/screens/EventCreateScreen.tsx new file mode 100644 index 0000000..5b7b5b6 --- /dev/null +++ b/src/screens/EventCreateScreen.tsx @@ -0,0 +1,315 @@ +import React, { useMemo, useState } from "react"; +import { + View, + Text, + TextInput, + StyleSheet, + TouchableOpacity, + Image, + ScrollView, + Alert, +} from "react-native"; +import * as ImagePicker from "expo-image-picker"; +import { createEvent, type EventDTO } from "../services/api"; +import { uploadImage } from "../services/imageApi"; +import { useNavigation } from "@react-navigation/native"; +import type { RootStackParamList } from "../../App"; +import type { StackNavigationProp } from "@react-navigation/stack"; + +type Nav = StackNavigationProp; + +const DATE_RE = /^\d{4}-\d{2}-\d{2}$/; +const TIME_RE = /^([01]\d|2[0-3]):[0-5]\d$/; + +export default function EventCreateScreen() { + const navigation = useNavigation