Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix styling for report typing and timezone indicators #4285

Merged
merged 3 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export default {
send: 'Send',
notifications: 'Notifications',
noResultsFound: 'No results found',
timePrefix: 'It\'s',
conjunctionFor: 'for',
},
attachmentPicker: {
cameraPermissionRequired: 'Camera Permission Required',
Expand Down Expand Up @@ -112,6 +110,7 @@ export default {
youAppearToBeOffline: 'You appear to be offline.',
fileUploadFailed: 'Upload Failed. File is not supported.',
roomIsArchived: 'This chat room has been deleted',
localTime: ({user, time}) => `It's ${time} for ${user}`,
},
contextMenuItem: {
copyToClipboard: 'Copy to Clipboard',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export default {
send: 'Enviar',
notifications: 'Notificaciones',
noResultsFound: 'No se han encontrado resultados',
timePrefix: 'Son las',
conjunctionFor: 'para',
},
attachmentPicker: {
cameraPermissionRequired: 'Se necesita permiso para usar la cámara',
Expand Down Expand Up @@ -112,6 +110,7 @@ export default {
youAppearToBeOffline: 'Parece que estás desconectado.',
fileUploadFailed: 'Subida fallida. El archivo no es compatible.',
roomIsArchived: 'Esta sala de chat ha sido eliminada',
localTime: ({user, time}) => `Son las ${time} para ${user}`,
},
contextMenuItem: {
copyToClipboard: 'Copiar al Portapapeles',
Expand Down
31 changes: 14 additions & 17 deletions src/pages/home/report/ParticipantLocalTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,21 @@ class ParticipantLocalTime extends React.Component {

return (
<View style={[styles.chatItemComposeSecondaryRow]}>
<View style={[
styles.chatItemComposeSecondaryRowOffset,
styles.flexRow,
styles.alignItemsCenter]}
<ExpensiText
style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
numberOfLines={1}
>
<ExpensiText style={[styles.chatItemComposeSecondaryRowSubText, styles.mr1]}>
{this.props.translate('common.timePrefix')}
</ExpensiText>
<ExpensiText style={[styles.textMicroSupportingBold, styles.mr1]}>
{this.state.localTime}
</ExpensiText>
<ExpensiText style={[styles.chatItemComposeSecondaryRowSubText, styles.mr1]}>
{this.props.translate('common.conjunctionFor')}
</ExpensiText>
<ExpensiText style={[styles.textMicroSupportingBold]}>
{reportRecipientDisplayName}
</ExpensiText>
</View>
{this.props.translate(
'reportActionCompose.localTime',
{
user: reportRecipientDisplayName,
time: this.state.localTime,
},
)}
</ExpensiText>
</View>
);
}
Expand Down
46 changes: 22 additions & 24 deletions src/pages/home/report/ReportTypingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,48 +54,46 @@ class ReportTypingIndicator extends React.Component {
case 1:
return (
<View style={[styles.chatItemComposeSecondaryRow]}>
<Text style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
<Text
style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
numberOfLines={1}
>
<Text style={[styles.textMicroSupportingBold]}>
{getDisplayName(this.state.usersTyping[0])}
</Text>
{getDisplayName(this.state.usersTyping[0])}
{` ${this.props.translate('reportTypingIndicator.isTyping')}`}
</Text>
</View>
);
case 2:
return (
<View style={[styles.chatItemComposeSecondaryRow]}>
<Text style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
<Text
style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
numberOfLines={1}
>
<Text style={[styles.textMicroSupportingBold]}>
{getDisplayName(this.state.usersTyping[0])}
</Text>
{getDisplayName(this.state.usersTyping[0])}
{` ${this.props.translate('common.and')} `}
<Text style={[styles.textMicroSupportingBold]}>
{getDisplayName(this.state.usersTyping[1])}
</Text>
{getDisplayName(this.state.usersTyping[1])}
{` ${this.props.translate('reportTypingIndicator.areTyping')}`}
</Text>
</View>
);
default:
return (
<View style={[styles.chatItemComposeSecondaryRow]}>
<Text style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
<Text
style={[
styles.chatItemComposeSecondaryRowSubText,
styles.chatItemComposeSecondaryRowOffset,
]}
numberOfLines={1}
>
<Text style={[styles.textMicroSupportingBold]}>
{this.props.translate('reportTypingIndicator.multipleUsers')}
</Text>
{this.props.translate('reportTypingIndicator.multipleUsers')}
{` ${this.props.translate('reportTypingIndicator.areTyping')}`}
</Text>
</View>
Expand Down
10 changes: 2 additions & 8 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ const styles = {
lineHeight: 14,
},

textMicroSupportingBold: {
color: themeColors.textSupporting,
fontFamily: fontFamily.GTA_BOLD,
fontWeight: fontWeightBold,
fontSize: variables.fontSizeSmall,
lineHeight: 14,
},

textLarge: {
fontSize: variables.fontSizeLarge,
},
Expand Down Expand Up @@ -1033,10 +1025,12 @@ const styles = {
paddingLeft: 20,
paddingRight: 20,
display: 'flex',
backgroundColor: themeColors.appBG,
},

chatItemComposeWithFirstRow: {
minHeight: 90,
marginTop: -16,
},

chatItemComposeBoxColor: {
Expand Down