-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Added 'titleNumberOfLines' prop to control the truncating of title text #672
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
23ace30
Added 'titleNumberOfLine' prop to control the truncating of title text
andrenanninga 65439d1
Updated navbar to check for number isnt of just falsy value
andrenanninga 3a141cd
ensured all lines of code are less than 100 chars
andrenanninga fc84301
removed 'Integer.isNumber' and added falsy check for 'titleNumerOfLines'
andrenanninga 9669bbf
added example for itleNumberOfLines prop
andrenanninga e5ff803
improved handling of invalid or undefined itleNumberOfProps attribute
andrenanninga 27ec98d
fixed linting issues
andrenanninga 6f288c5
merge
andrenanninga 6b4a3cf
added itleNumberOfLines to API_CONFIGURATION
andrenanninga a4ff35b
remove console.log
andrenanninga cf0c730
improved attribute addition for 'numberOfLines' in navbar
andrenanninga a0295bb
merge
andrenanninga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Javascript
false == 0
, so ifthis.props.titleNumberofLines
is defined to0
, it will be defaulted to-1
by this line.In case that's what you want, I suggest this defaulting instead :
Otherwise :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely spotted, I checked it out and when
numberOfLines
is set to0
no text will be shown in the header. When set to-1
it will just ignore thenumberOfLines
property.Using
Number.isInteger
is cleaner imo but I don't have any strong preference for either.