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 branch 'main' of github.com:Expensify/App into luke-full-page-o…
…ffline-view
- Loading branch information
Showing
17 changed files
with
266 additions
and
168 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import _ from 'underscore'; | ||
import CONST from '../CONST'; | ||
import Text from './Text'; | ||
import styles from '../styles/styles'; | ||
import stylePropTypes from '../styles/stylePropTypes'; | ||
|
||
const propTypes = { | ||
/** The current length of the comment */ | ||
commentLength: PropTypes.number.isRequired, | ||
|
||
/** Additional style props */ | ||
style: stylePropTypes, | ||
}; | ||
|
||
const defaultProps = { | ||
style: [], | ||
}; | ||
|
||
const ExceededCommentLength = (props) => { | ||
if (props.commentLength <= CONST.MAX_COMMENT_LENGTH) { | ||
return null; | ||
} | ||
|
||
const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; | ||
|
||
return ( | ||
<Text style={[styles.textMicro, styles.textDanger, ...additionalStyles]}> | ||
{`${props.commentLength}/${CONST.MAX_COMMENT_LENGTH}`} | ||
</Text> | ||
); | ||
}; | ||
|
||
ExceededCommentLength.propTypes = propTypes; | ||
ExceededCommentLength.defaultProps = defaultProps; | ||
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
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,57 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import _ from 'underscore'; | ||
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'; | ||
import stylePropTypes from '../styles/stylePropTypes'; | ||
|
||
const propTypes = { | ||
/** Information about the network */ | ||
network: networkPropTypes.isRequired, | ||
|
||
/** Additional style props */ | ||
style: stylePropTypes, | ||
|
||
...withLocalizePropTypes, | ||
}; | ||
|
||
const defaultProps = { | ||
style: [], | ||
}; | ||
|
||
const OfflineIndicator = (props) => { | ||
if (!props.network.isOffline) { | ||
return null; | ||
} | ||
|
||
const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; | ||
|
||
return ( | ||
<View style={[styles.flexRow, ...additionalStyles]}> | ||
<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.defaultProps = defaultProps; | ||
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
Oops, something went wrong.