cleanhaus-calendar 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4173,9 +4173,23 @@ var CustomCalendar = ({
|
|
|
4173
4173
|
cleaningIcon
|
|
4174
4174
|
}) => {
|
|
4175
4175
|
const [isMounted, setIsMounted] = React9.useState(false);
|
|
4176
|
+
const getInitialHeight = () => {
|
|
4177
|
+
if (typeof window === "undefined") return 0;
|
|
4178
|
+
try {
|
|
4179
|
+
return reactNative.Dimensions.get("window").height;
|
|
4180
|
+
} catch {
|
|
4181
|
+
return 0;
|
|
4182
|
+
}
|
|
4183
|
+
};
|
|
4184
|
+
const [height, setHeight] = React9.useState(getInitialHeight);
|
|
4185
|
+
const [viewKey, setViewKey] = React9.useState(0);
|
|
4176
4186
|
React9.useEffect(() => {
|
|
4177
4187
|
setIsMounted(true);
|
|
4178
4188
|
}, []);
|
|
4189
|
+
React9.useEffect(() => {
|
|
4190
|
+
setHeight(0);
|
|
4191
|
+
setViewKey((prev) => prev + 1);
|
|
4192
|
+
}, [view]);
|
|
4179
4193
|
React9.useEffect(() => {
|
|
4180
4194
|
if (process.env.NODE_ENV !== "production") {
|
|
4181
4195
|
const errors = validateCalendarProps({
|
|
@@ -4189,23 +4203,6 @@ var CustomCalendar = ({
|
|
|
4189
4203
|
}
|
|
4190
4204
|
}, [events, date, onDateChange, onEventPress, view]);
|
|
4191
4205
|
const mergedTheme = mergeTheme(theme);
|
|
4192
|
-
if (!isMounted) {
|
|
4193
|
-
return /* @__PURE__ */ React9__namespace.default.createElement(reactNative.View, { style: [styles10.container, { backgroundColor: mergedTheme.background }] });
|
|
4194
|
-
}
|
|
4195
|
-
const getInitialHeight = () => {
|
|
4196
|
-
if (typeof window === "undefined") return 0;
|
|
4197
|
-
try {
|
|
4198
|
-
return reactNative.Dimensions.get("window").height;
|
|
4199
|
-
} catch {
|
|
4200
|
-
return 0;
|
|
4201
|
-
}
|
|
4202
|
-
};
|
|
4203
|
-
const [height, setHeight] = React9.useState(getInitialHeight);
|
|
4204
|
-
const [viewKey, setViewKey] = React9.useState(0);
|
|
4205
|
-
React9__namespace.default.useEffect(() => {
|
|
4206
|
-
setHeight(0);
|
|
4207
|
-
setViewKey((prev) => prev + 1);
|
|
4208
|
-
}, [view]);
|
|
4209
4206
|
const handleDateTimeChange = React9.useCallback(
|
|
4210
4207
|
(dateTime) => {
|
|
4211
4208
|
if (onDateTimeChange) {
|
|
@@ -4250,6 +4247,9 @@ var CustomCalendar = ({
|
|
|
4250
4247
|
const handleMonthChange = (newDate) => {
|
|
4251
4248
|
onDateChange(newDate);
|
|
4252
4249
|
};
|
|
4250
|
+
if (!isMounted) {
|
|
4251
|
+
return /* @__PURE__ */ React9__namespace.default.createElement(reactNative.View, { style: [styles10.container, { backgroundColor: mergedTheme.background }] });
|
|
4252
|
+
}
|
|
4253
4253
|
if (isLoading) {
|
|
4254
4254
|
return /* @__PURE__ */ React9__namespace.default.createElement(
|
|
4255
4255
|
reactNative.View,
|