cronofy-elements
Advanced tools
Comparing version 1.12.1 to 1.13.0
{ | ||
"name": "cronofy-elements", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js", |
import React, { useContext } from "react"; | ||
import { css, jsx } from "@emotion/core"; | ||
import { SlotsContext, ThemeContext, ExtrasContext } from "./AvailabilityRules"; | ||
import { | ||
SlotsContext, | ||
StatusContext, | ||
ThemeContext, | ||
ExtrasContext | ||
} from "./AvailabilityRules"; | ||
import { DragContext } from "./Week"; | ||
import Slot from "./Slot"; | ||
import { parseSlotsIntoDays } from "../../helpers/slots.rules"; | ||
import { buildNewRules, parseSlotsIntoDays } from "../../helpers/slots.rules"; | ||
import { arrayOfDaySlots } from "../../helpers/utils.AvailabilityRules"; | ||
@@ -16,6 +21,7 @@ | ||
const [theme, setTheme] = useContext(ThemeContext); | ||
const [status] = useContext(StatusContext); | ||
const days = parseSlotsIntoDays(slots, extras.limits.slotsPerDay); | ||
const toggleMultiple = (IDs, status) => { | ||
const availability = status === "available"; | ||
const toggleMultiple = (IDs, toggleStatus) => { | ||
const availability = toggleStatus === "available"; | ||
@@ -27,3 +33,13 @@ const newSlots = {}; | ||
setSlots({ ...slots, ...newSlots }); | ||
const allSlots = { ...slots, ...newSlots }; | ||
const newRules = buildNewRules(allSlots); | ||
const callbackContent = { | ||
notification: { | ||
type: "availability_rule_edited" | ||
}, | ||
availability_rule: newRules | ||
}; | ||
status.ruleSaved(callbackContent); | ||
setSlots(allSlots); | ||
}; | ||
@@ -30,0 +46,0 @@ |
Sorry, the diff of this file is too big to display
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
2470845
21761