Skip to content

Commit

Permalink
Merge pull request Expensify#33794 from Krishna2323/krishna2323/issue…
Browse files Browse the repository at this point in the history
…/33115

fix: Codeblocks does not wrap.
  • Loading branch information
jasperhuangg authored Jan 4, 2024
2 parents 4b9b55e + 7d2600a commit d4c3e63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 99 deletions.
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) {
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.

0 comments on commit d4c3e63

Please sign in to comment.