-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 #31029 from infinitered/cdanwards/receipt-empty-state
Adds ReceiptEmptyState Component and adds new component to MoneyRequestView
- Loading branch information
Showing
5 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,44 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import styles from '@styles/styles'; | ||
import variables from '@styles/variables'; | ||
import Icon from './Icon'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; | ||
|
||
const propTypes = { | ||
/** Whether or not there is an error */ | ||
hasError: PropTypes.bool, | ||
|
||
/** Callback to be called on onPress */ | ||
onPress: PropTypes.func, | ||
}; | ||
|
||
const defaultProps = { | ||
hasError: false, | ||
onPress: () => {}, | ||
}; | ||
|
||
// Returns an SVG icon indicating that the user should attach a receipt | ||
function ReceiptEmptyState({hasError, onPress}) { | ||
return ( | ||
<PressableWithoutFeedback | ||
accessibilityRole="imagebutton" | ||
onPress={onPress} | ||
style={[styles.alignItemsCenter, styles.justifyContentCenter, styles.moneyRequestViewImage, styles.moneyRequestAttachReceipt, hasError && styles.borderColorDanger]} | ||
> | ||
<Icon | ||
src={Expensicons.EmptyStateAttachReceipt} | ||
width={variables.eReceiptIconWidth} | ||
height={variables.eReceiptIconHeight} | ||
fill="transparent" | ||
/> | ||
</PressableWithoutFeedback> | ||
); | ||
} | ||
|
||
ReceiptEmptyState.displayName = 'ReceiptEmptyState'; | ||
ReceiptEmptyState.propTypes = propTypes; | ||
ReceiptEmptyState.defaultProps = defaultProps; | ||
|
||
export default ReceiptEmptyState; |
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