-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Typing indicator ellipses #5933
Changes from 2 commits
2f0a3c1
f7ab275
1c44269
19b76f9
b1d1e64
642c07c
b865cc6
ff10cfb
add0f8c
40bc376
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,18 @@ import _ from 'underscore'; | |
import {withOnyx} from 'react-native-onyx'; | ||
import compose from '../../../libs/compose'; | ||
import ONYXKEYS from '../../../ONYXKEYS'; | ||
import styles from '../../../styles/styles'; | ||
import styles, {getTypingIndicatorTextStyle} from '../../../styles/styles'; | ||
import {getDisplayName} from '../../../libs/actions/PersonalDetails'; | ||
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; | ||
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; | ||
import Text from '../../../components/Text'; | ||
|
||
const propTypes = { | ||
/** Key-value pairs of user logins and whether or not they are typing. Keys are logins. */ | ||
userTypingStatuses: PropTypes.objectOf(PropTypes.bool), | ||
|
||
...withLocalizePropTypes, | ||
...windowDimensionsPropTypes, | ||
}; | ||
|
||
const defaultProps = { | ||
|
@@ -53,33 +55,25 @@ class ReportTypingIndicator extends React.Component { | |
return <View style={[styles.chatItemComposeSecondaryRow]} />; | ||
case 1: | ||
return ( | ||
<View style={[styles.chatItemComposeSecondaryRow]}> | ||
<View style={[styles.chatItemComposeSecondaryRow, styles.flexRow]}> | ||
<Text | ||
style={[ | ||
styles.chatItemComposeSecondaryRowSubText, | ||
styles.chatItemComposeSecondaryRowOffset, | ||
getTypingIndicatorTextStyle(this.props.isSmallScreenWidth), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will not need it. See comment below... |
||
]} | ||
numberOfLines={1} | ||
> | ||
{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, | ||
styles.ml1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should take the natural gap of |
||
]} | ||
numberOfLines={1} | ||
> | ||
{getDisplayName(this.state.usersTyping[0])} | ||
{` ${this.props.translate('common.and')} `} | ||
{getDisplayName(this.state.usersTyping[1])} | ||
{` ${this.props.translate('reportTypingIndicator.areTyping')}`} | ||
{` ${this.props.translate('reportTypingIndicator.isTyping')}`} | ||
</Text> | ||
</View> | ||
); | ||
|
@@ -108,6 +102,7 @@ ReportTypingIndicator.displayName = 'ReportTypingIndicator'; | |
|
||
export default compose( | ||
withLocalize, | ||
withWindowDimensions, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like unsued now. |
||
withOnyx({ | ||
userTypingStatuses: { | ||
key: ({reportID}) => `${ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${reportID}`, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2179,6 +2179,22 @@ const webViewStyles = { | |
}, | ||
}; | ||
|
||
/** | ||
* Return typing indicator text style | ||
* @param {Boolean} isSmallScreenWidth | ||
* | ||
* @returns {Object} | ||
*/ | ||
function getTypingIndicatorTextStyle(isSmallScreenWidth) { | ||
return isSmallScreenWidth | ||
? { | ||
maxWidth: 200, | ||
} | ||
: { | ||
maxWidth: 500, | ||
}; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. This is supposed to be fluid. Take max available space with hiding |
||
/** | ||
* Takes safe area insets and returns padding to use for a View | ||
* | ||
|
@@ -2461,4 +2477,5 @@ export { | |
getModalPaddingStyles, | ||
getFontFamilyMonospace, | ||
getEmojiPickerStyle, | ||
getTypingIndicatorTextStyle, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this as it is??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did add
...
back totyping...
.I am not sure if two
...
look fine. But upto you guys.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @NikkiWines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I think it's fine for now since
is typing...
is pretty standard if there's no animation for a user typing.