Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add numberOfLines prop to DataTableTitle #863

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/DataTable/DataTableTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ type Props = React.ElementConfig<typeof TouchableWithoutFeedback> & {|
* Direction of sorting. An arrow indicating the direction is displayed when this is given.
*/
sortDirection?: 'ascending' | 'descending',
/**
* The number of lines to show.
*/
numberOfLines?: number,
/**
* Function to execute on press.
*/
Expand Down Expand Up @@ -70,6 +74,7 @@ class DataTableTitle extends React.Component<Props, State> {
sortDirection,
theme,
style,
numberOfLines,
...rest
} = this.props;

Expand Down Expand Up @@ -99,7 +104,7 @@ class DataTableTitle extends React.Component<Props, State> {
styles.cell,
sortDirection ? styles.sorted : { color: textColor },
]}
numberOfLines={1}
numberOfLines={numberOfLines || 1}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use defaultProps for the default value

>
{children}
</Text>
Expand Down