Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
240
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-240
240
Commits
6beb123f
Commit
6beb123f
authored
Oct 07, 2022
by
Malsha Rathnasiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change contants.js
parent
95824fb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
MobileApp/api/constants.js
MobileApp/api/constants.js
+2
-2
MobileApp/components/UserIcon.jsx
MobileApp/components/UserIcon.jsx
+42
-0
MobileApp/navigation/index.jsx
MobileApp/navigation/index.jsx
+1
-0
MobileApp/screens/TabTwoScreen.tsx
MobileApp/screens/TabTwoScreen.tsx
+2
-0
No files found.
MobileApp/api/constants.js
View file @
6beb123f
// export const BACKEND_URL = "http://192.168.8.103:8000"
import
{
Platform
}
from
'
react-native
'
export
const
BACKEND_ADDRESS
=
Platform
.
OS
==
'
web
'
?
"
127.0.0.1:8000
"
:
"
0afe
-112-134-223-169.ap.ngrok.io
"
export
const
BACKEND_URL
=
`
http://
${
BACKEND_ADDRESS
}
`
export
const
BACKEND_ADDRESS
=
Platform
.
OS
==
'
web
'
?
"
http://127.0.0.1:8000
"
:
"
https//9845
-112-134-223-169.ap.ngrok.io
"
export
const
BACKEND_URL
=
`
${
BACKEND_ADDRESS
}
`
MobileApp/components/UserIcon.jsx
0 → 100644
View file @
6beb123f
import
React
,
{
useEffect
,
useState
}
from
'
react
'
import
{
View
,
Text
,
ActivityIndicator
}
from
'
react-native
'
import
AsyncStorage
from
'
@react-native-async-storage/async-storage
'
export
const
UserProfile
=
()
=>
{
const
[
loading
,
setLoading
]
=
useState
(
true
)
const
[
username
,
setUsername
]
=
useState
(
""
)
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
)
useEffect
(()
=>
{
AsyncStorage
.
getItem
(
'
username
'
).
then
((
username
)
=>
{
setUsername
(
username
)
setLoading
(
false
)
})
})
if
(
loading
)
{
return
<
ActivityIndicator
/>
}
return
(
<>
<
Modal
animationType=
"slide"
transparent=
{
true
}
visible=
{
modalVisible
}
onRequestClose=
{
()
=>
{
Alert
.
alert
(
'
Modal has been closed.
'
);
setModalVisible
(
!
modalVisible
);
}
}
>
<
View
style=
{
styles
.
centeredView
}
>
<
View
style=
{
styles
.
modalView
}
>
<
Text
style=
{
styles
.
modalText
}
>
Hello World!
</
Text
>
<
Pressable
style=
{
[
styles
.
button
,
styles
.
buttonClose
]
}
onPress=
{
()
=>
setModalVisible
(
!
modalVisible
)
}
>
<
Text
style=
{
styles
.
textStyle
}
>
Hide Modal
</
Text
>
</
Pressable
>
</
View
>
</
View
>
</
Modal
>
</>
)
}
\ No newline at end of file
MobileApp/navigation/index.jsx
View file @
6beb123f
...
...
@@ -123,6 +123,7 @@ function BottomTabNavigator({ onLogout }) {
style=
{
({
pressed
})
=>
({
opacity
:
pressed
?
0.5
:
1
,
})
}
>
{
/* <Text>Logout</Text> */
}
<
FontAwesome
name=
"info-circle"
size=
{
25
}
...
...
MobileApp/screens/TabTwoScreen.tsx
View file @
6beb123f
import
{
StatusBar
}
from
'
expo-status-bar
'
;
import
{
StyleSheet
}
from
'
react-native
'
;
import
EditScreenInfo
from
'
../components/EditScreenInfo
'
;
...
...
@@ -6,6 +7,7 @@ import { Text, View } from '../components/Themed';
export
default
function
TabTwoScreen
()
{
return
(
<
View
style=
{
styles
.
container
}
>
<
StatusBar
/>
</
View
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment