moschan / react-native-simple-radio-button

Simple and handy animated radio button component for React Native
MIT License
453 stars 130 forks source link

maxFontSizeMultiplier for RadioButtonLabel #168

Open abo-rythm opened 2 years ago

abo-rythm commented 2 years ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-simple-radio-button@2.7.4 for the project I'm working on.

maxFontSizeMultiplier prop for RadioButtonLabel

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-simple-radio-button/lib/SimpleRadioButton.js b/node_modules/react-native-simple-radio-button/lib/SimpleRadioButton.js
index a737044..2d79684 100644
--- a/node_modules/react-native-simple-radio-button/lib/SimpleRadioButton.js
+++ b/node_modules/react-native-simple-radio-button/lib/SimpleRadioButton.js
@@ -274,12 +274,15 @@ export class RadioButtonLabel extends React.Component {
           this.props.labelWrapStyle,
           Style.labelWrapStyle,
         ]} >
-          <Text style={[
-            Style.radioLabel,
-            !this.props.labelHorizontal && Style.labelVertical,
-            {color: this.props.labelColor},
-            this.props.labelStyle
-          ]}>{this.props.obj.label}</Text>
+          <Text
+            style={[
+              Style.radioLabel,
+              !this.props.labelHorizontal && Style.labelVertical,
+              {color: this.props.labelColor},
+              this.props.labelStyle,
+            ]}
+            maxFontSizeMultiplier={this.props.labelMaxFontSizeMultiplier}
+          >{this.props.obj.label}</Text>
         </View>
       </TouchableWithoutFeedback>
     )

This issue body was partially generated by patch-package.