fix merge editor ui

This commit is contained in:
ammarahm-ed
2021-01-13 16:32:35 +05:00
parent d71288dc44
commit e14d5e10c4
3 changed files with 41 additions and 27 deletions

View File

@@ -69,6 +69,7 @@
setTheme(); setTheme();
attachEditorListeners(); attachEditorListeners();
} }
loadAction()
</script> </script>

View File

@@ -70,6 +70,7 @@
setTheme(); setTheme();
attachEditorListeners(); attachEditorListeners();
} }
loadAction()
</script> </script>

View File

@@ -141,7 +141,6 @@ const MergeEditor = () => {
}; };
const onMessageFromPrimaryWebView = (evt) => { const onMessageFromPrimaryWebView = (evt) => {
if (evt.nativeEvent.data !== '') { if (evt.nativeEvent.data !== '') {
let data = JSON.parse(evt.nativeEvent.data); let data = JSON.parse(evt.nativeEvent.data);
@@ -152,11 +151,9 @@ const MergeEditor = () => {
}; };
const onMessageFromSecondaryWebView = (evt) => { const onMessageFromSecondaryWebView = (evt) => {
if (evt.nativeEvent.data === '') { if (evt.nativeEvent.data === '') {
let data = JSON.parse(evt.nativeEvent.data); let data = JSON.parse(evt.nativeEvent.data);
if (data.type === 'delta') { if (data.type === 'delta') {
secondaryData = data.data; secondaryData = data.data;
} }
} }
@@ -362,6 +359,7 @@ const MergeEditor = () => {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
maxWidth: '50%',
}}> }}>
<Icon <Icon
style={{ style={{
@@ -404,7 +402,10 @@ const MergeEditor = () => {
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
}}> }}>
<Paragraph color={colors.icon} size={SIZE.xxs}> <Paragraph
style={{maxWidth: '80%'}}
color={colors.icon}
size={SIZE.xs}>
Saved on {timeConverter(primaryData.dateEdited)} Saved on {timeConverter(primaryData.dateEdited)}
</Paragraph> </Paragraph>
<Icon <Icon
@@ -440,17 +441,21 @@ const MergeEditor = () => {
onPress={onPressDiscardFromPrimaryWebView} onPress={onPressDiscardFromPrimaryWebView}
/> />
) : null} ) : null}
<View style={{width: 10}} />
{keepContentFrom === 'secondary' ? null : ( {keepContentFrom === 'secondary' ? null : (
<>
<View style={{width: 10}} />
<Button <Button
width={null} width={null}
height={40} height={40}
title={keepContentFrom === 'primary' ? 'Undo' : 'Keep'} title={keepContentFrom === 'primary' ? 'Undo' : 'Keep'}
onPress={onPressKeepFromPrimaryWebView} onPress={onPressKeepFromPrimaryWebView}
color={ color={
keepContentFrom === 'primary' ? colors.errorText : 'accent' keepContentFrom === 'primary'
? colors.errorText
: 'accent'
} }
/> />
</>
)} )}
</View> </View>
</View> </View>
@@ -507,6 +512,7 @@ const MergeEditor = () => {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
maxWidth: '50%',
}}> }}>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
@@ -537,7 +543,10 @@ const MergeEditor = () => {
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
}}> }}>
<Paragraph color={colors.icon} size={SIZE.xs}> <Paragraph
style={{maxWidth: '80%'}}
color={colors.icon}
size={SIZE.xs}>
Saved on {timeConverter(secondaryData.dateEdited)} Saved on {timeConverter(secondaryData.dateEdited)}
</Paragraph> </Paragraph>
<Icon <Icon
@@ -573,8 +582,10 @@ const MergeEditor = () => {
onPress={onPressDiscardFromSecondaryWebView} onPress={onPressDiscardFromSecondaryWebView}
/> />
) : null} ) : null}
<View style={{width: 10}} />
{keepContentFrom === 'primary' ? null : ( {keepContentFrom === 'primary' ? null : (
<>
<View style={{width: 10}} />
<Button <Button
width={null} width={null}
title={keepContentFrom === 'secondary' ? 'Undo' : 'Keep'} title={keepContentFrom === 'secondary' ? 'Undo' : 'Keep'}
@@ -585,6 +596,7 @@ const MergeEditor = () => {
: 'accent' : 'accent'
} }
/> />
</>
)} )}
</View> </View>
</View> </View>