Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_addCalendar = async () => {
const newCalendar = {
title: 'cool new calendar',
entityType: Calendar.EntityTypes.EVENT,
color: '#c0ff33',
sourceId:
Platform.OS === 'ios'
? this.state.calendars.find(cal => cal.source && cal.source.name === 'Default').source.id
: undefined,
source:
Platform.OS === 'android'
? {
name: this.state.calendars.find(
cal => cal.accessLevel === Calendar.CalendarAccessLevel.OWNER
).source.name,
isLocalAccount: true,
}
: undefined,
name: 'coolNewCalendar',
accessLevel: Calendar.CalendarAccessLevel.OWNER,
> = props => {
const { calendar } = props;
const calendarTypeName =
calendar.entityType === Calendar.EntityTypes.REMINDER ? 'Reminders' : 'Events';
return (