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

fixes-37403 Workflows-If the first 2 options are enabled,cannot scroll to see the 3th option #38248

Merged
merged 16 commits into from
Mar 22, 2024
Merged
18 changes: 9 additions & 9 deletions src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect, useMemo} from 'react';
import {FlatList, View} from 'react-native';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import * as Illustrations from '@components/Icon/Illustrations';
Expand Down Expand Up @@ -80,7 +80,7 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses
const hasReimburserEmailError = !!policy?.errorFields?.reimburserEmail;

return [
...(canUseDelayedSubmission
...(!canUseDelayedSubmission
ishpaul777 marked this conversation as resolved.
Show resolved Hide resolved
ishpaul777 marked this conversation as resolved.
Show resolved Hide resolved
? [
{
icon: Illustrations.ReceiptEnvelope,
Expand Down Expand Up @@ -206,8 +206,11 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses
session?.accountID,
]);

const renderOptionItem = ({item}: {item: ToggleSettingOptionRowProps}) => (
<View style={styles.mt7}>
const renderOptionItem = (item: ToggleSettingOptionRowProps, index: number) => (
<View
style={styles.mt7}
key={`toggleSettingOptionItem-${index}`}
>
<ToggleSettingOptionRow
icon={item.icon}
title={item.title}
Expand Down Expand Up @@ -236,6 +239,7 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses
shouldShowNotFoundPage={!isPaidGroupPolicy || !isPolicyAdmin}
shouldSkipVBBACall
isLoading={isLoading}
shouldUseScrollView
>
<View style={[styles.mt3, styles.textStrong, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
Expand All @@ -245,11 +249,7 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses
>
<View>
<Text style={[styles.mt3, styles.textSupporting]}>{translate('workflowsPage.workflowDescription')}</Text>
<FlatList
data={optionItems}
renderItem={renderOptionItem}
keyExtractor={(item: ToggleSettingOptionRowProps) => item.title}
/>
{optionItems.map(renderOptionItem)}
</View>
</Section>
</View>
Expand Down
Loading