From fe5f734cff2981160195f6fbff820badeecdfb29 Mon Sep 17 00:00:00 2001 From: mashazyu Date: Wed, 22 Apr 2020 21:40:58 +0200 Subject: [PATCH] Refactors AppText and Segment components --- components/common/app-text.js | 19 +++++-------------- components/common/segment.js | 1 + 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/components/common/app-text.js b/components/common/app-text.js index d431466..329cf28 100644 --- a/components/common/app-text.js +++ b/components/common/app-text.js @@ -6,20 +6,11 @@ import Link from './link' import { Colors, Typography } from '../../styles/redesign' -export default function AppText({ - children, - linkStyle, - onPress, - numberOfLines, - style -}) { +const AppText = ({ children, linkStyle, style, ...props }) => { // we parse for links in case the text contains any return ( - + {children} @@ -29,8 +20,6 @@ export default function AppText({ AppText.propTypes = { children: PropTypes.node, linkStyle: PropTypes.object, - onPress: PropTypes.func, - numberOfLines: PropTypes.number, style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), } @@ -39,4 +28,6 @@ const styles = StyleSheet.create({ color: Colors.greyDark, ...Typography.mainText } -}) \ No newline at end of file +}) + +export default AppText \ No newline at end of file diff --git a/components/common/segment.js b/components/common/segment.js index 935394b..97cea4f 100644 --- a/components/common/segment.js +++ b/components/common/segment.js @@ -20,6 +20,7 @@ const Segment = ({ children, last, title }) => { Segment.propTypes = { children: PropTypes.node, last: PropTypes.bool, + style: PropTypes.object, title: PropTypes.string }