jasonleibowitz/react-add-to-calendar-hoc

Enable to change the button text

AntoninSlejska opened this issue · 1 comments

Feature request

Is your feature request related to a problem? Please describe.

The button text is hard coded in lib/index.js (line 146):

buttonText: 'Add to Calendar',

Describe the solution you'd like

It would be nice, if I could define another text (in my case a german translation) e.g. like this:

<AddToCalendarDropdown
  className={componentStyles}
  linkProps={{
    style: linkStyles,
  }}
  event={event}
  buttonText='Termin hinzufügen'
/>

The component already supports taking buttonText as a prop. Take a look at the props section in the readme. Add To Calendar is just the default, but if you do exactly what you've done above you'll get the outcome you desire.

If you clone the repo and in src/docs/index.jsx change one of the examples to what's below, you'll see the button text updated after running npm run docs.

<AddToCalendarModal
  className={componentStyles}
  buttonText="Termin hinzufügen"
  linkProps={{
    className: linkStyles,
  }}
  event={event}
/>