From 556bf52865bd252a365ed81575649cd09fb36ad7 Mon Sep 17 00:00:00 2001 From: Imbus Date: Fri, 15 Dec 2023 03:07:15 +0100 Subject: [PATCH] So called working --- App.tsx | 11 +++++++++++ src/components/NewPostContainer.tsx | 15 +++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/App.tsx b/App.tsx index 21b6298..a116cd9 100644 --- a/App.tsx +++ b/App.tsx @@ -5,6 +5,17 @@ import { PostsContainer } from "./src/components/PostsContainer"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { NewPostContainer } from "./src/components/NewPostContainer"; +import { NativeStackNavigationProp } from "@react-navigation/native-stack"; + +type RootStackParamList = { + Home: undefined; + New: undefined; +}; + +export type HomeScreenNavigationProp = NativeStackNavigationProp< + RootStackParamList, + "Home" + >; const Stack = createNativeStackNavigator(); diff --git a/src/components/NewPostContainer.tsx b/src/components/NewPostContainer.tsx index b0c852e..b475d2d 100644 --- a/src/components/NewPostContainer.tsx +++ b/src/components/NewPostContainer.tsx @@ -1,7 +1,7 @@ import React from "react"; import { View, Text, TextInput, Button } from "react-native"; import { style } from "../util/style"; -import { createPost, NewPost } from "../util/api"; +import { createPost, NewPost, submitLogin } from "../util/api"; export function NewPostContainer({ navigation }): JSX.Element { const [currentInput, setCurrentInput] = React.useState(""); @@ -21,13 +21,20 @@ export function NewPostContainer({ navigation }): JSX.Element {