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 ability to customize Text proos on TopNavigation title & description #810

Closed
stay2be opened this issue Jan 11, 2020 · 4 comments
Closed
Labels
💡 Proposal 📱 Components components module-specific

Comments

@stay2be
Copy link

stay2be commented Jan 11, 2020

Please add an option to add additional props to the Text component of TopNavigation used for title & description.

Our current use case is, that we need to truncate the text there and show ellipsis chars after. This could be achived by setting the numberOfLines prop on the <Text numberOfLines={1}>Some long tex...</Text> component.

Ref: https://stackoverflow.com/questions/30594080/how-to-have-ellipsis-effect-on-text

@artyorsh
Copy link
Collaborator

artyorsh commented Jan 13, 2020

Hi @stay2be. I don't think that having something like titleProps or descriptionProps is a good solution for this and will fit library API in general. However, I do think that having numberOfLines={1} by default is a good option.

Let's keep it open so we can track this and close in future releases. Thanks for reporting 👍

@artyorsh artyorsh added 📱 Components components module-specific 💡 Proposal labels Jan 13, 2020
@bogdanvidican
Copy link

Hi @artyorsh, maybe modifying TopNavigationProps interface to receive title as React.ReactNode would make sense; this way, a component with all the required props set could be passed.

In our case, we need to disable font scaling by setting allowFontScaling={false}

@stay2be
Copy link
Author

stay2be commented Feb 20, 2020

Hi @artyorsh , some flexibility here would be nice, because we have also some cases where we need a multiline title and no truncation.

@artyorsh
Copy link
Collaborator

artyorsh commented Feb 20, 2020

@stay2be we have started working on this, and it will be landed in v5. Maybe with some alpha versions before the official release so users can test it. You can see our vision of new API here #896

Testing this in Kitten Tricks 👍
image

@artyorsh artyorsh mentioned this issue Mar 16, 2020
Merged
2 tasks
@artyorsh artyorsh closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Proposal 📱 Components components module-specific
Projects
None yet
Development

No branches or pull requests

3 participants