Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Salamander - APP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eirik Martin Danielsen
Salamander - APP
Commits
a63d4bef
Commit
a63d4bef
authored
3 years ago
by
Andrea Magnussen
Browse files
Options
Downloads
Patches
Plain Diff
Added documentation to app and APIkit
parent
5225492b
Branches
Branches containing commit
No related tags found
1 merge request
!70
Resolve "Add comments to all files"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
APIkit.js
+8
-1
8 additions, 1 deletion
APIkit.js
App.js
+16
-0
16 additions, 0 deletions
App.js
with
24 additions
and
1 deletion
APIkit.js
+
8
−
1
View file @
a63d4bef
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
,
...
...
This diff is collapsed.
Click to expand it.
App.js
+
16
−
0
View file @
a63d4bef
...
@@ -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
:
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment