Skip to content

Commit

Permalink
Split android and ios sources for InlineCodeBlock component
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamr committed Dec 2, 2020
1 parent b130592 commit 1eff1d1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
19 changes: 19 additions & 0 deletions src/components/InlineCodeBlock/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable react/jsx-props-no-spreading */
import React from 'react';
import {View} from 'react-native';
import inlineCodeBlockPropTypes from './inlineCodeBlockPropTypes';

const InlineCodeBlock = ({
TDefaultRenderer,
defaultRendererProps,
boxModelStyle,
textStyle,
}) => (
<View style={boxModelStyle}>
<TDefaultRenderer style={textStyle} {...defaultRendererProps} />
</View>
);

InlineCodeBlock.propTypes = inlineCodeBlockPropTypes;
InlineCodeBlock.displayName = 'InlineCodeBlock';
export default InlineCodeBlock;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable react/jsx-props-no-spreading */
import React from 'react';
import {View, Platform} from 'react-native';
import {View} from 'react-native';
import styles from '../../styles/StyleSheet';
import propTypes from './propTypes';
import inlineCodeBlockPropTypes from './inlineCodeBlockPropTypes';

const InlineCodeBlock = ({
TDefaultRenderer,
Expand All @@ -13,13 +13,13 @@ const InlineCodeBlock = ({
<View
style={{
...boxModelStyle,
...Platform.select({ios: styles.mbn5, default: null}),
...styles.mbn5,
}}
>
<TDefaultRenderer style={textStyle} {...defaultRendererProps} />
</View>
);

InlineCodeBlock.propTypes = propTypes;
InlineCodeBlock.propTypes = inlineCodeBlockPropTypes;
InlineCodeBlock.displayName = 'InlineCodeBlock';
export default InlineCodeBlock;
4 changes: 2 additions & 2 deletions src/components/InlineCodeBlock/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import propTypes from './propTypes';
import inlineCodeBlockPropTypes from './inlineCodeBlockPropTypes';

const InlineCodeBlock = ({
TDefaultRenderer,
Expand All @@ -14,6 +14,6 @@ const InlineCodeBlock = ({
/>
);

InlineCodeBlock.propTypes = propTypes;
InlineCodeBlock.propTypes = inlineCodeBlockPropTypes;
InlineCodeBlock.displayName = 'InlineCodeBlock';
export default InlineCodeBlock;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import PropTypes from 'prop-types';

const propTypes = {
const inlineCodeBlockPropTypes = {
TDefaultRenderer: PropTypes.func.isRequired,
defaultRendererProps: PropTypes.object.isRequired,
boxModelStyle: PropTypes.any.isRequired,
textStyle: PropTypes.any.isRequired
};

export default propTypes;
export default inlineCodeBlockPropTypes;

0 comments on commit 1eff1d1

Please sign in to comment.