[RN] Improve video switch style and remove react warning

This commit is contained in:
Bettenbuk Zoltan 2018-05-15 12:34:05 +02:00 committed by Saúl Ibarra Corretgé
parent f64b511682
commit df7b8e51fc
2 changed files with 18 additions and 6 deletions

View File

@ -62,9 +62,11 @@ class VideoSwitch extends Component<Props> {
<View style = { styles.audioVideoSwitchContainer }> <View style = { styles.audioVideoSwitchContainer }>
<TouchableWithoutFeedback <TouchableWithoutFeedback
onPress = { this._onStartAudioOnlyFalse }> onPress = { this._onStartAudioOnlyFalse }>
<Text style = { textStyle }> <View style = { styles.switchLabel }>
{ t('welcomepage.audioVideoSwitch.video') } <Text style = { textStyle }>
</Text> { t('welcomepage.audioVideoSwitch.video') }
</Text>
</View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
<Switch <Switch
onTintColor = { SWITCH_UNDER_COLOR } onTintColor = { SWITCH_UNDER_COLOR }
@ -74,9 +76,11 @@ class VideoSwitch extends Component<Props> {
value = { _settings.startAudioOnly } /> value = { _settings.startAudioOnly } />
<TouchableWithoutFeedback <TouchableWithoutFeedback
onPress = { this._onStartAudioOnlyTrue }> onPress = { this._onStartAudioOnlyTrue }>
<Text style = { textStyle }> <View style = { styles.switchLabel }>
{ t('welcomepage.audioVideoSwitch.audio') } <Text style = { textStyle }>
</Text> { t('welcomepage.audioVideoSwitch.audio') }
</Text>
</View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
</View> </View>
); );

View File

@ -34,6 +34,7 @@ export default createStyleSheet({
* View that contains the audio-video switch and the labels. * View that contains the audio-video switch and the labels.
*/ */
audioVideoSwitchContainer: { audioVideoSwitchContainer: {
alignItems: 'center',
flexDirection: 'row' flexDirection: 'row'
}, },
@ -222,6 +223,13 @@ export default createStyleSheet({
fontWeight: 'bold' fontWeight: 'bold'
}, },
/**
* The container of the label of the audio-video switch.
*/
switchLabel: {
paddingHorizontal: 3
},
/** /**
* Room input style. * Room input style.
*/ */