From 25d01463b7dfaea0b76aac5025f21408174b29f3 Mon Sep 17 00:00:00 2001 From: Igor Lima Date: Sun, 29 Oct 2017 22:54:55 -0200 Subject: [PATCH] Add support to ellipsizeMode --- .gitignore | 1 + README.md | 2 ++ index.js | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cef8f11..ecbc458 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules **/xcuserdata .DS_Store **/.DS_Store +**/*.swp diff --git a/README.md b/README.md index cdeb2bd..2bd4a1c 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,8 @@ That's it, you're ready to go! - **title** - (String) - Button's title - **style** - (Object, Array, Number) - Style object or array of style objects - **tintColor** - (String) - Title's text color + - **ellipsizeMode** - ('head', 'middle', 'tail', 'clip') - How to [display](https://facebook.github.io/react-native/docs/text.html#ellipsizemode) the text + - **numberOfLines** - (Number) - How to [truncate](https://facebook.github.io/react-native/docs/text.html#numberoflines) the text ### Usage with Webpack This module uses JSX syntax and requires a compiler such as [babel](https://babeljs.io/). diff --git a/index.js b/index.js index a2066d0..d132036 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,8 @@ const ButtonShape = { const TitleShape = { title: PropTypes.string.isRequired, tintColor: PropTypes.string, + ellipsizeMode: PropTypes.string, + numberOfLines: PropTypes.number }; const StatusBarShape = { @@ -57,7 +59,7 @@ function getTitleElement(data) { return ( - + {data.title}