forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#9095 from Expensify/tgolen-move-istyping
Move all the compose meta data to be above the compose input
- Loading branch information
Showing
6 changed files
with
113 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import CONST from '../CONST'; | ||
import Text from './Text'; | ||
import styles from '../styles/styles'; | ||
|
||
const propTypes = { | ||
/** The current length of the comment */ | ||
commentLength: PropTypes.number.isRequired, | ||
}; | ||
|
||
const ExceededCommentLength = (props) => { | ||
if (props.commentLength <= CONST.MAX_COMMENT_LENGTH) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Text style={[styles.textMicro, styles.textDanger]}> | ||
{`${props.commentLength}/${CONST.MAX_COMMENT_LENGTH}`} | ||
</Text> | ||
); | ||
}; | ||
|
||
ExceededCommentLength.propTypes = propTypes; | ||
ExceededCommentLength.displayName = 'ExceededCommentLength'; | ||
|
||
export default ExceededCommentLength; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import {withNetwork} from './OnyxProvider'; | ||
import networkPropTypes from './networkPropTypes'; | ||
import Icon from './Icon'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import variables from '../styles/variables'; | ||
import Text from './Text'; | ||
import styles from '../styles/styles'; | ||
import compose from '../libs/compose'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
|
||
const propTypes = { | ||
/** Information about the network */ | ||
network: networkPropTypes.isRequired, | ||
|
||
...withLocalizePropTypes, | ||
}; | ||
|
||
const OfflineIndicator = (props) => { | ||
if (!props.network.isOffline) { | ||
return null; | ||
} | ||
return ( | ||
<View style={[styles.flexRow]}> | ||
<Icon | ||
src={Expensicons.Offline} | ||
width={variables.iconSizeExtraSmall} | ||
height={variables.iconSizeExtraSmall} | ||
/> | ||
<Text style={[styles.ml2, styles.chatItemComposeSecondaryRowSubText]}> | ||
{props.translate('reportActionCompose.youAppearToBeOffline')} | ||
</Text> | ||
</View> | ||
); | ||
}; | ||
|
||
OfflineIndicator.propTypes = propTypes; | ||
OfflineIndicator.displayName = 'OfflineIndicator'; | ||
|
||
export default compose( | ||
withLocalize, | ||
withNetwork(), | ||
)(OfflineIndicator); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters