Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix desktop green drag and drop area #28579

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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.dragAndDropHeader] : []}
>
<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.dragAndDropHeader] : []}
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,
},

dragAndDropHeader: {
gadhiyamanan marked this conversation as resolved.
Show resolved Hide resolved
backgroundColor: theme.receiptDropUIBG,
},
});

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