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

Added 2 new features - the ability to add custom icon directly in the… #504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Zulaxy
Copy link

@Zulaxy Zulaxy commented Jul 26, 2024

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?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

… items array - and custom text for the expand/collapse button for the cards
Copy link

vercel bot commented Jul 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-chrono-uc7v ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 5:56pm

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.

None yet

1 participant