diff --git a/APIkit.js b/APIkit.js index 740b4ab1f30fbec57da064fcd78eff935faca20a..a99c700e6836fdab2fdf19c91a8a3cd7e82f6e2e 100644 --- a/APIkit.js +++ b/APIkit.js @@ -1,6 +1,13 @@ import axios from "axios"; -// Create axios client, pre-configured with baseURL +/** + * An instance of axios which is used everytime a network request is needed. + * @baseURL where the request should be sent to. + * @timeout how long the system will try to perform the request. + * @headers what type of data is accepted. + * + * @return the instance. + */ let APIKit = axios.create({ baseURL: "http://192.168.0.30:5000", timeout: 60000, diff --git a/App.js b/App.js index c23ec439f3ca207b900f0d064e6a6b4efc48adfc..9739e73486676ad879921df0db1eb6dee7cfc7ca 100644 --- a/App.js +++ b/App.js @@ -9,10 +9,26 @@ import theme from "./assets/themes/Theme"; import RootStackScreen from "./navigation/RootStackScreen"; import Toast from "react-native-toast-message"; +/** + * The application. + * + * @store - used for redux and the state store. + * @theme - used for theming and the look of the application (react native paper) + * @authContext - the first way of handling the state of the user. Still in use to switch the stack based on the users + * log in state. Should be replaced by redux. + * @userToken - used for handling the user state. + * @Toast - used for the toast messages to be visible on all screens when used. + * + * @returns the application. + */ export default function App() { const [isLoading, setIsLoading] = React.useState(true); const [userToken, setUserToken] = React.useState(null); + /** + * An early version of handling state in the application, to see if a user is logged in or not. + * Should be replaced by redux in the future. + */ const authContext = React.useMemo(() => { return { signInApp: () => {