Skip to content
Snippets Groups Projects
Commit a63d4bef authored by Andrea Magnussen's avatar Andrea Magnussen
Browse files

Added documentation to app and APIkit

parent 5225492b
Branches
No related tags found
1 merge request!70Resolve "Add comments to all files"
import axios from "axios"; 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({ let APIKit = axios.create({
baseURL: "http://192.168.0.30:5000", baseURL: "http://192.168.0.30:5000",
timeout: 60000, timeout: 60000,
......
...@@ -9,10 +9,26 @@ import theme from "./assets/themes/Theme"; ...@@ -9,10 +9,26 @@ import theme from "./assets/themes/Theme";
import RootStackScreen from "./navigation/RootStackScreen"; import RootStackScreen from "./navigation/RootStackScreen";
import Toast from "react-native-toast-message"; 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() { export default function App() {
const [isLoading, setIsLoading] = React.useState(true); const [isLoading, setIsLoading] = React.useState(true);
const [userToken, setUserToken] = React.useState(null); 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(() => { const authContext = React.useMemo(() => {
return { return {
signInApp: () => { signInApp: () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment