@@ -108,6 +108,8 @@ class SeeMore extends React.Component {
108108 children : text ,
109109 linkColor,
110110 linkPressedColor,
111+ seeMoreTextStyle,
112+ seeLessTextStyle,
111113 seeMoreText,
112114 seeLessText,
113115 style,
@@ -118,14 +120,27 @@ class SeeMore extends React.Component {
118120 return null ;
119121 }
120122
123+ const SeeLessText =
124+ typeof seeLessText === 'string' ? (
125+ < Text style = { seeLessTextStyle } > { seeLessText } </ Text >
126+ ) : (
127+ seeLessText
128+ ) ;
129+
130+ const SeeMoreText =
131+ typeof seeMoreText === 'string' ? (
132+ < Text style = { seeMoreTextStyle } > { seeMoreText } </ Text >
133+ ) : (
134+ seeMoreText
135+ ) ;
136+
121137 return (
122138 < Text
123139 { ...this . props }
124140 { ...this . panResponder . panHandlers }
125- style = { [ style , { color : isLinkPressed ? linkPressedColor : linkColor } ] }
126- >
141+ style = { [ style , { color : isLinkPressed ? linkPressedColor : linkColor } ] } >
127142 { isShowingMore ? null : < Text { ...this . props } > ...</ Text > }
128- { isShowingMore ? ` ${ seeLessText } ` : ` ${ seeMoreText } ` }
143+ { isShowingMore ? SeeLessText : SeeMoreText }
129144 </ Text >
130145 ) ;
131146 }
@@ -141,9 +156,7 @@ class SeeMore extends React.Component {
141156 numberOfLines = { isShowingMore ? undefined : numberOfLines }
142157 { ...this . panResponder . panHandlers }
143158 >
144- < Text { ...this . props } >
145- { isShowingMore ? text : text . slice ( 0 , truncationIndex ) }
146- </ Text >
159+ < Text { ...this . props } > { isShowingMore ? text : text . slice ( 0 , truncationIndex ) } </ Text >
147160 { this . renderSeeMoreSeeLessLink ( ) }
148161 </ Text >
149162 ) ;
@@ -155,8 +168,10 @@ SeeMore.propTypes = {
155168 numberOfLines : PropTypes . number . isRequired ,
156169 linkColor : PropTypes . string ,
157170 linkPressedColor : PropTypes . string ,
158- seeMoreText : PropTypes . string ,
159- seeLessText : PropTypes . string ,
171+ seeMoreTextStyle : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . array ] ) ,
172+ seeLessTextStyle : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . array ] ) ,
173+ seeMoreText : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . object ] ) ,
174+ seeLessText : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . object ] ) ,
160175 style : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . array ] ) ,
161176} ;
162177
0 commit comments