react-chrono icon indicating copy to clipboard operation
react-chrono copied to clipboard

Added navigation feature

Open highfield opened this issue 4 years ago • 3 comments

Here is my proposal for adding the navigation feature.

The Chrono component now exposes a new optional property initialActiveTimelineItem, which instructs the component which item should activate on load. That comes useful when the timeline shows items where the most recent is the most interesting (es. incoming mail messages).

There's another modification: the ability to navigate programmatically to any of the loaded items. That is done by exposing a kind of "API" via ref. That comes useful when the component is already shown, but you need to highlight the item upon something else selection.

It would be nice if the initial scrolling will happen without animation, but I was unable to follow your code to do that.

Let me know if you need clarifications about my code.

Mario

highfield avatar Jan 30 '21 08:01 highfield

@highfield thanks for opening the PR. the proposal looks good to me.

can you fix the lint issues please. https://github.com/prabhuignoto/react-chrono/pull/97/checks?check_run_id=1796751500

prabhuignoto avatar Feb 03 '21 08:02 prabhuignoto

@prabhuignoto I'd love to fix them, but I have no practice with linter. By the way, the analisys shows some strange informations to me. For instance, anonymous functions are a very common practice with React hooks: should we take all of them as named?

Let me know.

highfield avatar Feb 03 '21 13:02 highfield

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Apr 18 '23 04:04 sonarqubecloud[bot]