diff --git a/src/components/LoadingBar.tsx b/src/components/LoadingBar.tsx index e13702517e101..4c523fe43eeb4 100644 --- a/src/components/LoadingBar.tsx +++ b/src/components/LoadingBar.tsx @@ -1,5 +1,4 @@ import React, {useEffect} from 'react'; -import {View} from 'react-native'; import Animated, {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; import useThemeStyles from '@hooks/useThemeStyles'; import colors from '@styles/theme/colors'; @@ -47,19 +46,22 @@ function LoadingBar({shouldShow}: LoadingBarProps) { // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [shouldShow]); + const wrapperStyle = useAnimatedStyle(() => ({ + height: withTiming(shouldShow ? 2 : 0, {duration: CONST.TIMING.SKELETON_FADE_DURATION}), + })); + const barStyle = useAnimatedStyle(() => ({ left: `${left.get()}%`, width: '30%', height: '100%', backgroundColor: colors.green, opacity: opacity.get(), - borderRadius: 2, })); return ( - + - + ); } diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 99906a5551d81..133de4b7811f6 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -10,6 +10,7 @@ import Banner from '@components/Banner'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import DragAndDropProvider from '@components/DragAndDrop/Provider'; import * as Expensicons from '@components/Icon/Expensicons'; +import LoadingBar from '@components/LoadingBar'; import MoneyReportHeader from '@components/MoneyReportHeader'; import MoneyRequestHeader from '@components/MoneyRequestHeader'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; @@ -682,6 +683,9 @@ function ReportScreen({route, navigation}: ReportScreenProps) { return null; } + const {isLoadingInitialReportActions, isLoadingOlderReportActions, isLoadingNewerReportActions} = reportMetadata as OnyxTypes.ReportMetadata; + const showLoadingBar = !!isLoadingOlderReportActions || !!isLoadingNewerReportActions || (reportActions.length > 0 && !!isLoadingInitialReportActions); + return ( @@ -707,8 +711,10 @@ function ReportScreen({route, navigation}: ReportScreenProps) { errors={reportErrors} shouldShowErrorMessages={false} needsOffscreenAlphaCompositing + style={[styles.zIndex10]} > {headerView} + {!!accountManagerReportID && isConciergeChatReport(report) && isBannerVisible && ( getIsReportFullyVisible(isFocused), [isFocused]); - const {isLoadingInitialReportActions, isLoadingOlderReportActions, isLoadingNewerReportActions, hasLoadingNewerReportActionsError} = reportMetadata; + const {isLoadingInitialReportActions, hasLoadingNewerReportActionsError} = reportMetadata; useEffect(() => { // When we linked to message - we do not need to wait for initial actions - they already exists @@ -214,8 +213,6 @@ function ReportActionsView({ [reportActions, isOffline, canPerformWriteAction], ); - const showLoadingBar = !!isLoadingOlderReportActions || !!isLoadingNewerReportActions || !!(visibleReportActions.length > 0 && isLoadingInitialReportActions); - const reportActionIDMap = useMemo(() => { const reportActionIDs = allReportActions?.map((action) => action.reportActionID); return reportActions.map((action) => ({ @@ -377,7 +374,6 @@ function ReportActionsView({ const shouldEnableAutoScroll = (hasNewestReportAction && (!reportActionID || !isNavigatingToLinkedMessage)) || (transactionThreadReport && !prevTransactionThreadReport); return ( <> - }, progressBarWrapper: { - height: 2, overflow: 'hidden', + width: '100%', + position: 'absolute', + top: 'auto', + bottom: -0.5, + left: 0, + zIndex: 222, }, accountSwitcherAnchorPosition: {