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
7 changes: 5 additions & 2 deletions src/pages/EditRequestReceiptPage.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import React, {useState} from 'react';
import PropTypes from 'prop-types';
import ScreenWrapper from '../components/ScreenWrapper';
import HeaderWithBackButton from '../components/HeaderWithBackButton';
import Navigation from '../libs/Navigation/Navigation';
import useLocalize from '../hooks/useLocalize';
import ReceiptSelector from './iou/ReceiptSelector';
import DragAndDropProvider from '../components/DragAndDrop/Provider';
import styles from '../styles/styles';

const propTypes = {
/** React Navigation route */
Expand All @@ -30,14 +31,16 @@ const defaultProps = {

function EditRequestReceiptPage({route, transactionID}) {
const {translate} = useLocalize();
const [isDraggingOver, setIsDraggingOver] = useState(false);

return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID={EditRequestReceiptPage.displayName}
headerGapStyles={isDraggingOver ? [styles.receiptDropHeaderGap] : []}
>
<DragAndDropProvider>
<DragAndDropProvider setIsDraggingOver={setIsDraggingOver}>
<HeaderWithBackButton
title={translate('common.receipt')}
onBackButtonPress={Navigation.goBack}
Expand Down
11 changes: 1 addition & 10 deletions src/pages/iou/MoneyRequestSelectorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import OnyxTabNavigator, {TopTab} from '../../libs/Navigation/OnyxTabNavigator';
import NewRequestAmountPage from './steps/NewRequestAmountPage';
import reportPropTypes from '../reportPropTypes';
import * as ReportUtils from '../../libs/ReportUtils';
import themeColors from '../../styles/themes/default';
import usePrevious from '../../hooks/usePrevious';

const propTypes = {
Expand Down Expand Up @@ -86,15 +85,7 @@ function MoneyRequestSelectorPage(props) {
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableKeyboardAvoidingView={false}
headerGapStyles={
isDraggingOver
? [
{
backgroundColor: themeColors.receiptDropUIBG,
},
]
: []
}
headerGapStyles={isDraggingOver ? [styles.receiptDropHeaderGap] : []}
testID={MoneyRequestSelectorPage.displayName}
>
{({safeAreaPaddingBottomStyle}) => (
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3704,6 +3704,10 @@ const styles = (theme) => ({
fontSize: variables.fontSizeSmall,
lineHeight: variables.lineHeightLarge,
},

receiptDropHeaderGap: {
backgroundColor: theme.receiptDropUIBG,
},
});

// For now we need to export the styles function that takes the theme as an argument
Expand Down