Skip to content

Commit

Permalink
ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CccGm committed Dec 29, 2023
1 parent b283423 commit 74c581d
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 46 deletions.
47 changes: 26 additions & 21 deletions src/assets/data/Contects.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,62 @@
[
{
"user_id": "1",
"user_name": "User1",
"user_display_name": "User 1"
"user_name": "Dhoni",
"user_display_name": "Dhoni Sharma",
"password": "Dhoni@123"
},
{
"user_id": "2",
"user_name": "User2",
"user_display_name": "User 2"
"user_name": "Varma",
"user_display_name": "Varma Shah",
"password": "Varma@123"
},
{
"user_id": "3",
"user_name": "User3",
"user_display_name": "Elon Musk"
"user_name": "Mehul",
"user_display_name": "Mehul Bhil",
"password": "Mehul@123"
},
{
"user_id": "4",
"user_name": "jobs",
"user_display_name": "Steve Jobs"
"user_display_name": "Steve Jobs",
"password": "User1111"
},
{
"user_id": "5",
"user_name": "joe",
"user_display_name": "Joe"
"user_name": "Urav",
"user_display_name": "Urav Katrodiya",
"password": "Urav@123"
},
{
"user_id": "6",
"user_name": "peter",
"user_display_name": "Peter"
"user_name": "Peter",
"user_display_name": "Peter Parkar",
"password": "Peter@123"
},
{
"user_id": "7",
"user_name": "lilnas",
"user_display_name": "Lil Nas"
"user_name": "GMs",
"user_display_name": "Mated",
"password": "GMs@123"
},
{
"user_id": "8",
"user_name": "Lukas",
"user_display_name": "Lukas"
"user_display_name": "Lukas Das",
"password": "Lukas@123"
},
{
"user_id": "9",
"user_name": "Yuri",
"user_display_name": "Yuri Gagarin"
"user_display_name": "Yuri Gagarin",
"password": "Yuri@123"
},
{
"user_id": "10",
"user_name": "David",
"user_display_name": "David Dobrik"
},
{
"user_id": "11",
"user_name": "Logan",
"user_display_name": "Logan Paul"
"user_display_name": "David Dobrik",
"password": "David@123"
}
]
42 changes: 25 additions & 17 deletions src/screens/CallingScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import CallActionBox from '../../components/CallActionBox';
import Iconics from 'react-native-vector-icons/Ionicons';
import {useNavigation, useRoute} from '@react-navigation/native';
import {Voximplant} from 'react-native-voximplant';
import CallActionBox from '../../components/CallActionBox';

const CallingScreen = () => {
const navigation = useNavigation();
Expand All @@ -36,7 +36,11 @@ const CallingScreen = () => {
};

const onHangUpPress = () => {
call.current.hangup();
try {
call.current.hangup();
} catch (error) {
console.log('error', error);
}
};

useEffect(() => {
Expand Down Expand Up @@ -140,10 +144,14 @@ const CallingScreen = () => {
}

return () => {
call.current.off(Voximplant.CallEvents.Failed);
call.current.off(Voximplant.CallEvents.ProgressToneStart);
call.current.off(Voximplant.CallEvents.Connected);
call.current.off(Voximplant.CallEvents.Disconnected);
try {
call.current.off(Voximplant.CallEvents.Failed);
call.current.off(Voximplant.CallEvents.ProgressToneStart);
call.current.off(Voximplant.CallEvents.Connected);
call.current.off(Voximplant.CallEvents.Disconnected);
} catch (error) {
console.log('error', error);
}
};
}, [permissionGranted]);

Expand All @@ -163,10 +171,12 @@ const CallingScreen = () => {
style={styles.localVideo}
/>

<View style={styles.cameraPreview}>
<Text style={styles.name}>{user?.user_display_name}</Text>
<Text style={styles.phoneNumber}>{callStatus}</Text>
</View>
{callStatus == 'Connected' ? null : (
<View style={styles.cameraPreview}>
<Text style={styles.name}>{user?.user_display_name}</Text>
<Text style={styles.phoneNumber}>{callStatus}</Text>
</View>
)}
<CallActionBox onHangUp={onHangUpPress} />
</View>
);
Expand Down Expand Up @@ -203,15 +213,13 @@ const styles = StyleSheet.create({
left: 20,
},
localVideo: {
width: 100,
height: 150,
backgroundColor: '#ffff6e',

borderRadius: 10,

position: 'absolute',
right: 10,
top: 100,
left: 0,
right: 0,
top: '50%',
bottom: 30,
},
remoteVideo: {
backgroundColor: '#7b4e80',
Expand All @@ -220,7 +228,7 @@ const styles = StyleSheet.create({
left: 0,
right: 0,
top: 0,
bottom: 0,
bottom: '50%',
},
});

Expand Down
10 changes: 9 additions & 1 deletion src/screens/ContactsScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ const ContactsScreen = () => {
data={filterContacts}
renderItem={({item}) => (
<TouchableOpacity onPress={() => callUser(item)}>
<Text style={styles.contactName}>{item.user_display_name}</Text>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
paddingHorizontal: 20,
}}>
<Text style={styles.contactName}>{item.user_display_name}</Text>
<Text style={styles.contactName}>{item.password}</Text>
</View>
</TouchableOpacity>
)}
ItemSeparatorComponent={() => <View style={styles.seprator} />}
Expand Down
8 changes: 6 additions & 2 deletions src/screens/IncomingCallScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const IncomingCallScreen = () => {
});

return () => {
call.off(Voximplant.CallEvents.Disconnected);
try {
call.off(Voximplant.CallEvents.Disconnected);
} catch (error) {
console.log(error, 'error');
}
};
}, []);

Expand Down Expand Up @@ -88,7 +92,7 @@ const styles = StyleSheet.create({
},
phoneNumber: {fontSize: 20, color: 'white'},
bg: {
backgroundColor: 'red',
backgroundColor: '#e2e1e1',
flex: 1,
alignItems: 'center',
padding: 10,
Expand Down
5 changes: 0 additions & 5 deletions src/screens/LoginScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const LoginScreen = () => {
} else if (state === Voximplant.ClientState.LOGGED_IN) {
redirectHome();
}
console.log(state);
// let authResult = await client.login("userName", "password");
} catch (e) {
console.log(e.name + e.message);
}
Expand All @@ -40,10 +38,8 @@ const LoginScreen = () => {

try {
const data = await client.login(fqUserName, password);
console.log(data, 'login time');
redirectHome();
} catch (error) {
console.log('login error => ', error);
Alert.alert('AuthResult', 'ErrorCode ' + error.code);
}
};
Expand Down Expand Up @@ -86,7 +82,6 @@ const Styles = StyleSheet.create({
page: {
padding: 10,
alignItems: 'stretch',
// backgroundColor: 'red',
flex: 1,
justifyContent: 'center',
},
Expand Down

0 comments on commit 74c581d

Please sign in to comment.