Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TMP-23-068
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
TMP-23-068
TMP-23-068
Commits
867e14b2
Commit
867e14b2
authored
Oct 31, 2023
by
Yasara19
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CSS modification
parent
1604dc76
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
24 deletions
+42
-24
App.js
App.js
+2
-2
assets/signNew.png
assets/signNew.png
+0
-0
screens/BMI.js
screens/BMI.js
+2
-0
screens/MedicineWelcome.js
screens/MedicineWelcome.js
+9
-1
screens/Nutrition.js
screens/Nutrition.js
+2
-2
screens/Sidebar.js
screens/Sidebar.js
+1
-1
screens/Signin.js
screens/Signin.js
+11
-11
screens/Signup.js
screens/Signup.js
+14
-6
screens/USWelcome.js
screens/USWelcome.js
+1
-1
No files found.
App.js
View file @
867e14b2
...
...
@@ -6,7 +6,7 @@ import { StyleSheet, Text, View } from 'react-native';
import
registerNNPushToken
from
'
native-notify
'
;
import
TabNavigator
from
"
./navigation/TabNavigator
"
;
import
U
sImage
from
"
./screens/CaptureImage
"
;
import
U
S
from
"
./screens/CaptureImage
"
;
import
Prescription
from
"
./screens/CapturePrescription
"
;
import
Sidebar
from
"
./screens/Sidebar
"
;
import
Nutrition
from
"
./screens/Nutrition
"
...
...
@@ -51,7 +51,7 @@ export default function App() {
>
<
Stack
.
Screen
name
=
"
TabNavigator
"
component
=
{
TabNavigator
}
/
>
<
Stack
.
Screen
name
=
"
Nutrition
"
component
=
{
Nutrition
}
/
>
<
Stack
.
Screen
name
=
"
U
sImage
"
component
=
{
UsImage
}
/
>
<
Stack
.
Screen
name
=
"
U
S
"
component
=
{
US
}
/
>
<
Stack
.
Screen
name
=
"
Prescription
"
component
=
{
Prescription
}
/
>
<
Stack
.
Screen
name
=
"
Sidebar
"
component
=
{
Sidebar
}
/
>
<
Stack
.
Screen
name
=
"
ChatbotScreen
"
component
=
{
ChatbotScreen
}
/
>
...
...
assets/signNew.png
0 → 100644
View file @
867e14b2
1.37 MB
screens/BMI.js
View file @
867e14b2
...
...
@@ -41,6 +41,7 @@ const BMI = () => {
placeholder
=
"
Enter Weight (in kg)
"
onChangeText
=
{
setWeight
}
keyboardType
=
"
numeric
"
required
/>
<
Text
style
=
{
styles
.
label
}
>
Height
<
/Text
>
<
TextInput
...
...
@@ -48,6 +49,7 @@ const BMI = () => {
placeholder
=
"
Enter Height (in cm)
"
onChangeText
=
{
setHeight
}
keyboardType
=
"
numeric
"
required
/>
<
TouchableOpacity
style
=
{
styles
.
button
}
onPress
=
{
navigateToBmiCalculator
}
>
<
Text
style
=
{
styles
.
buttonText
}
>
Calculate
BMI
<
/Text
>
...
...
screens/MedicineWelcome.js
View file @
867e14b2
...
...
@@ -11,6 +11,11 @@ export default function MedicineWelcome () {
navigation
.
navigate
(
"
Prescription
"
);
};
const
navigateToMedicineRecord
=
()
=>
{
navigation
.
navigate
(
"
MyMed
"
);
};
return
(
...
...
@@ -20,7 +25,10 @@ export default function MedicineWelcome () {
<
View
style
=
{
styles
.
actionButtons
}
>
<
TouchableOpacity
style
=
{
styles
.
actionButton
}
onPress
=
{
navigateToMedicine
}
>
<
Text
style
=
{
styles
.
buttonText
}
>
Medicine
Tracker
<
/Text
>
<
Text
style
=
{
styles
.
buttonText
}
>
Extract
Medicine
Names
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{[
styles
.
actionButton
,
{
marginTop
:
20
}]}
onPress
=
{
navigateToMedicineRecord
}
>
<
Text
style
=
{
styles
.
buttonText
}
>
My
Med
Records
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
...
...
screens/Nutrition.js
View file @
867e14b2
...
...
@@ -42,7 +42,7 @@ export default function Nutrition({ route }) {
name
:
'
image.jpg
'
,
});
const
apiUrl
=
reportType
===
'
CBC
'
?
'
http
://192.168.1.100:5004/extract_hemoglobin
'
:
'
http://192.168.1.100:5004
/extract_glucose
'
;
const
apiUrl
=
reportType
===
'
CBC
'
?
'
http
s://nutrtition-predict-1004-bd09336777f6.herokuapp.com/extract_hemoglobin
'
:
'
https://nutrtition-predict-1004-bd09336777f6.herokuapp.com
/extract_glucose
'
;
axios
.
post
(
apiUrl
,
formData
,
{
headers
:
{
...
...
@@ -77,7 +77,7 @@ export default function Nutrition({ route }) {
console
.
log
(
parseFloat
(
resultOGTT
));
console
.
log
(
parseFloat
(
bmi
));
const
apiUrl
=
'
http
://192.168.1.100:5005
/predict
'
;
// Replace with the actual API endpoint URL of the other model
const
apiUrl
=
'
http
s://planpredictdeploy.azurewebsites.net
/predict
'
;
// Replace with the actual API endpoint URL of the other model
axios
.
post
(
apiUrl
,
{
...
...
screens/Sidebar.js
View file @
867e14b2
...
...
@@ -12,7 +12,7 @@ const Sidebar = () => {
if
(
tabIndex
===
0
)
{
navigation
.
navigate
(
"
UserProfile
"
);
}
if
(
tabIndex
===
1
){
navigation
.
navigate
(
"
Med
H
ome
"
);
navigation
.
navigate
(
"
Med
icineWelc
ome
"
);
}
if
(
tabIndex
===
2
){
navigation
.
navigate
(
"
WelcomeScreen
"
);
}
if
(
tabIndex
===
3
){
...
...
screens/Signin.js
View file @
867e14b2
...
...
@@ -56,17 +56,13 @@ const SignIn = () => {
}
},
[
email
]);
const
handleSignIn
=
()
=>
{
// Implement your sign-in logic here
// Compare the provided email and password with data in the users array
//const user = users.find((user) => user.email === email && user.password === password);
console
.
log
(
'
Email entered:
'
,
email
);
console
.
log
(
'
Password entered:
'
,
password
);
const
user
=
users
.
find
((
user
)
=>
user
.
email
.
trim
()
===
email
.
trim
()
&&
user
.
password
===
password
);
if
(
user
)
{
if
(
email
&&
password
)
{
// Perform sign-in logic when both email and password are provided
console
.
log
(
'
Sign In successful
'
);
// Save the email to local storage
AsyncStorage
.
setItem
(
'
userEmail
'
,
email
)
.
then
(()
=>
{
...
...
@@ -75,14 +71,16 @@ const SignIn = () => {
.
catch
(
error
=>
{
console
.
error
(
'
Error saving email to local storage:
'
,
error
);
});
// After successful sign-in, navigate to the desired screen
navigation
.
navigate
(
'
TabNavigator
'
);
}
else
{
// If either email or password is missing, display an error message to the user
console
.
error
(
'
Invalid credentials
'
);
// Handle and display the error to the user
}
};
const
goToSignUp
=
()
=>
{
navigation
.
navigate
(
'
Signup
'
);
...
...
@@ -143,7 +141,7 @@ useEffect(() => {
<
ScrollView
contentContainerStyle
=
{
styles
.
scrollViewContent
}
>
<
View
style
=
{
styles
.
container
}
>
<
ImageBackground
source
=
{
require
(
"
../assets/sign
up
.png
"
)}
resizeMode
=
"
cover
"
style
=
{
styles
.
image
}
>
<
ImageBackground
source
=
{
require
(
"
../assets/sign
New
.png
"
)}
resizeMode
=
"
cover
"
style
=
{
styles
.
image
}
>
<
View
style
=
{
styles
.
overlay
}
>
<
View
style
=
{
styles
.
subcontainer
}
>
<
Text
style
=
{
styles
.
label
}
>
Email
<
/Text
>
...
...
@@ -152,6 +150,7 @@ useEffect(() => {
placeholder
=
"
Enter your email
"
value
=
{
email
}
onChangeText
=
{(
text
)
=>
setEmail
(
text
)}
required
/>
<
Text
style
=
{
styles
.
label
}
>
Password
<
/Text
>
...
...
@@ -161,6 +160,7 @@ useEffect(() => {
value
=
{
password
}
onChangeText
=
{(
text
)
=>
setPassword
(
text
)}
secureTextEntry
required
/>
<
View
style
=
{
styles
.
subcontainerbut
}
>
<
Button
title
=
"
Sign In
"
onPress
=
{
handleSignIn
}
/
>
...
...
screens/Signup.js
View file @
867e14b2
...
...
@@ -93,7 +93,8 @@ const Signup = ({ route }) => {
value
=
{
userName
}
onChangeText
=
{(
text
)
=>
setUserName
(
text
)}
maxLength
=
{
MAX_LENGTH
}
style
=
{
styles
.
input
}
style
=
{[
styles
.
input
,
{
width
:
300
}]}
required
/>
<
/View
>
<
View
style
=
{
styles
.
container
}
>
...
...
@@ -102,7 +103,8 @@ const Signup = ({ route }) => {
value
=
{
email
}
onChangeText
=
{(
text
)
=>
setEmail
(
text
)}
keyboardType
=
"
email-address
"
style
=
{
styles
.
input
}
style
=
{[
styles
.
input
,
{
width
:
300
}]}
required
/>
<
/View
>
<
View
style
=
{
styles
.
container
}
>
...
...
@@ -111,7 +113,8 @@ const Signup = ({ route }) => {
value
=
{
phone
}
onChangeText
=
{(
text
)
=>
setPhone
(
text
)}
keyboardType
=
"
numeric
"
style
=
{
styles
.
input
}
style
=
{[
styles
.
input
,
{
width
:
300
}]}
required
/>
<
/View
>
<
View
style
=
{
styles
.
container
}
>
...
...
@@ -119,14 +122,15 @@ const Signup = ({ route }) => {
placeholder
=
"
Password
"
value
=
{
password
}
onChangeText
=
{(
password
)
=>
setPassword
(
password
)}
style
=
{
styles
.
input
}
style
=
{[
styles
.
input
,
{
width
:
300
}]}
required
/>
<
/View
>
<
View
>
<
Button
title
=
"
Sign Up
"
onPress
=
{
saveUserData
}
/
>
<
/View
>
<
View
>
<
Button
title
=
"
Sign In
"
style
=
{
styles
.
signi
n
}
onPress
=
{
handleSignIn
}
/
>
<
Button
title
=
"
Sign In
"
style
=
{
styles
.
actionButto
n
}
onPress
=
{
handleSignIn
}
/
>
<
/View
>
<
/View
>
...
...
@@ -164,7 +168,7 @@ const styles = StyleSheet.create({
borderWidth
:
1
,
borderColor
:
'
gray
'
,
padding
:
10
,
marginBottom
:
2
0
,
marginBottom
:
1
0
,
},
body
:
{
flex
:
1
,
...
...
@@ -177,6 +181,10 @@ const styles = StyleSheet.create({
color
:
"
#633974
"
,
fontWeight
:
'
bold
'
,
},
actionButton
:{
marginTop
:
20
}
,
});
export
default
Signup
;
\ No newline at end of file
screens/USWelcome.js
View file @
867e14b2
...
...
@@ -8,7 +8,7 @@ export default function USWelcome () {
const
navigation
=
useNavigation
();
const
navigateToUS
=
()
=>
{
navigation
.
navigate
(
"
Us
Image
"
);
navigation
.
navigate
(
"
Us
"
);
};
...
...
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