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

#1405 Multiline Cell component #1417

Merged
merged 2 commits into from
Oct 21, 2019
Merged

#1405 Multiline Cell component #1417

merged 2 commits into from
Oct 21, 2019

Conversation

josh-griffin
Copy link
Contributor

@josh-griffin josh-griffin commented Oct 19, 2019

Fixes #1405

Change summary

  • Adds a maxLines prop to Cell, default of 2

image

image

Testing

  • Have an ItemLine/Supplier/Customer with a really long name and look at the name in the DataTable, should look all good over two lines

Related areas to think about

N/A

have updated PR for react-native-data-table: msupply-foundation/react-native-data-table#57

@josh-griffin josh-griffin added this to the Mobile 3.0.0 milestone Oct 20, 2019
Copy link
Contributor

@wlthomson wlthomson left a comment

Choose a reason for hiding this comment

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

TESTS

  • Have an ItemLine/Supplier/Customer with a really long name and look at the name in the DataTable, should look all good over two lines. SUCCESS.

CODE

LGTM. One small naming nit.

if (debug) console.log(`- Cell: ${value}`);
const internalViewStyle = getAdjustedStyle(viewStyle, width, isLastCell);

return (
<View style={internalViewStyle}>
<Text ellipsizeMode="tail" numberOfLines={1} style={textStyle}>
<Text ellipsizeMode="tail" numberOfLines={maxLines} style={textStyle}>
Copy link
Contributor

@wlthomson wlthomson Oct 21, 2019

Choose a reason for hiding this comment

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

Just my opinion, think its nice to use consistent props with the underlying component. E.g. numberOfLines instead of maxLines. I think unless the underlying component is being used in a very different way, it makes sense to model component "APIs" consistently with the conventions used by the built-in components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wlthomson wlthomson merged commit 74c90a7 into develop Oct 21, 2019
@wlthomson wlthomson deleted the #1405-multiline-cell branch October 21, 2019 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants