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

[26737] Made sure that the sections from the request money are scroll… #26781

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions src/components/DistanceRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken})
useEffect(updateGradientVisibility, [scrollContainerHeight, scrollContentHeight]);

return (
<ScrollView contentContainerStyle={styles.flex1}>
<>
<View
style={styles.distanceRequestContainer(scrollContainerMaxHeight)}
onLayout={(event = {}) => setScrollContainerHeight(lodashGet(event, 'nativeEvent.layout.height', 0))}
Expand Down Expand Up @@ -266,7 +266,7 @@ function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken})
isDisabled={_.size(validatedWaypoints) < 2}
text={translate('common.next')}
/>
</ScrollView>
</>
);
}

Expand Down
64 changes: 33 additions & 31 deletions src/pages/iou/MoneyRequestSelectorPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {withOnyx} from 'react-native-onyx';
import {View} from 'react-native';
import {ScrollView, View} from 'react-native';
import React from 'react';
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -79,39 +79,41 @@ function MoneyRequestSelectorPage(props) {
title={title[iouType]}
onBackButtonPress={Navigation.dismissModal}
/>
{iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST ? (
<OnyxTabNavigator
id={CONST.TAB.RECEIPT_TAB_ID}
tabBar={({state, navigation, position}) => (
<TabSelector
state={state}
navigation={navigation}
onTabPress={resetMoneyRequestInfo}
position={position}
/>
)}
>
<TopTab.Screen
name={CONST.TAB.MANUAL}
component={NewRequestAmountPage}
initialParams={{reportID, iouType}}
/>
<TopTab.Screen
name={CONST.TAB.SCAN}
component={ReceiptSelector}
initialParams={{reportID, iouType, pageIndex: 1}}
/>
{shouldDisplayDistanceRequest && (
<ScrollView contentContainerStyle={[styles.flexGrow1]}>
{iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST ? (
<OnyxTabNavigator
id={CONST.TAB.RECEIPT_TAB_ID}
tabBar={({state, navigation, position}) => (
<TabSelector
state={state}
navigation={navigation}
onTabPress={resetMoneyRequestInfo}
position={position}
/>
)}
>
<TopTab.Screen
name={CONST.TAB.DISTANCE}
component={DistanceRequestPage}
name={CONST.TAB.MANUAL}
component={NewRequestAmountPage}
initialParams={{reportID, iouType}}
/>
)}
</OnyxTabNavigator>
) : (
<NewRequestAmountPage route={props.route} />
)}
<TopTab.Screen
name={CONST.TAB.SCAN}
component={ReceiptSelector}
initialParams={{reportID, iouType, pageIndex: 1}}
/>
{shouldDisplayDistanceRequest && (
<TopTab.Screen
name={CONST.TAB.DISTANCE}
component={DistanceRequestPage}
initialParams={{reportID, iouType}}
/>
)}
</OnyxTabNavigator>
) : (
<NewRequestAmountPage route={props.route} />
)}
</ScrollView>
</View>
</DragAndDropProvider>
</FullPageNotFoundView>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useState, useCallback, useRef} from 'react';
import {ScrollView, View} from 'react-native';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import lodashGet from 'lodash/get';
import _ from 'underscore';
Expand Down Expand Up @@ -200,7 +200,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
const buttonText = isEditing ? translate('common.save') : translate('common.next');

return (
<ScrollView contentContainerStyle={styles.flexGrow1}>
<>
<View
nativeID={AMOUNT_VIEW_ID}
onMouseDown={(event) => onMouseDown(event, [AMOUNT_VIEW_ID])}
Expand Down Expand Up @@ -253,7 +253,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
text={buttonText}
/>
</View>
</ScrollView>
</>
);
}

Expand Down
Loading