Skip to content

Commit

Permalink
Merge pull request #16 from BLOCKMATERIAL/feat/text-props
Browse files Browse the repository at this point in the history
Feat/text props
  • Loading branch information
lohenyumnam committed Nov 1, 2023
2 parents f4f54cc + 6a852d8 commit e3f947f
Show file tree
Hide file tree
Showing 6 changed files with 3,176 additions and 4,465 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export default function App() {
tailTextStyle={styles.tailText}
numberOfLines={2}
enableShowLess={false}
textPropsChild={{allowFontScaling: false}}
textPropsRoot={{allowFontScaling: false}}
/>
</View>
);
Expand All @@ -76,6 +78,14 @@ export default function App() {
| enableOnPressToggle | boolean | No | true | Whether to enable on press toggle functionality |
| enableLayoutAnimation | boolean | No | true | Whether to enable layout animation |
| enableTailView | boolean | No | true | Whether to enable Tail View (See More & See Less) |
| textPropsRoot | [TextProps](https://reactnative.dev/docs/text-style-props#props) | No | Default Value | A property to apply native props to text.
| textPropsChild | [TextProps](https://reactnative.dev/docs/text-style-props#props) | No | Default Value | A property to apply native props to text.

## Contributors


- [<img src="https://github.com/BLOCKMATERIAL.png" width="30" height="30">](https://github.com/BLOCKMATERIAL) [MATERIALBLOCK](https://github.com/BLOCKMATERIAL)


## Contributing

Expand Down
20 changes: 10 additions & 10 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"web": "expo start --web"
},
"dependencies": {
"@types/react": "~18.0.24",
"@types/react": "~18.2.14",
"@types/react-native": "~0.70.6",
"expo": "~47.0.12",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.5",
"react-native-web": "~0.18.9",
"typescript": "^4.6.3"
"expo": "^49.0.0",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.6",
"react-native-web": "~0.19.6",
"typescript": "^5.1.3"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@expo/webpack-config": "^0.17.2",
"@babel/core": "^7.20.0",
"@expo/webpack-config": "^19.0.0",
"babel-loader": "^8.1.0",
"babel-plugin-module-resolver": "^4.1.0"
},
Expand Down
13 changes: 13 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ export default function App() {
enableOnPressToggle={false}
enableTailView={false}
/>

<TruncatedTextView
text={DATA}
style={styles.textStyle}
tailTextStyle={styles.tailText}
numberOfLines={2}
enableShowLess={true}
containerStyle={styles.textContainer}
enableOnPressToggle={false}
enableTailView={false}
textPropsChild={{ allowFontScaling: false }}
textPropsRoot={{ allowFontScaling: false }}
/>
</ScrollView>
</View>
</SafeAreaView>
Expand Down
Loading

0 comments on commit e3f947f

Please sign in to comment.