Skip to content

Commit

Permalink
Add RNTester examples
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis committed Jun 17, 2024
1 parent dd525b2 commit 11e8411
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/rn-tester/js/examples/Text/TextExample.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ class AdjustingFontSize extends React.Component<
style={{fontSize: 36, marginVertical: 6}}>
Truncated text is baaaaad.
</Text>

<Text
numberOfLines={1}
adjustsFontSizeToFit={true}
style={{fontSize: 16, marginVertical: 6}}>
It doesn't grow
</Text>

<Text
numberOfLines={1}
adjustsFontSizeToFit={true}
minimumFontScale={0.5}
style={{fontSize: 40, marginVertical: 6}}>
Can limit how small the text becomes with minimumFontScale
</Text>

<Text
numberOfLines={1}
adjustsFontSizeToFit={true}
Expand Down
16 changes: 16 additions & 0 deletions packages/rn-tester/js/examples/Text/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,29 @@ class AdjustingFontSize extends React.Component<
style={{fontSize: 36, marginVertical: 6}}>
Truncated text is baaaaad.
</Text>

<Text
numberOfLines={1}
adjustsFontSizeToFit={true}
style={{fontSize: 40, marginVertical: 6}}>
Shrinking to fit available space is much better!
</Text>

<Text
numberOfLines={1}
adjustsFontSizeToFit={true}
style={{fontSize: 16, marginVertical: 6}}>
It doesn't grow
</Text>

<Text
numberOfLines={1}
adjustsFontSizeToFit={true}
minimumFontScale={0.5}
style={{fontSize: 40, marginVertical: 6}}>
Can limit how small the text becomes with minimumFontScale
</Text>

<Text
adjustsFontSizeToFit={true}
numberOfLines={1}
Expand Down

0 comments on commit 11e8411

Please sign in to comment.