Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import PropTypes from 'prop-types';
import React, {forwardRef} from 'react';
import {ScrollView, View} from 'react-native';
import React from 'react';
import {View} from 'react-native';
import _ from 'underscore';
import htmlRendererPropTypes from '@components/HTMLEngineProvider/HTMLRenderers/htmlRendererPropTypes';
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
import {ShowContextMenuContext, showContextMenuForReport} from '@components/ShowContextMenuContext';
import withLocalize from '@components/withLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as ReportUtils from '@libs/ReportUtils';
import CONST from '@src/CONST';
import htmlRendererPropTypes from './htmlRendererPropTypes';

const propTypes = {
/** Press in handler for the code block */
Expand All @@ -31,20 +31,14 @@ const defaultProps = {
onPressOut: undefined,
};

const BasePreRenderer = forwardRef((props, ref) => {
function PreRenderer(props) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I might take a guess, would you comment on the renaming of this function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, IDK what do you mean by comment on the renaming of this function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking about renaming BasePreRenderer to PreRendered

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't notice the collapsed diffs before. Let's consider this resolved.

const styles = useThemeStyles();
const TDefaultRenderer = props.TDefaultRenderer;
const defaultRendererProps = _.omit(props, ['TDefaultRenderer', 'onPressIn', 'onPressOut', 'onLongPress']);
const isLast = props.renderIndex === props.renderLength - 1;

return (
<ScrollView
ref={ref}
horizontal
style={[isLast ? styles.mt2 : styles.mv2, styles.overscrollBehaviorXNone]}
bounces={false}
keyboardShouldPersistTaps="always"
>
<View style={[isLast ? styles.mt2 : styles.mv2]}>
<ShowContextMenuContext.Consumer>
{({anchor, report, action, checkIfContextMenuActive}) => (
<PressableWithoutFeedback
Expand All @@ -61,12 +55,12 @@ const BasePreRenderer = forwardRef((props, ref) => {
</PressableWithoutFeedback>
)}
</ShowContextMenuContext.Consumer>
</ScrollView>
</View>
);
});
}

BasePreRenderer.displayName = 'BasePreRenderer';
BasePreRenderer.propTypes = propTypes;
BasePreRenderer.defaultProps = defaultProps;
PreRenderer.displayName = 'PreRenderer';
PreRenderer.propTypes = propTypes;
PreRenderer.defaultProps = defaultProps;

export default withLocalize(BasePreRenderer);
export default withLocalize(PreRenderer);

This file was deleted.

This file was deleted.