Skip to content

Commit

Permalink
add chatContentScrollViewPlatformStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
rayane-djouah committed May 17, 2024
1 parent f6b4e71 commit dbcb442
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import useReportScrollManager from '@hooks/useReportScrollManager';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import DateUtils from '@libs/DateUtils';
import getPlatform from '@libs/getPlatform';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
Expand Down Expand Up @@ -600,12 +599,8 @@ function ReportActionsList({
const canShowHeader = !isOffline && !hasHeaderRendered.current && scrollingVerticalOffset.current > VERTICAL_OFFSET_THRESHOLD;

const contentContainerStyle: StyleProp<ViewStyle> = useMemo(
() => [
getPlatform() === CONST.PLATFORM.WEB || getPlatform() === CONST.PLATFORM.DESKTOP ? styles.overflowHidden : {},
styles.chatContentScrollView,
isLoadingNewerReportActions && canShowHeader ? styles.chatContentScrollViewWithHeaderLoader : {},
],
[isLoadingNewerReportActions, styles.overflowHidden, styles.chatContentScrollView, styles.chatContentScrollViewWithHeaderLoader, canShowHeader],
() => [styles.chatContentScrollView, isLoadingNewerReportActions && canShowHeader ? styles.chatContentScrollViewWithHeaderLoader : {}],
[isLoadingNewerReportActions, styles.chatContentScrollView, styles.chatContentScrollViewWithHeaderLoader, canShowHeader],
);

const lastReportAction: OnyxTypes.ReportAction | EmptyObject = useMemo(() => sortedReportActions.at(-1) ?? {}, [sortedReportActions]);
Expand Down
2 changes: 2 additions & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import colors from './theme/colors';
import type {ThemeColors} from './theme/types';
import addOutlineWidth from './utils/addOutlineWidth';
import borders from './utils/borders';
import chatContentScrollViewPlatformStyles from './utils/chatContentScrollViewPlatformStyles';
import codeStyles from './utils/codeStyles';
import cursor from './utils/cursor';
import display from './utils/display';
Expand Down Expand Up @@ -1944,6 +1945,7 @@ const styles = (theme: ThemeColors) =>
flexGrow: 1,
justifyContent: 'flex-start',
paddingBottom: 16,
...chatContentScrollViewPlatformStyles,
},

// Chat Item
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type ChatContentScrollViewPlatformStyles from './types';

const chatContentScrollViewPlatformStyles: ChatContentScrollViewPlatformStyles = {};

export default chatContentScrollViewPlatformStyles;
7 changes: 7 additions & 0 deletions src/styles/utils/chatContentScrollViewPlatformStyles/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type ChatContentScrollViewPlatformStyles from './types';

const chatContentScrollViewPlatformStyles: ChatContentScrollViewPlatformStyles = {
overflow: 'hidden',
};

export default chatContentScrollViewPlatformStyles;
5 changes: 5 additions & 0 deletions src/styles/utils/chatContentScrollViewPlatformStyles/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type {ViewStyle} from 'react-native';

type ChatContentScrollViewPlatformStyles = ViewStyle;

export default ChatContentScrollViewPlatformStyles;

0 comments on commit dbcb442

Please sign in to comment.