-
-
Save DanielBarbakadze/cc37b8283d61d07df39c2da7c67dcfd9 to your computer and use it in GitHub Desktop.
react-add-to-calendar-hoc-example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AddToCalendarHOC from "react-add-to-calendar-hoc"; | |
export default function ReactAddToCalendarHoCExample() { | |
const ATCDropdown = (args) => ( | |
<ul className="atc-dropdown"> | |
{args.children.map((link, i) => ( | |
<li key={i}>{link}</li> | |
))} | |
</ul> | |
); | |
const ATCWrapper = (args) => ( | |
<a onClick={args.onClick} className="atc-item" href="/"> | |
{args.children} | |
</a> | |
); | |
const AddToCalendarDropdown = AddToCalendarHOC(ATCWrapper, ATCDropdown); | |
return ( | |
<AddToCalendarDropdown | |
linkProps={{ | |
className: "atc-dropdown-title" | |
}} | |
event={yourEventObject} // yourEventObject here | |
/> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really agree with this, this helped me allot, and I found it missing in the examples. Perhaps commit the examples to the git repo?