stephane-monnot / react-vertical-timeline

Vertical timeline for React.js
https://stephane-monnot.github.io/react-vertical-timeline/
MIT License
1.08k stars 158 forks source link

Add custom classes to the elements inside the VerticalTimelineElement component #31

Closed karkarn1 closed 4 years ago

karkarn1 commented 5 years ago

Hello! This is my first time making a pull request, so please let me know if I am doing it right or if I'm missing a step :smile:

I added 3 new props to the VerticalTimelineElement component:

  1. dateClassName: Add a class to the date element
  2. iconClassName: Add a class to the icon element
  3. textClassName: Add a class to the text container div

Also, since the wrapper div in that component is only here to wrap its content, I replaced it with a Fragment, which removes the unnecessary div when the component is rendered.

Finally, I added keys to the demo code to avoid the React warning about component keys.

codecov-io commented 5 years ago

Codecov Report

Merging #31 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #31   +/-   ##
=======================================
  Coverage   94.73%   94.73%           
=======================================
  Files           2        2           
  Lines          19       19           
  Branches        3        3           
=======================================
  Hits           18       18           
  Misses          1        1
Impacted Files Coverage Δ
src/VerticalTimelineElement.js 93.33% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 00ec884...1bacf32. Read the comment docs.

killmenot commented 5 years ago

Hi @stephane-monnot Could you please find time to review this PR and merge it if you think it's good enough?

AyoubeAkaouch commented 5 years ago

This is exactly what I was looking for, it makes it so much easier.

kyleboe commented 5 years ago

Bump 👍

stephane-monnot commented 5 years ago

Sorry for the delayed response and thank you for your contribution. Could you provide tests please ?

AyoubeAkaouch commented 5 years ago

@karkarn1 Could you please write tests? I need this

danielolamide commented 4 years ago

Hi @stephane-monnot is this merge going to be made?

stephane-monnot commented 4 years ago

@danielolamide You can check on master branch.