From 7b01c9e69a60e51079394b31a4821873cc410c88 Mon Sep 17 00:00:00 2001 From: dDogge <> Date: Fri, 15 Dec 2023 12:07:24 +0100 Subject: [PATCH] Added comments to NewPostContainer --- src/components/NewPostContainer.tsx | 44 +++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/components/NewPostContainer.tsx b/src/components/NewPostContainer.tsx index b475d2d..882124b 100644 --- a/src/components/NewPostContainer.tsx +++ b/src/components/NewPostContainer.tsx @@ -3,12 +3,30 @@ import { View, Text, TextInput, Button } from "react-native"; import { style } from "../util/style"; import { createPost, NewPost, submitLogin } from "../util/api"; +/** + * NewPostContainer component for handling new post creation. + * + * @component + * @param {object} props - React component props. + * @param {object} props.navigation - Navigation object for navigating between screens. + * @returns {JSX.Element} - Rendered NewPostContainer component. + */ export function NewPostContainer({ navigation }): JSX.Element { + /** + * State hook for managing the current input text. + * @type {[string, React.Dispatch>]} + */ const [currentInput, setCurrentInput] = React.useState(""); + + /** + * State hook for managing the current input error message. + * @type {[string, React.Dispatch>]} + */ const [currentInputError, setCurrentInputError] = React.useState(""); return ( + {/* Input field for the new post */} + + {/* Button to submit the new post */}