Skip to content

Commit

Permalink
fixes #1: move isSupported property to method
Browse files Browse the repository at this point in the history
  • Loading branch information
josephj committed Jan 31, 2021
1 parent 88eeec9 commit 019520f
Show file tree
Hide file tree
Showing 4 changed files with 9,019 additions and 5 deletions.
4 changes: 2 additions & 2 deletions example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export default class App extends Component {
">>> DESCRIPTION <<<\\n Today is a huge day. \\n Tomorrow will be a huge day too!\\n",
startTime: "2018-10-07T10:30:00+10:00",
endTime: "2018-10-07T12:00:00+10:00",
location: "4/7 Herbert St, St Leonards, NSW 2065"
location: "4/7 Herbert St, St Leonards, NSW 2065",
};

return (
<div>
<div>Supported = {ICalLink.isSupported.toString()}</div>
<div>Supported = {ICalLink.isSupported().toString()}</div>
<ICalLink event={event} style={style}>
Today is a huge day!
</ICalLink>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-icalendar-link",
"version": "1.0.3",
"version": "2.0.0",
"description": "Ability to create link for downloading ics file",
"author": "josephj",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ interface Props {
event: ICalEvent;
filename: string;
isCrappyIE: boolean;
isSupported: boolean;
isSupported: () => boolean;
}

export default class ICalLink extends React.Component<Props> {
isCrappyIE: boolean;
// FIXME - iOS Chrome doesn't support adding to iCal at the moment.
// https://bugs.chromium.org/p/chromium/issues/detail?id=666211
public static isSupported: boolean = !isIOSChrome();
public static isSupported = () => !isIOSChrome();
public static defaultProps: Partial<Props> = {
filename: "download.ics",
href: "#add-to-calendar"
Expand Down
Loading

0 comments on commit 019520f

Please sign in to comment.