Skip to content

Commit

Permalink
Merge pull request #28387 from rezkiy37/fix/18681-inconsistent-margins
Browse files Browse the repository at this point in the history
Fix inconsistent margins for reacted emojis to code-block comments
  • Loading branch information
Beamanator authored Oct 6, 2023
2 parents 27aa686 + e95b07c commit d56c66c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const propTypes = {
/** Press out handler for the code block */
onPressOut: PropTypes.func,

/** The position of this React element relative to the parent React element, starting at 0 */
renderIndex: PropTypes.number.isRequired,

/** The total number of elements children of this React element parent */
renderLength: PropTypes.number.isRequired,

...htmlRendererPropTypes,
};

Expand All @@ -28,12 +34,13 @@ const defaultProps = {
const BasePreRenderer = forwardRef((props, ref) => {
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={[styles.mv2, styles.overscrollBehaviorXNone]}
style={[isLast ? styles.mt2 : styles.mv2, styles.overscrollBehaviorXNone]}
bounces={false}
keyboardShouldPersistTaps="always"
>
Expand Down

0 comments on commit d56c66c

Please sign in to comment.