Added 2 new features - the ability to add custom icon directly in the… #504
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.
Description
2 new inclusions:
I was using that package and I found the current approach to adding custom icons not that much intuitive.
For that reason I made it so it is possible to add the corresponding custom item directly in the items array - as ReactNode/plain html
In addition, while using React Chrono, I wanted to change the default text when expanding and collapsing a card's content but that was not possible. For example if a user wants it to display Expand/Collapse instead of 'read more'/'read less'.
I also included that.
There is already a PR for the texts expand and collapse
#249
I just checked it and saw that it uses prop drilling and passes the 2 values as separate props. I decided to use the global context.
I wasn't sure if that minor change would require update in the demos as a separate version, but I included my changes inside
https://react-chrono-kitchen-sink.prabhumurthy.com/vertical-custom-icon - both the custom read more text and the custom icon. The first icon in the data object is the custom one.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).