Commit d52dbbab authored by Devin B's avatar Devin B

add

parent 7074ec1c
......@@ -147,7 +147,7 @@ const AdditionalSymptomsScreen2 = ({ navigation }) => {
/>
<TouchableOpacity
style={styles.orButton}
onPress={() => Linking.openURL('https://mywebar.com/p/Project_0_ysb0ffrwxn')}>
onPress={() => Linking.openURL('https://mywebar.com/p/Project_4_lpf4ury2jc')}>
<Text style={styles.orButtonText}>OR Click This</Text>
</TouchableOpacity>
</View>
......
import React, { useState } from 'react';
import { View, StyleSheet, Image, TouchableOpacity, PermissionsAndroid, Text, ScrollView } from 'react-native';
import { View, StyleSheet, Image, TouchableOpacity, PermissionsAndroid, Text, ScrollView, ActivityIndicator } from 'react-native';
import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
import { COLORS, IMGS, ROUTES } from '../../../constants';
import Button from '../../../components/Button';
......@@ -10,7 +10,7 @@ const Camera = ({ navigation }) => {
const [galleryPhoto, setGalleryPhoto] = useState();
const REACT_APP_API_URL='https://us-central1-skin-condition-detection.cloudfunctions.net/predict';
const [prediction, setPrediction] = useState(null);
const [loading, setLoading] = useState(false);
const [photo, setPhoto] = useState(null);
......@@ -128,13 +128,20 @@ const Camera = ({ navigation }) => {
</View>
<Text style={styles.descriptionText}>'Use phone camera or select a photo from the gallery that clearly shows your skin.'</Text>
<View style={styles.bottomContainer}>
{loading ? (
<View style={styles.loaderContainer}>
<ActivityIndicator size="large" color={COLORS.primary} />
</View>
) : (
<>
{!prediction && (
<>
<Text style={styles.resultsHeading}>Results will appear below</Text>
</>
)}
{prediction && (
{!loading && prediction && (
<View style={styles.predictionContainer}>
<Text style={styles.predictionText}>Diagnosed Condition | හඳුනාගත් සමේ ආසාදනය: {prediction.class}</Text>
<Text style={styles.predictionText}>How sure are we | නිරවද්යතාව: {prediction.confidence}</Text>
......@@ -145,6 +152,8 @@ const Camera = ({ navigation }) => {
style={styles.nextButton}
onPress={handleContinue}
/>
</>
)}
</View>
</View>
);
......@@ -299,6 +308,11 @@ const styles = StyleSheet.create({
alignSelf: 'center',
marginVertical: 20, // Adjust margin as needed
},
loaderContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
......
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