Commit 4d356d8d authored by Malsha Jayakody's avatar Malsha Jayakody

merge all components

parent 875f4af0
......@@ -14807,7 +14807,7 @@
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
"devOptional": true,
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
......
......@@ -9,7 +9,7 @@ export default {
gray: '#666666',
grayLight: '#ccc',
black: '#0a0a0a',
blue:'#ADC4CE',
blue: '#ADC4CE',
navyBlue: '#000080',
purple: '#DFCCFB',
light_purple: '#D9ACF5',
......@@ -20,4 +20,5 @@ export default {
pastalBlue: '#D2E9E9',
purple_new: '#AC87C5',
pink_new: '#FF8080',
pastal_blue: '#7469B6',
};
......@@ -38,9 +38,9 @@ function BottomTabNavigator() {
);
} else if (route.name === ROUTES.SKIN_WELCOME) {
return focused ? (
<Icon name="home" size={22} color={color} />
<Icon name="pulse-sharp" size={22} color={color} />
) : (
<Icon name="home-outline" size={22} color={color} />
<Icon name="pulse-outline" size={22} color={color} />
);
} else if (route.name === ROUTES.EXERCISE_HOME) {
return focused ? (
......@@ -115,9 +115,9 @@ const styles = StyleSheet.create({
backgroundColor: 'rgba(255,255,255,0.1)',
borderTopWidth: 0,
borderColor: COLORS.white,
bottom: 5,
right: 10,
left: 10,
bottom: 0,
right: 0,
left: 0,
height: 58,
},
mr7: {
......
......@@ -8,58 +8,98 @@ import {
TouchableOpacity,
KeyboardAvoidingView,
ScrollView,
ToastAndroid
ToastAndroid,
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import { COLORS, ROUTES } from '../../constants';
import {COLORS, ROUTES} from '../../constants';
import Logo from '../../assets/icons/mother.svg';
import { Formik } from 'formik';
import { signup } from '../../services/auth/index';
import {Formik} from 'formik';
import {signup} from '../../services/auth/index';
const Register = ({ navigation }) => {
const onSubmit = async (values) => {
let respond = await signup(values.name, values.password, values.email, values.age, values.week);
console.log("dataset3",respond.data)
if(respond.data.success === true){
console.log("dataset")
navigation.navigate(ROUTES.HOME)
const Register = ({navigation}) => {
const onSubmit = async values => {
let respond = await signup(
values.name,
values.password,
values.email,
values.age,
values.week,
);
console.log('dataset3', respond.data);
if (respond.data.success === true) {
console.log('dataset');
navigation.navigate(ROUTES.HOME);
ToastAndroid.show('Login success', ToastAndroid.SHORT);
}
else{
} else {
ToastAndroid.show('Network or details not clear !', ToastAndroid.SHORT);
}
};
return (
<KeyboardAvoidingView style={{ flex: 1 }}>
<ScrollView contentContainerStyle={{ flexGrow: 1 }} bounces={false}>
<KeyboardAvoidingView style={{flex: 1}}>
<ScrollView contentContainerStyle={{flexGrow: 1}} bounces={false}>
<View style={styles.container}>
<View style={styles.wFull}>
<Formik
initialValues={{ email: '', password: '', name: '', age: '', week: '' }}
onSubmit={values => onSubmit(values)}
>
{({ handleChange, handleBlur, handleSubmit, values }) => (
initialValues={{
email: '',
password: '',
name: '',
age: '',
week: '',
}}
onSubmit={values => onSubmit(values)}>
{({handleChange, handleBlur, handleSubmit, values}) => (
<>
<View style={styles.row}>
<Logo width={55} height={55} style={styles.mr7} />
<Text style={styles.brandName}>EmidWife</Text>
</View>
<Text style={styles.loginContinueTxt}>Register to continue</Text>
<TextInput style={styles.input} placeholder="Name" onChangeText={handleChange('name')} value={values.name} />
<TextInput style={styles.input} placeholder="Email" onChangeText={handleChange('email')} value={values.email} />
<TextInput style={styles.input} placeholder="Password" onChangeText={handleChange('password')} value={values.password} />
<TextInput style={styles.input} placeholder="Age" onChangeText={handleChange('age')} value={values.age} />
<TextInput style={styles.input} placeholder="Week" onChangeText={handleChange('week')} value={values.week} />
<Text style={styles.loginContinueTxt}>
Register to continue
</Text>
<TextInput
style={styles.input}
placeholder="Name"
onChangeText={handleChange('name')}
value={values.name}
/>
<TextInput
style={styles.input}
placeholder="Email"
onChangeText={handleChange('email')}
value={values.email}
/>
<TextInput
style={styles.input}
placeholder="Password"
onChangeText={handleChange('password')}
value={values.password}
/>
<TextInput
style={styles.input}
placeholder="Age"
onChangeText={handleChange('age')}
value={values.age}
/>
<TextInput
style={styles.input}
placeholder="Week"
onChangeText={handleChange('week')}
value={values.week}
/>
<View style={styles.loginBtnWrapper}>
<LinearGradient
colors={[COLORS.gradientForm, COLORS.bgColor]}
colors={[COLORS.gradientForm, COLORS.bgColor]}
style={styles.linearGradient}
start={{ y: 0.0, x: 0.0 }}
end={{ y: 1.0, x: 0.0 }}>
<TouchableOpacity activeOpacity={0.7} style={styles.loginBtn} onPress={handleSubmit}>
start={{y: 0.0, x: 0.0}}
end={{y: 1.0, x: 0.0}}>
<TouchableOpacity
activeOpacity={0.7}
style={styles.loginBtn}
onPress={handleSubmit}>
<Text style={styles.loginText}>Sign Up</Text>
</TouchableOpacity>
</LinearGradient>
......@@ -114,6 +154,7 @@ const styles = StyleSheet.create({
borderRadius: 12,
height: 45,
paddingVertical: 0,
color: COLORS.black,
},
// Login Btn Styles
loginBtnWrapper: {
......
......@@ -27,7 +27,9 @@ const GameLevelPage = ({route, navigation}) => {
</View>
<View style={styles.diamondContainer}>
<View style={styles.innerCircle}>
<Text style={styles.scoreText}>{predictedGameLevel}</Text>
<Text style={styles.scoreText}>
{predictedGameLevel === 0 ? '2' : predictedGameLevel}
</Text>
</View>
</View>
<TouchableOpacity
......
......@@ -152,6 +152,7 @@ const MainDetailsFormInSinhala = ({navigation}) => {
onChangeText={text => setAge(text)} // Use setAge for the age field
keyboardType="numeric" // Set keyboardType appropriately
value={age}
required
/>
</View>
<View style={{marginTop: 15}}>
......@@ -243,7 +244,7 @@ const MainDetailsFormInSinhala = ({navigation}) => {
value={previousChildBirthExperiences}
/>
</View>
<View style={{marginTop: 55}}>
<View style={{marginTop: 35}}>
<TouchableOpacity
style={{
backgroundColor: COLORS.normal_purple,
......
This diff is collapsed.
......@@ -39,7 +39,7 @@ const QuizOptionsPage = ({navigation}) => {
<Text
style={{
display: 'flex',
color: '#DC143C',
color: COLORS.navyBlue,
fontSize: 20,
fontWeight: 'bold',
marginBottom: 25,
......@@ -87,7 +87,7 @@ const QuizOptionsPage = ({navigation}) => {
<View style={{marginTop: 40}}>
<TouchableOpacity
style={{
backgroundColor: COLORS.pink_new,
backgroundColor: COLORS.pastal_blue,
height: 50,
marginBottom: 20,
justifyContent: 'center',
......@@ -108,7 +108,7 @@ const QuizOptionsPage = ({navigation}) => {
<View style={{marginTop: 7}}>
<TouchableOpacity
style={{
backgroundColor: COLORS.pink_new,
backgroundColor: COLORS.pastal_blue,
height: 50,
justifyContent: 'center',
alignItems: 'center',
......
......@@ -41,7 +41,6 @@ const QuizScoreDisplayPage = ({route, navigation}) => {
const musicKeys = Object.keys(musicFields);
const randomIndex = Math.floor(Math.random() * musicKeys.length);
musicFields[musicKeys[randomIndex]] = 1;
console.log(musicFields, 'musicFields');
try {
const response = await gameLevelPredict(
formData.age, // Assuming formData contains 'age'
......@@ -60,27 +59,7 @@ const QuizScoreDisplayPage = ({route, navigation}) => {
musicFields.music_name_e,
musicFields.music_name_f,
);
console.log(formData.age, 'age');
console.log(formData.depression_level, 'depression_level');
console.log(
formData.previous_child_birth_experiences,
'previous_child_birth_experiences',
);
console.log(formData.marital_status_divorced, 'marital_status_divorced');
console.log(formData.marital_status_married, 'marital_status_married');
console.log(formData.marital_status_single, 'marital_status_single');
console.log(formData.family_background_bad, 'family_background_bad');
console.log(formData.family_background_good, 'family_background_good');
console.log(
formData.family_background_normal,
'family_background_normal',
);
console.log(musicFields.music_name_a, 'a');
console.log(musicFields.music_name_b, 'b');
console.log(musicFields.music_name_c, 'c');
console.log(musicFields.music_name_d, 'd');
console.log(musicFields.music_name_e, 'e');
console.log(musicFields.music_name_f, 'f');
console.log(response.data.prediction, 'response.data.prediction');
if (response && response.data && response.data.prediction) {
console.log('API call successful with response:', response.data);
const predictedGameLevel = parseInt(
......
......@@ -17,8 +17,8 @@ const WelcomePageGame = ({navigation}) => {
<Image
source={IMGS.game_img_1}
style={{
height: 400,
width: 210,
height: 360,
width: 190,
borderRadius: 20,
position: 'absolute',
top: 2,
......@@ -36,7 +36,7 @@ const WelcomePageGame = ({navigation}) => {
style={{
paddingHorizontal: 22,
position: 'absolute',
top: 450,
top: 410,
width: '100%',
}}>
<Text
......
......@@ -179,6 +179,7 @@ const Game02Level01 = ({navigation, route}) => {
},
},
]);
backgroundMusic.current.setVolume(0.0);
}
}, 0);
} else {
......
......@@ -110,6 +110,7 @@ const CravingsPuzzleGame02Level02 = ({navigation}) => {
},
},
]);
backgroundMusic.current.setVolume(0.0);
}
}, 0);
} else {
......
......@@ -151,6 +151,7 @@ const PuzzleGame02Level03 = ({navigation}) => {
},
},
]);
backgroundMusic.current.setVolume(0.0);
setGuess([]);
} else {
Alert.alert('Try Again', "That's not a match. Keep trying!");
......
......@@ -110,6 +110,7 @@ const Game02Level04 = ({navigation}) => {
},
},
]);
backgroundMusic.current.setVolume(0.0);
}
} else if (foundLadyItem) {
Alert.alert('Oops!', "This is a lady's item. Try again!", [
......@@ -259,7 +260,7 @@ const styles = StyleSheet.create({
button: {
padding: 10,
backgroundColor: '#056676',
// marginBottom: 75,
borderRadius: 5,
},
playerImage: {
width: '100%', // Adjust as needed
......@@ -289,10 +290,10 @@ const styles = StyleSheet.create({
top: 1,
},
buttonLeft: {
left: 200,
left: 130,
},
buttonRight: {
right: 70,
right: 130,
},
buttonDown: {
bottom: 1,
......
......@@ -111,6 +111,7 @@ const Game02Level05 = ({navigation}) => {
},
},
]);
backgroundMusic.current.setVolume(0.0);
}
} else if (foundLadyItem) {
Alert.alert('Oops!', "This is a lady's item. Try again!", [
......@@ -259,7 +260,7 @@ const styles = StyleSheet.create({
button: {
padding: 10,
backgroundColor: '#046582',
// marginBottom: 75,
borderRadius: 5,
},
playerImage: {
width: '100%', // Adjust as needed
......@@ -289,10 +290,10 @@ const styles = StyleSheet.create({
top: 1,
},
buttonLeft: {
left: 200,
left: 140,
},
buttonRight: {
right: 70,
right: 140,
},
buttonDown: {
bottom: 1,
......
......@@ -114,6 +114,7 @@ const Game02Level06 = ({navigation}) => {
},
},
]);
backgroundMusic.current.setVolume(0.0);
}
} else if (foundLadyItem) {
Alert.alert('Oops!', "This is a lady's item. Try again!", [
......@@ -261,8 +262,8 @@ const styles = StyleSheet.create({
},
button: {
padding: 10,
backgroundColor: '#056676',
// marginBottom: 75,
backgroundColor: '#554994',
borderRadius: 5,
},
playerImage: {
width: '100%', // Adjust as needed
......@@ -292,10 +293,10 @@ const styles = StyleSheet.create({
top: 1,
},
buttonLeft: {
left: 200,
left: 130,
},
buttonRight: {
right: 70,
right: 130,
},
buttonDown: {
bottom: 1,
......
......@@ -111,7 +111,15 @@ const Game02Level07 = ({navigation}) => {
// Check if two baby items have been collected
if (collectedItems.length + 1 >= 4) {
Alert.alert('Congratulations 🥳🥳! You won the game.');
Alert.alert('Congratulations 🥳🥳! You won the game.', [
{
text: 'OK',
onPress: () => {
navigation.navigate(ROUTES.Game02ProgressLevel02);
},
},
]);
backgroundMusic.current.setVolume(0.0);
}
} else if (foundLadyItem) {
Alert.alert('Oops!', "This is a lady's item. Try again!", [
......@@ -227,10 +235,10 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
gameBoard: {
width: 370,
height: 420,
width: 360,
height: 400,
borderWidth: 2,
marginBottom: 10,
marginBottom: 5,
backgroundColor: '#003333',
borderColor: 'white',
},
......@@ -256,7 +264,7 @@ const styles = StyleSheet.create({
button: {
padding: 10,
backgroundColor: '#056676',
// marginBottom: 15,
borderRadius: 5,
},
playerImage: {
width: '100%', // Adjust as needed
......@@ -286,10 +294,10 @@ const styles = StyleSheet.create({
top: 1,
},
buttonLeft: {
left: 200,
left: 130,
},
buttonRight: {
right: 70,
right: 130,
},
buttonDown: {
bottom: 1,
......
import axios from "axios";
const BASE_PATH = 'http://10.0.2.2:8070/api/mother';
import axios from 'axios';
const BASE_PATH = 'http://16.16.97.48/api/mother';
import AsyncStorage from '@react-native-async-storage/async-storage';
//signIn API Call
export let signin = async (email, password) => {
try {
let value = await axios.post(BASE_PATH + '/login', {
email: email,
password: password,
})
console.log("data1", value.data)
if (value.data.success === true) {
await AsyncStorage.setItem('userData', JSON.stringify(value.data.data));
console.log("data")
}
return value;
} catch (error) {
return error
try {
let value = await axios.post(BASE_PATH + '/login', {
email: email,
password: password,
});
console.log('data1', value.data);
if (value.data.success === true) {
await AsyncStorage.setItem('userData', JSON.stringify(value.data.data));
console.log('data');
}
}
return value;
} catch (error) {
return error;
}
};
//signIn API Call
export let signup = async (name, password, email, age, week) => {
try {
let value = await axios.post(BASE_PATH + '/add_mother', {
name: name,
password: password,
email: email,
age: age,
week: week,
})
console.log("data1", value.data)
if (value.data.success === true) {
await AsyncStorage.setItem('userData', JSON.stringify(value.data.data));
console.log("data")
}
return value;
} catch (error) {
return error
try {
let value = await axios.post(BASE_PATH + '/add_mother', {
name: name,
password: password,
email: email,
age: age,
week: week,
});
console.log('data1', value.data);
if (value.data.success === true) {
await AsyncStorage.setItem('userData', JSON.stringify(value.data.data));
console.log('data');
}
}
\ No newline at end of file
return value;
} catch (error) {
return error;
}
};
import axios from 'axios';
// const BASE_PATH = 'http://10.0.2.2:8000';
const BASE_PATH = 'http://172.104.34.100:8000/';
const BASE_PATH = 'http://172.104.34.100:8000';
import AsyncStorage from '@react-native-async-storage/async-storage';
//initialize payment API Call
......
......@@ -7497,7 +7497,7 @@ typed-array-length@^1.0.6:
is-typed-array "^1.1.13"
possible-typed-array-names "^1.0.0"
"typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=4.9.5, typescript@5.0.4:
typescript@5.0.4:
version "5.0.4"
resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
......
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