Commit b206dcc7 authored by Balasooriya B.M.D.D's avatar Balasooriya B.M.D.D

Merge branch 'ALL_UI_4' into 'master'

CSS modification

See merge request !26
parents 1604dc76 867e14b2
......@@ -6,7 +6,7 @@ import { StyleSheet, Text, View } from 'react-native';
import registerNNPushToken from 'native-notify';
import TabNavigator from "./navigation/TabNavigator";
import UsImage from "./screens/CaptureImage";
import US 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="UsImage" component={UsImage} />
<Stack.Screen name="US" component={US} />
<Stack.Screen name="Prescription" component={Prescription} />
<Stack.Screen name="Sidebar" component={Sidebar} />
<Stack.Screen name="ChatbotScreen" component={ChatbotScreen} />
......
......@@ -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>
......
......@@ -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>
......
......@@ -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' ? 'https://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 = 'https://planpredictdeploy.azurewebsites.net/predict'; // Replace with the actual API endpoint URL of the other model
axios
.post(apiUrl, {
......
......@@ -12,7 +12,7 @@ const Sidebar = () => {
if (tabIndex === 0) {
navigation.navigate("UserProfile");
}if (tabIndex === 1){
navigation.navigate("MedHome");
navigation.navigate("MedicineWelcome");
}if (tabIndex === 2){
navigation.navigate("WelcomeScreen");
}if (tabIndex === 3){
......
......@@ -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/signup.png")} resizeMode="cover" style={styles.image}>
<ImageBackground source={require("../assets/signNew.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} />
......
......@@ -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.signin} onPress={handleSignIn} />
<Button title="Sign In" style={styles.actionButton} onPress={handleSignIn} />
</View>
</View>
......@@ -164,7 +168,7 @@ const styles = StyleSheet.create({
borderWidth: 1,
borderColor: 'gray',
padding: 10,
marginBottom: 20,
marginBottom: 10,
},
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
......@@ -8,7 +8,7 @@ export default function USWelcome () {
const navigation = useNavigation();
const navigateToUS = () => {
navigation.navigate("UsImage");
navigation.navigate("Us");
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment