Skip to content

Commit

Permalink
Merge pull request #3 from GhitaLoukili/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
RitaSensei authored Jun 7, 2024
2 parents a8715e6 + 5bf8345 commit 9e9075a
Show file tree
Hide file tree
Showing 17 changed files with 616 additions and 451 deletions.
6 changes: 6 additions & 0 deletions careconnect/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export default {
photosPermission: "The app accesses your photos",
},
],
[
"expo-av",
{
microphonePermission: "Allow $(PRODUCT_NAME) to access your microphone."
}
],
[
"expo-document-picker",
{
Expand Down
4 changes: 2 additions & 2 deletions careconnect/components/PickerComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export const PickerComponent = ({
}}
fieldType="filter"
items={item.options.map(option => ({
value:option.value,
value:option.label,
label:option.label,
disabled:option.disabled,
style:{
color: option.value === item.nativePickerValue ? "#ff0000" : "#000000",
},
multiline
// multiline
}))}
/>
{index === 0 && (
Expand Down
30 changes: 12 additions & 18 deletions careconnect/components/ProfilesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const renderProfile = ({ item }) => (
>
<View style={styles.cardCover}>
<Card.Cover
source={item.profilepic}
source={{ uri: item.profilePhotoUrl }}
style={{
width: 120,
height: 120,
Expand All @@ -28,14 +28,20 @@ export const renderProfile = ({ item }) => (
<View>
<Card.Content style={styles.cardContent}>
<Paragraph style={styles.nannyName}>
<Text>{item.name[1]}</Text>
<Text>{item.firstName} {item.lastName}</Text>
</Paragraph>
<Paragraph style={styles.nannyInformations}>
<Text style={{ color: "#000" }}>{item.nationality[1]}</Text> {" | "}{" "}
<Text style={{ color: "#000" }}>{item.experience[1]}</Text>
<Text style={{ color: "#000" }}>{item.nationality}</Text> {" | "}{" "}
<Text style={{ color: "#000" }}>{item.yearsOfExperience}</Text>
</Paragraph>
<Paragraph style={styles.nannyInformations}>
<Text style={{ color: "#000" }}>{item["desired position"][1]}</Text>
{"Desired position : "}
{item.desiredPosition.map((position, index) => (
<Text key={index} style={{ color: "#000" }}>
{position}
{index < item.desiredPosition.length - 1 ? ", " : ""}
</Text>
))}
</Paragraph>
<View style={{ flexDirection: "row", alignItems: "center", marginTop: 5 }}>
<MaterialIcons name="place" size={18} color="#FA89B8" />
Expand All @@ -48,19 +54,7 @@ export const renderProfile = ({ item }) => (
marginRight: 20,
}}
>
{item["location"][1]}
</Text>
<FontAwesome6 name="coins" size={16} color="#FA89B8" />
<Text
style={{
fontFamily: "FiraSansRegular",
fontSize: 13,
color: "#000",
textAlign: "center",
marginLeft: 5,
}}
>
{item["desired salary"][1]}
{item.currentCity}
</Text>
</View>
</Card.Content>
Expand Down
39 changes: 15 additions & 24 deletions careconnect/components/ProfilesSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export const renderProfile = ({ item }) => (
alignItems: "center",
flexDirection: "row",
flex: 1,
width: 200,
width: 220,
}}
>
<View style={styles.cardCover}>
<Card.Cover
source={item.profilepic}
source={{ uri: item.profilePhotoUrl}}
style={{
// aspectRatio: 0.4,
width: 80,
Expand All @@ -27,49 +27,40 @@ export const renderProfile = ({ item }) => (
// overflow: "hidden",
}}
/>
<View style={{ flexDirection: "row", alignItems: "center", left: 5, top: 8, width: 90 }}>
<FontAwesome6 name="coins" size={16} color="#B272A4" />
<Text
style={{
fontFamily: "FiraSansRegular",
fontSize: 11,
color: "#000",
textAlign: "center",
marginLeft: 5,
}}
>
{item["desired salary"][1]}
</Text>
</View>
<View style={{ flexDirection: "row", alignItems: "center", left: 5, top: 15, width: 90 }}>
<View style={{ flexDirection: "row", alignItems: "center", left: 0, top: 8, width: 90 }}>
<MaterialIcons name="place" size={16} color="#B272A4" />
<Text
style={{
fontFamily: "FiraSansRegular",
fontSize: 11,
color: "#000",
textAlign: "center",
marginLeft: 5,
marginLeft: 2,
}}
>
{item["location"][1]}
{item.currentCity}
</Text>
</View>
</View>
<View>
<Card.Content style={styles.cardContent}>
<Paragraph style={styles.nannyName}>
<Text>{item.name[1]}</Text>
<Text>{item.firstName} {item.lastName}</Text>
</Paragraph>
<Paragraph style={styles.nannyInformations}>
{item.nationality[0]} : <Text style={{ color: "#000" }}>{item.nationality[1]}</Text>
{"Nationality : "}<Text style={{ color: "#000" }}>{item.nationality}</Text>
</Paragraph>
<Paragraph style={styles.nannyInformations}>
{item.experience[0]} : <Text style={{ color: "#000" }}>{item.experience[1]}</Text>
{"Experience : "}<Text style={{ color: "#000" }}>{item.yearsOfExperience}</Text>
</Paragraph>
<Paragraph style={styles.nannyInformations}>
{item["desired position"][0]} :{" "}
<Text style={{ color: "#000" }}>{item["desired position"][1]}</Text>
{"Desired position : "}
{item.desiredPosition.map((position, index) => (
<Text key={index} style={{ color: "#000" }}>
{position}
{index < item.desiredPosition.length - 1 ? ", " : ""}
</Text>
))}
</Paragraph>
</Card.Content>
</View>
Expand Down
16 changes: 10 additions & 6 deletions careconnect/firebase/firebaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ import Constants from 'expo-constants';
import { initializeApp } from "firebase/app";
import { getAuth,initializeAuth, getReactNativePersistence } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
import { getStorage } from 'firebase/storage';
import ReactNativeAsyncStorage from '@react-native-async-storage/async-storage';

const firebaseConfig = {
apiKey: "AIzaSyBLRzR4uqoeO7Uc6pOA-3uTNx1PhxL-bb0",
authDomain: "careconnect-66481.firebaseapp.com",
projectId: "66481",
projectId: "careconnect-66481",
storageBucket: "careconnect-66481.appspot.com",
messagingSenderId: "9285222114",
appId: "1:9285222114:web:631966364d7e7650d268bb",
appId: "1:9285222114:web:631966364d7e7650d268bb"
};

// Initialize Firebase, Firestore and authentication module
export const FIREBASE_APP = initializeApp(firebaseConfig);
export const FIREBASE_AUTH = initializeAuth(FIREBASE_APP, { persistence: getReactNativePersistence(ReactNativeAsyncStorage) });
export const FIRESTORE_DB = getFirestore(FIREBASE_APP);
export const FIREBASE_GET_AUTH = getAuth(FIREBASE_APP);
const FIREBASE_APP = initializeApp(firebaseConfig);
const FIREBASE_AUTH = initializeAuth(FIREBASE_APP, { persistence: getReactNativePersistence(ReactNativeAsyncStorage) });
const FIRESTORE_DB = getFirestore(FIREBASE_APP);
const FIREBASE_STORAGE = getStorage(FIREBASE_APP);
const FIREBASE_GET_AUTH = getAuth(FIREBASE_APP);

export { FIREBASE_APP, FIREBASE_AUTH, FIRESTORE_DB, FIREBASE_GET_AUTH, FIREBASE_STORAGE };
11 changes: 10 additions & 1 deletion careconnect/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions careconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"expo-splash-screen": "~0.27.4",
"expo-status-bar": "~1.12.1",
"expo-updates": "~0.25.15",
"firebase": "^10.10.0",
"firebase": "^10.12.2",
"firebase-admin": "^12.0.0",
"native-base": "^3.4.28",
"react": "18.2.0",
Expand All @@ -50,7 +50,8 @@
"react-native-ui-lib": "^7.20.3",
"react-native-vector-icons": "^10.0.3",
"react-native-web": "~0.19.6",
"react-navigation-header-buttons": "^11.2.1"
"react-navigation-header-buttons": "^11.2.1",
"expo-av": "~14.0.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
58 changes: 49 additions & 9 deletions careconnect/screens/creating account/nanny/NewAccountNanny1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as ImagePicker from "expo-image-picker";
import DateTimePickerModal from "react-native-modal-datetime-picker";
import { Picker } from "react-native-ui-lib";
import { Entypo, Ionicons } from "@expo/vector-icons";
import { allLocations, allNationalities } from "../../../utils/allOptions";

import styles from "../styles";
import { allLocations, allNationalities } from "../../../utils/allOptions";

const NewAccountNanny1Screen = ({ navigation }) => {
const [firstName, setFirstName] = useState("");
Expand All @@ -33,6 +33,7 @@ const NewAccountNanny1Screen = ({ navigation }) => {
nativePickerValue: "",
pickerOpen: false,
});

const [nationality, setNationality] = useState({
nationality: undefined,
nativePickerValue: "",
Expand Down Expand Up @@ -111,7 +112,7 @@ const NewAccountNanny1Screen = ({ navigation }) => {

const handleProfilePhoto = async () => {
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.All,
mediaTypes: ImagePicker.MediaTypeOptions.Images,
allowsEditing: true,
aspect: [4, 3],
quality: 1,
Expand All @@ -138,7 +139,49 @@ const NewAccountNanny1Screen = ({ navigation }) => {
!passwordError &&
!confirmPasswordError
) {
navigation.navigate("NewAccount", { screen: "Nanny New Account Page 2" });
navigation.navigate("NewAccount", {
screen: "Nanny New Account Page 2",
params: {
firstName,
lastName,
dateOfBirth: date.toISOString().split("T")[0],
nationality:nationality.nativePickerValue,
mobileNumber,
currentCity: currentCity.nativePickerValue,
profilePhoto,
email,
password
},
});

// Reset all fields
setFirstName("");
setLastName("");
setDate(new Date());
setMobileNumber("");
setProfilePhoto(null);
setEmail("");
setPassword("");
setConfirmedPassword("");
setCurrentCity({
location: undefined,
nativePickerValue: "",
pickerOpen: false,
});
setNationality({
nationality: undefined,
nativePickerValue: "",
pickerOpen: false,
});
setEmptyField(false);
setValidDateField(false);
setMobileNumberError(false);
setProfilePhotoError(false);
setEmailError(false);
setPasswordError(false);
setConfirmedPasswordError(false);
setSecureTextEntry(true);
setSecureTextEntryBeta(true);
} else {
const profilePhotoError = !profilePhoto; // Check if profile photo is empty
setEmptyField(true);
Expand Down Expand Up @@ -259,7 +302,7 @@ const NewAccountNanny1Screen = ({ navigation }) => {
}}
fieldType="filter"
items={allNationalities.map(option => ({
value: option.value,
value: option.label,
label: option.label,
disabled: option.disabled,
textStyle: {
Expand Down Expand Up @@ -317,7 +360,7 @@ const NewAccountNanny1Screen = ({ navigation }) => {
}}
fieldType="filter"
items={allLocations.map(option => ({
value:option.value,
value:option.label,
label:option.label,
disabled:option.disabled,
style:{
Expand Down Expand Up @@ -347,7 +390,7 @@ const NewAccountNanny1Screen = ({ navigation }) => {
) : (
emptyField &&
profilePhotoError && (
<Text style={styles.errorText}>Please upload your profile picture.</Text>
<Text style={styles.errorText}>Please upload your profile picture</Text>
)
)}
<View>
Expand Down Expand Up @@ -440,9 +483,6 @@ const NewAccountNanny1Screen = ({ navigation }) => {
buttonColor="#FA89B8"
textColor="#fff"
onPress={handleNext}
// onPress={() =>
// navigation.navigate("NewAccount", { screen: "Nanny New Account Page 2" })
// }
>
<Text style={styles.nextButtonText}>Next</Text>
</Button>
Expand Down
Loading

0 comments on commit 9e9075a

Please sign in to comment.