Skip to content
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
5 changes: 4 additions & 1 deletion src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ type AttachmentModalProps = {
fallbackSource?: AvatarSource;

canEditReceipt?: boolean;

shouldDisableSendButton?: boolean;
};

function AttachmentModal({
Expand All @@ -158,6 +160,7 @@ function AttachmentModal({
shouldShowNotFoundPage = false,
type = undefined,
accountID = undefined,
shouldDisableSendButton = false,
}: AttachmentModalProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand Down Expand Up @@ -589,7 +592,7 @@ function AttachmentModal({
textStyles={[styles.buttonConfirmText]}
text={translate('common.send')}
onPress={submitAndClose}
isDisabled={isConfirmButtonDisabled}
isDisabled={isConfirmButtonDisabled || shouldDisableSendButton}
pressOnEnter
/>
</Animated.View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ type AttachmentPickerWithMenuItemsProps = {

/** The personal details of everyone in the report */
reportParticipantIDs?: number[];

shouldDisableAttachmentItem?: boolean;
};

/**
Expand All @@ -112,6 +114,7 @@ function AttachmentPickerWithMenuItems({
onItemSelected,
actionButtonRef,
raiseIsScrollLikelyLayoutTriggered,
shouldDisableAttachmentItem,
}: AttachmentPickerWithMenuItemsProps) {
const isFocused = useIsFocused();
const theme = useTheme();
Expand Down Expand Up @@ -237,6 +240,7 @@ function AttachmentPickerWithMenuItems({
{
icon: Expensicons.Paperclip,
text: translate('reportActionCompose.addAttachment'),
disabled: shouldDisableAttachmentItem,
},
];
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ function ReportActionCompose({
onConfirm={addAttachment}
onModalShow={() => setIsAttachmentPreviewActive(true)}
onModalHide={onAttachmentPreviewClose}
shouldDisableSendButton={hasExceededMaxCommentLength}
>
{({displayFileInModal}) => (
<>
Expand All @@ -451,6 +452,7 @@ function ReportActionCompose({
onAddActionPressed={onAddActionPressed}
onItemSelected={onItemSelected}
actionButtonRef={actionButtonRef}
shouldDisableAttachmentItem={hasExceededMaxCommentLength}
/>
<ComposerWithSuggestions
ref={(ref) => {
Expand Down