Skip to content

Commit fa672a6

Browse files
authored
Feat/text add underline (#1670)
* Move TextScreen to typescript * Text - add underline * Fix snapshots * Add underline example
1 parent a06be42 commit fa672a6

File tree

5 files changed

+68
-8
lines changed

5 files changed

+68
-8
lines changed

demo/src/screens/componentScreens/TextScreen.js renamed to demo/src/screens/componentScreens/TextScreen.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import {Animated, ScrollView} from 'react-native';
33
import {View, Text, Colors} from 'react-native-ui-lib';
44

55
class TextScreen extends Component {
6-
state = {};
7-
toggle = false;
8-
animatedValue = new Animated.Value(0);
6+
private toggle = false;
7+
private animatedValue = new Animated.Value(0);
98

109
animate = () => {
1110
this.toggle = !this.toggle;
@@ -64,6 +63,9 @@ class TextScreen extends Component {
6463
<Text uppercase text70>
6564
uppercase
6665
</Text>
66+
<Text underline text70>
67+
underline
68+
</Text>
6769
</View>
6870
{this.renderDivider()}
6971

@@ -89,6 +91,7 @@ class TextScreen extends Component {
8991
<Text
9092
text70
9193
animated
94+
// @ts-expect-error
9295
style={{transform: [{scale: this.animatedValue.interpolate({inputRange: [0, 1], outputRange: [1, 2]})}]}}
9396
onPress={this.animate}
9497
>

generatedTypes/src/components/text/index.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ export declare type TextProps = RNTextProps & TypographyModifiers & ColorsModifi
77
*/
88
color?: string;
99
/**
10-
* whether to center the text (using textAlign)
10+
* Whether to center the text (using textAlign)
1111
*/
1212
center?: boolean;
1313
/**
14-
* whether to change the text to uppercase
14+
* Whether to change the text to uppercase
1515
*/
1616
uppercase?: boolean;
17+
/**
18+
* Whether to add an underline
19+
*/
20+
underline?: boolean;
1721
/**
1822
* Substring to highlight
1923
*/

0 commit comments

Comments
 (0)