react-icalendar-link
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -12,5 +12,7 @@ /** | ||
isCrappyIE: boolean; | ||
isSupported: boolean; | ||
} | ||
export default class ICalLink extends React.Component<Props> { | ||
isCrappyIE: boolean; | ||
static isSupported: boolean; | ||
static defaultProps: Partial<Props>; | ||
@@ -17,0 +19,0 @@ constructor(props: any); |
@@ -127,3 +127,3 @@ function __$styleInject(css, ref) { | ||
} | ||
function isMobileSafari() { | ||
function isIOSSafari() { | ||
var ua = window.navigator.userAgent; | ||
@@ -134,2 +134,7 @@ var iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i); | ||
} | ||
function isIOSChrome() { | ||
var ua = window.navigator.userAgent; | ||
var iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i); | ||
return iOS && !!ua.match(/CriOS/i); | ||
} | ||
@@ -147,3 +152,3 @@ /** | ||
var _a = _this.props, event = _a.event, filename = _a.filename; | ||
var url = buildUrl(event, isMobileSafari()); | ||
var url = buildUrl(event, isIOSSafari()); | ||
var blob = new Blob([url], { | ||
@@ -158,3 +163,3 @@ type: "text/calendar;charset=utf-8" | ||
// Safari | ||
if (isMobileSafari()) { | ||
if (isIOSSafari()) { | ||
window.open(url, "_blank"); | ||
@@ -175,2 +180,3 @@ return; | ||
}; | ||
ICalLink.isSupported = !isIOSChrome(); | ||
ICalLink.defaultProps = { | ||
@@ -177,0 +183,0 @@ filename: "download.ics", |
@@ -131,3 +131,3 @@ 'use strict'; | ||
} | ||
function isMobileSafari() { | ||
function isIOSSafari() { | ||
var ua = window.navigator.userAgent; | ||
@@ -138,2 +138,7 @@ var iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i); | ||
} | ||
function isIOSChrome() { | ||
var ua = window.navigator.userAgent; | ||
var iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i); | ||
return iOS && !!ua.match(/CriOS/i); | ||
} | ||
@@ -151,3 +156,3 @@ /** | ||
var _a = _this.props, event = _a.event, filename = _a.filename; | ||
var url = buildUrl(event, isMobileSafari()); | ||
var url = buildUrl(event, isIOSSafari()); | ||
var blob = new Blob([url], { | ||
@@ -162,3 +167,3 @@ type: "text/calendar;charset=utf-8" | ||
// Safari | ||
if (isMobileSafari()) { | ||
if (isIOSSafari()) { | ||
window.open(url, "_blank"); | ||
@@ -179,2 +184,3 @@ return; | ||
}; | ||
ICalLink.isSupported = !isIOSChrome(); | ||
ICalLink.defaultProps = { | ||
@@ -181,0 +187,0 @@ filename: "download.ics", |
@@ -12,2 +12,3 @@ export interface ICalEvent { | ||
export declare function isCrappyIE(): boolean; | ||
export declare function isMobileSafari(): boolean; | ||
export declare function isIOSSafari(): boolean; | ||
export declare function isIOSChrome(): boolean; |
{ | ||
"name": "react-icalendar-link", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Ability to create link for downloading ics file", | ||
@@ -5,0 +5,0 @@ "author": "josephj", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52593
378