Matheo Bonucia
4 months ago
13 changed files with 1669 additions and 2326 deletions
@ -1,11 +1,15 @@
|
||||
import { View, Text, Image } from 'react-native'; |
||||
import {View, Text, Image} from 'react-native'; |
||||
|
||||
function Logo({ estilo }) { |
||||
return ( |
||||
<View> |
||||
{/* Aplicando o estilo ao componente Image */} |
||||
<Image resizeMode='contain' style={estilo.logo} source={require('./src/simplesip.png')} /> |
||||
</View> |
||||
); |
||||
} |
||||
export default Logo; |
||||
function Logo() { |
||||
return ( |
||||
<View> |
||||
{/* Aplicando o estilo ao componente Image */} |
||||
<Image |
||||
resizeMode="center" |
||||
style={{paddingHorizontal: 10, width: 280, height: 80}} |
||||
source={require('./src/simplesip.png')} |
||||
/> |
||||
</View> |
||||
); |
||||
} |
||||
export default Logo; |
||||
|
@ -0,0 +1,93 @@
|
||||
import {StyleSheet} from 'react-native'; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
flex: 1, |
||||
width: '100%', |
||||
height: '100%', |
||||
justifyContent: 'center', |
||||
padding: 16, |
||||
backgroundColor: '#333', |
||||
}, |
||||
header: { |
||||
width: '100%', |
||||
backgroundColor: '#444', |
||||
flexDirection: 'row', |
||||
justifyContent: 'flex-end', |
||||
padding: 8, |
||||
}, |
||||
settingsButton: { |
||||
justifyContent: 'center', |
||||
alignSelf: 'center', |
||||
}, |
||||
logoContainer: { |
||||
alignItems: 'center', |
||||
marginBottom: 24, |
||||
}, |
||||
logo: { |
||||
width: '100%', |
||||
height: 80, |
||||
justifyContent: 'center', |
||||
padding: 20, |
||||
}, |
||||
subtitle: { |
||||
fontSize: 16, |
||||
color: '#EAEAEA', |
||||
textAlign: 'center', |
||||
marginTop: 8, |
||||
}, |
||||
inner: { |
||||
marginVertical: 16, |
||||
padding: 35, |
||||
backgroundColor: 'rgba(26, 28, 34, 0.7)', |
||||
justifyContent: 'center', |
||||
alignItems: 'center', |
||||
borderRadius: 15, |
||||
marginTop: 12, |
||||
}, |
||||
titles: { |
||||
fontSize: 18, |
||||
fontWeight: 'bold', |
||||
marginBottom: 8, |
||||
color: '#EAEAEA', |
||||
}, |
||||
box: { |
||||
backgroundColor: '#FFF', |
||||
borderRadius: 8, |
||||
padding: 16, |
||||
alignItems: 'center', |
||||
marginBottom: 16, |
||||
}, |
||||
idCall: { |
||||
fontSize: 34, |
||||
fontWeight: 'bold', |
||||
color: '#FFF', |
||||
letterSpacing: 6, |
||||
}, |
||||
textInput: { |
||||
backgroundColor: '#f5f5f559', |
||||
margin: 6, |
||||
fontSize: 18, |
||||
color: 'white', |
||||
padding: 10, |
||||
borderRadius: 8, |
||||
borderColor: '#DDD', |
||||
borderWidth: 1, |
||||
width: '100%', |
||||
}, |
||||
buttonCall: { |
||||
backgroundColor: 'green', |
||||
borderRadius: 8, |
||||
paddingVertical: 12, |
||||
alignItems: 'center', |
||||
width: '80%', |
||||
marginTop: 16, |
||||
}, |
||||
buttonText: { |
||||
color: '#FFF', |
||||
fontSize: 16, |
||||
fontWeight: 'bold', |
||||
}, |
||||
}); |
||||
|
||||
export default styles; |
@ -1,70 +0,0 @@
|
||||
import { |
||||
Keyboard, |
||||
KeyboardAvoidingView, |
||||
View, |
||||
Text, |
||||
TouchableWithoutFeedback, |
||||
TouchableOpacity, |
||||
} from 'react-native'; |
||||
import React from 'react'; |
||||
import Logo from '../Logo'; |
||||
import TextInputContainer from '../../components/TextInputContainer'; |
||||
import {SafeAreaProvider} from 'react-native-safe-area-context'; |
||||
import {IconButton, MD2Colors} from 'react-native-paper'; |
||||
import {useNavigation} from '@react-navigation/native'; |
||||
|
||||
const JoinScreen = ({ |
||||
styles, |
||||
setCalle, |
||||
calle, |
||||
handleIniciarChamada, |
||||
myRamal, |
||||
}) => { |
||||
const navigation = useNavigation(); |
||||
return ( |
||||
<SafeAreaProvider> |
||||
<KeyboardAvoidingView |
||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'} |
||||
style={styles.container}> |
||||
<IconButton |
||||
icon={'account-cog'} |
||||
iconColor={MD2Colors.tealA100} |
||||
size={30} |
||||
onPress={() => navigation.navigate('configuracoes')} |
||||
/> |
||||
<Logo estilo={styles} /> |
||||
<Text style={styles.subtitle}>O softphone da Simples IP</Text> |
||||
<View style={styles.inner}> |
||||
<Text style={styles.titles}>Seu ID para ligação</Text> |
||||
<View style={styles.box}> |
||||
<Text style={styles.idCall}>{myRamal}</Text> |
||||
</View> |
||||
</View> |
||||
<TouchableWithoutFeedback onPress={Keyboard.dismiss}> |
||||
<> |
||||
<View style={styles.inner}> |
||||
<Text style={styles.titles}>Ligação</Text> |
||||
<TextInputContainer |
||||
placeholder={'Insira o ID para ligação'} |
||||
value={calle} |
||||
setValue={text => { |
||||
setCalle(text); |
||||
}} |
||||
keyboardType={'number-pad'} |
||||
/> |
||||
<TouchableOpacity |
||||
onPress={() => { |
||||
handleIniciarChamada(); |
||||
}} |
||||
style={styles.buttonCall}> |
||||
<Text style={styles.titles}>Realizar chamada</Text> |
||||
</TouchableOpacity> |
||||
</View> |
||||
</> |
||||
</TouchableWithoutFeedback> |
||||
</KeyboardAvoidingView> |
||||
</SafeAreaProvider> |
||||
); |
||||
}; |
||||
|
||||
export default JoinScreen; |
@ -0,0 +1,73 @@
|
||||
import { |
||||
Keyboard, |
||||
KeyboardAvoidingView, |
||||
View, |
||||
Text, |
||||
TouchableWithoutFeedback, |
||||
TouchableOpacity, |
||||
Alert, |
||||
} from 'react-native'; |
||||
import React from 'react'; |
||||
import Logo from '../../Logo'; |
||||
import TextInputContainer from '../../../components/TextInputContainer'; |
||||
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context'; |
||||
import {IconButton, MD2Colors} from 'react-native-paper'; |
||||
import {useNavigation} from '@react-navigation/native'; |
||||
import styles from './styles'; |
||||
import Clipboard from '@react-native-clipboard/clipboard'; |
||||
|
||||
const handleCopyToClipboard = (text) => { |
||||
Clipboard.setString(text); |
||||
Alert.alert('Ramal copiado para área de transferência!'); |
||||
} |
||||
|
||||
const JoinScreen = ({setCalle, calle, handleIniciarChamada, myRamal}) => { |
||||
const navigation = useNavigation(); |
||||
return ( |
||||
<SafeAreaProvider> |
||||
<KeyboardAvoidingView |
||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'} |
||||
style={styles.container}> |
||||
<SafeAreaView style={styles.header}> |
||||
<IconButton |
||||
style={styles.settingsButton} |
||||
icon={'account-cog'} |
||||
iconColor={MD2Colors.grey300} |
||||
size={25} |
||||
onPress={() => navigation.navigate('configuracoes')} |
||||
/> |
||||
</SafeAreaView> |
||||
<View style={styles.logoContainer}> |
||||
<Text style={styles.subtitle}>Softphone</Text> |
||||
<Logo /> |
||||
</View> |
||||
<View style={styles.inner}> |
||||
<Text style={styles.titles}>Ramal do agente</Text> |
||||
<TouchableOpacity onPress={() => handleCopyToClipboard(myRamal)}> |
||||
<View style={styles.box}> |
||||
<Text style={styles.idCall}>{myRamal}</Text> |
||||
</View> |
||||
</TouchableOpacity> |
||||
</View> |
||||
<TouchableWithoutFeedback onPress={Keyboard.dismiss}> |
||||
<View style={styles.inner}> |
||||
<TextInputContainer |
||||
placeholder={'Insira o ramal para ligação'} |
||||
value={calle} |
||||
setValue={setCalle} |
||||
keyboardType={'number-pad'} |
||||
style={styles.textInput} |
||||
/> |
||||
<TouchableOpacity |
||||
onPress={handleIniciarChamada} |
||||
style={styles.buttonCall}> |
||||
<Text style={styles.buttonText}>Realizar chamada</Text> |
||||
</TouchableOpacity> |
||||
</View> |
||||
</TouchableWithoutFeedback> |
||||
</KeyboardAvoidingView> |
||||
</SafeAreaProvider> |
||||
); |
||||
}; |
||||
|
||||
export default JoinScreen; |
@ -0,0 +1,85 @@
|
||||
import {StyleSheet} from 'react-native'; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
flex: 1, |
||||
justifyContent: 'center', |
||||
padding: 16, |
||||
backgroundColor: 'rgba(17, 24, 39, 1)', |
||||
}, |
||||
header: { |
||||
width: '100%', |
||||
flexDirection: 'row', |
||||
justifyContent: 'flex-end', |
||||
position: 'relative', |
||||
top: 0, |
||||
}, |
||||
settingsButton: { |
||||
justifyContent: 'center', |
||||
alignSelf: 'center', |
||||
}, |
||||
logoContainer: { |
||||
alignItems: 'center', |
||||
marginBottom: 24, |
||||
}, |
||||
subtitle: { |
||||
fontSize: 18, |
||||
textAlign: 'center', |
||||
alignSelf: 'flex-start', |
||||
marginTop: 2, |
||||
marginLeft: 24, |
||||
fontWeight: 'bold', |
||||
}, |
||||
inner: { |
||||
marginVertical: 16, |
||||
padding: 10, |
||||
backgroundColor: 'rgba(26, 28, 34, 0.7)', |
||||
justifyContent: 'center', |
||||
alignItems: 'center', |
||||
borderRadius: 15, |
||||
marginTop: 12, |
||||
}, |
||||
titles: { |
||||
fontSize: 16, |
||||
fontWeight: 'bold', |
||||
marginBottom: 6, |
||||
}, |
||||
box: { |
||||
borderRadius: 8, |
||||
padding: 16, |
||||
alignItems: 'center', |
||||
marginBottom: 16, |
||||
}, |
||||
idCall: { |
||||
fontSize: 34, |
||||
fontWeight: 'bold', |
||||
color: '#FFF', |
||||
letterSpacing: 6, |
||||
}, |
||||
textInput: { |
||||
backgroundColor: '#f5f5f559', |
||||
margin: 6, |
||||
fontSize: 18, |
||||
color: 'white', |
||||
padding: 10, |
||||
borderRadius: 8, |
||||
borderColor: '#DDD', |
||||
borderWidth: 1, |
||||
width: '100%', |
||||
}, |
||||
buttonCall: { |
||||
backgroundColor: 'green', |
||||
borderRadius: 8, |
||||
paddingVertical: 12, |
||||
alignItems: 'center', |
||||
width: '80%', |
||||
marginTop: 16, |
||||
}, |
||||
buttonText: { |
||||
color: '#FFF', |
||||
fontSize: 16, |
||||
fontWeight: 'bold', |
||||
}, |
||||
}); |
||||
|
||||
export default styles; |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue