Skip to content

Let's use AI to Earn!

feat: 日历拖拽初步开发

gaoSird522997c59b2
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f7d16092..623ef820 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,16 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
- <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="feat: 【发布作品】图片和视频预览完成">
+ <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="feat: 【发布弹框】预览样式调整">
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/BoxDragPreview.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarRecord.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CustomDragLayer.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarRecord.module.scss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PublishDialogPreview.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PublishDialogPreview.tsx" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/publishDialog.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/publishDialog.module.scss" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/index.tsx" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -20,8 +24,8 @@
<option name="RECENT_TEMPLATES">
<list>
<option value="TypeScript JSX File" />
- <option value="tsx组件模板" />
<option value="TypeScript File" />
+ <option value="tsx组件模板" />
</list>
</option>
</component>
@@ -110,7 +114,8 @@
<workItem from="1750989950480" duration="7000" />
<workItem from="1750989966702" duration="688000" />
<workItem from="1751010085244" duration="6172000" />
- <workItem from="1751023561603" duration="4045000" />
+ <workItem from="1751023561603" duration="4162000" />
+ <workItem from="1751027862143" duration="4419000" />
</task>
<task id="LOCAL-00001" summary="feat: 日历完善">
<option name="closed" value="true" />
@@ -248,7 +253,15 @@
<option name="project" value="LOCAL" />
<updated>1751026503209</updated>
</task>
- <option name="localTasksCounter" value="18" />
+ <task id="LOCAL-00018" summary="feat: 【发布弹框】预览样式调整">
+ <option name="closed" value="true" />
+ <created>1751027720106</created>
+ <option name="number" value="00018" />
+ <option name="presentableId" value="LOCAL-00018" />
+ <option name="project" value="LOCAL" />
+ <updated>1751027720106</updated>
+ </task>
+ <option name="localTasksCounter" value="19" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -285,6 +298,7 @@
<MESSAGE value="fix: 【PubParmasTextarea.tsx】修复了初始化后会执行onChange的bug" />
<MESSAGE value="feat: 1. 【发布作品弹框】填写发布参数时未选中的账户参数自动填写。&#10;2. 【发布作品弹框】切换步骤0-&gt;1保持展开状态" />
<MESSAGE value="feat: 【发布作品】图片和视频预览完成" />
- <option name="LAST_COMMIT_MESSAGE" value="feat: 【发布作品】图片和视频预览完成" />
+ <MESSAGE value="feat: 【发布弹框】预览样式调整" />
+ <option name="LAST_COMMIT_MESSAGE" value="feat: 【发布弹框】预览样式调整" />
</component>
</project>
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 260f0d4a..6a2d9858 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -32,6 +32,8 @@
"next-sitemap": "^4.2.3",
"qs": "^6.14.0",
"react": "^18",
+ "react-dnd": "^16.0.1",
+ "react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18",
"react-i18next": "15.4.1",
"react-icons": "^5.5.0",
@@ -1232,6 +1234,24 @@
"integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==",
"license": "MIT"
},
+ "node_modules/@react-dnd/asap": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/@react-dnd/asap/-/asap-5.0.2.tgz",
+ "integrity": "sha512-WLyfoHvxhs0V9U+GTsGilGgf2QsPl6ZZ44fnv0/b8T3nQyvzxidxsg/ZltbWssbsRDlYW8UKSQMTGotuTotZ6A==",
+ "license": "MIT"
+ },
+ "node_modules/@react-dnd/invariant": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@react-dnd/invariant/-/invariant-4.0.2.tgz",
+ "integrity": "sha512-xKCTqAK/FFauOM9Ta2pswIyT3D8AQlfrYdOi/toTPEhqCuAs1v5tcJ3Y08Izh1cJ5Jchwy9SeAXmMg6zrKs2iw==",
+ "license": "MIT"
+ },
+ "node_modules/@react-dnd/shallowequal": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz",
+ "integrity": "sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA==",
+ "license": "MIT"
+ },
"node_modules/@react-oauth/google": {
"version": "0.12.2",
"resolved": "https://registry.npmmirror.com/@react-oauth/google/-/google-0.12.2.tgz",
@@ -1334,7 +1354,7 @@
"version": "20.17.50",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-20.17.50.tgz",
"integrity": "sha512-Mxiq0ULv/zo1OzOhwPqOA13I81CV/W3nvd3ChtQZRT5Cwz3cr0FKo/wMSsbTqL3EXpaBAEQhva2B8ByRkOIh9A==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.2"
@@ -2851,6 +2871,17 @@
"node": ">=0.3.1"
}
},
+ "node_modules/dnd-core": {
+ "version": "16.0.1",
+ "resolved": "https://registry.npmjs.org/dnd-core/-/dnd-core-16.0.1.tgz",
+ "integrity": "sha512-HK294sl7tbw6F6IeuK16YSBUoorvHpY8RHO+9yFfaJyCDVb6n7PRcezrOEOa2SBCqiYpemh5Jx20ZcjKdFAVng==",
+ "license": "MIT",
+ "dependencies": {
+ "@react-dnd/asap": "^5.0.1",
+ "@react-dnd/invariant": "^4.0.1",
+ "redux": "^4.2.0"
+ }
+ },
"node_modules/doctrine": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-2.1.0.tgz",
@@ -3689,7 +3720,6 @@
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
- "dev": true,
"license": "MIT"
},
"node_modules/fast-diff": {
@@ -4216,6 +4246,15 @@
"node": ">= 0.4"
}
},
+ "node_modules/hoist-non-react-statics": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+ "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "react-is": "^16.7.0"
+ }
+ },
"node_modules/html-parse-stringify": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz",
@@ -6469,6 +6508,45 @@
"node": ">=0.10.0"
}
},
+ "node_modules/react-dnd": {
+ "version": "16.0.1",
+ "resolved": "https://registry.npmjs.org/react-dnd/-/react-dnd-16.0.1.tgz",
+ "integrity": "sha512-QeoM/i73HHu2XF9aKksIUuamHPDvRglEwdHL4jsp784BgUuWcg6mzfxT0QDdQz8Wj0qyRKx2eMg8iZtWvU4E2Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@react-dnd/invariant": "^4.0.1",
+ "@react-dnd/shallowequal": "^4.0.1",
+ "dnd-core": "^16.0.1",
+ "fast-deep-equal": "^3.1.3",
+ "hoist-non-react-statics": "^3.3.2"
+ },
+ "peerDependencies": {
+ "@types/hoist-non-react-statics": ">= 3.3.1",
+ "@types/node": ">= 12",
+ "@types/react": ">= 16",
+ "react": ">= 16.14"
+ },
+ "peerDependenciesMeta": {
+ "@types/hoist-non-react-statics": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-dnd-html5-backend": {
+ "version": "16.0.1",
+ "resolved": "https://registry.npmjs.org/react-dnd-html5-backend/-/react-dnd-html5-backend-16.0.1.tgz",
+ "integrity": "sha512-Wu3dw5aDJmOGw8WjH1I1/yTH+vlXEL4vmjk5p+MHxP8HuHJS1lAGeIdG/hze1AvNeXWo/JgULV87LyQOr+r5jw==",
+ "license": "MIT",
+ "dependencies": {
+ "dnd-core": "^16.0.1"
+ }
+ },
"node_modules/react-dom": {
"version": "18.3.1",
"resolved": "https://registry.npmmirror.com/react-dom/-/react-dom-18.3.1.tgz",
@@ -6580,6 +6658,15 @@
"url": "https://paulmillr.com/funding/"
}
},
+ "node_modules/redux": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
+ "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.9.2"
+ }
+ },
"node_modules/reflect.getprototypeof": {
"version": "1.0.10",
"resolved": "https://registry.npmmirror.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
@@ -7537,7 +7624,7 @@
"version": "6.19.8",
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/unrs-resolver": {
diff --git a/package.json b/package.json
index 5c3b47d3..5420ed05 100644
--- a/package.json
+++ b/package.json
@@ -35,10 +35,11 @@
"idb-keyval": "^6.2.2",
"lodash": "^4.17.21",
"next": "14.2.29",
- "swiper": "^11.2.8",
"next-sitemap": "^4.2.3",
"qs": "^6.14.0",
"react": "^18",
+ "react-dnd": "^16.0.1",
+ "react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18",
"react-i18next": "15.4.1",
"react-icons": "^5.5.0",
@@ -46,6 +47,7 @@
"react-transition-group": "^4.4.5",
"sass": "^1.59.2",
"sortablejs": "^1.15.6",
+ "swiper": "^11.2.8",
"zustand": "^5.0.5"
},
"devDependencies": {
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/BoxDragPreview.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/BoxDragPreview.tsx
new file mode 100644
index 00000000..a7364a89
--- /dev/null
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/BoxDragPreview.tsx
@@ -0,0 +1,37 @@
+import type { CSSProperties, FC } from "react";
+import { memo, useEffect, useState } from "react";
+import { Button } from "antd";
+
+const styles: CSSProperties = {
+ display: "inline-block",
+ transform: "rotate(-7deg)",
+ WebkitTransform: "rotate(-7deg)",
+};
+
+export interface BoxDragPreviewProps {
+ title: string;
+}
+
+export interface BoxDragPreviewState {
+ tickTock: any;
+}
+
+export const BoxDragPreview: FC<BoxDragPreviewProps> = memo(
+ function BoxDragPreview({ title }) {
+ const [tickTock, setTickTock] = useState(false);
+
+ useEffect(
+ function subscribeToIntervalTick() {
+ const interval = setInterval(() => setTickTock(!tickTock), 500);
+ return () => clearInterval(interval);
+ },
+ [tickTock],
+ );
+
+ return (
+ <div style={styles}>
+ <Button style={{ width: "152px" }}>123456</Button>
+ </div>
+ );
+ },
+);
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarRecord.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarRecord.tsx
new file mode 100644
index 00000000..2798ea34
--- /dev/null
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarRecord.tsx
@@ -0,0 +1,49 @@
+import { ForwardedRef, forwardRef, memo, useEffect } from "react";
+import styles from "./calendarRecord.module.scss";
+import { DragSourceMonitor, useDrag } from "react-dnd";
+import { Button } from "antd";
+import { getEmptyImage } from "react-dnd-html5-backend";
+
+export interface ICalendarRecordRef {}
+
+export interface ICalendarRecordProps {}
+
+const CalendarRecord = memo(
+ forwardRef(
+ ({}: ICalendarRecordProps, ref: ForwardedRef<ICalendarRecordRef>) => {
+ const [{ opacity }, drag, preview] = useDrag(
+ () => ({
+ type: "box",
+ item: { name: "1" },
+ end(item, monitor) {
+ const dropResult = monitor.getDropResult();
+ console.log(item, dropResult);
+ },
+ collect: (monitor: DragSourceMonitor) => ({
+ opacity: monitor.isDragging() ? 0 : 1,
+ }),
+ }),
+ [],
+ );
+
+ useEffect(() => {
+ preview(getEmptyImage(), { captureDraggingState: true });
+ }, []);
+
+ return (
+ <div
+ style={{ opacity: opacity }}
+ ref={(node) => {
+ drag(node);
+ }}
+ className={styles.calendarRecord}
+ role="DraggableBox"
+ >
+ <Button>123456</Button>
+ </div>
+ );
+ },
+ ),
+);
+
+export default CalendarRecord;
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx
index 94eab534..7c5f3cbb 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx
@@ -4,6 +4,9 @@ import { DayCellContentArg } from "@fullcalendar/core";
import { Button } from "antd";
import { useTransClient } from "@/app/i18n/client";
import { PlusOutlined } from "@ant-design/icons";
+import { useDrop } from "react-dnd";
+import CalendarRecord from "@/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarRecord";
+import { CustomDragLayer } from "@/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CustomDragLayer";
export interface ICalendarTimingItemRef {}
@@ -32,9 +35,26 @@ const CalendarTimingItem = memo(
today.getMonth(),
today.getDate(),
);
+ const [{ canDrop, isOver }, drop] = useDrop(
+ () => ({
+ accept: "box",
+ drop: () => ({
+ name: `move Dustbin`,
+ allowedDropEffect: "move",
+ }),
+ collect: (monitor: any) => ({
+ isOver: monitor.isOver(),
+ canDrop: monitor.canDrop(),
+ }),
+ }),
+ [],
+ );
return (
<div
+ ref={(node) => {
+ drop(node);
+ }}
className={[
styles.calendarTimingItem,
argDate < nowDate ? styles.calendarTimingItemPast : "",
@@ -70,18 +90,8 @@ const CalendarTimingItem = memo(
{t("addPost")}
</div>
</Button>
- <Button
- size="small"
- type="dashed"
- onClick={() => {
- onClickPub();
- }}
- >
- <div className="calendarTimingItem-con-btn1">05:34 PM</div>
- <div className="calendarTimingItem-con-btn2">
- {t("addPost")}
- </div>
- </Button>
+ <CustomDragLayer snapToGrid={false} />
+ <CalendarRecord />
</div>
)}
</div>
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CustomDragLayer.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CustomDragLayer.tsx
new file mode 100644
index 00000000..6b3cd8bf
--- /dev/null
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CustomDragLayer.tsx
@@ -0,0 +1,79 @@
+import type { CSSProperties, FC } from "react";
+import type { XYCoord } from "react-dnd";
+import { useDragLayer } from "react-dnd";
+import { Button } from "antd";
+import { BoxDragPreview } from "@/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/BoxDragPreview";
+
+function snapToGrid(x: number, y: number): [number, number] {
+ const snappedX = Math.round(x / 32) * 32;
+ const snappedY = Math.round(y / 32) * 32;
+ return [snappedX, snappedY];
+}
+
+const layerStyles: CSSProperties = {
+ position: "fixed",
+ pointerEvents: "none",
+ zIndex: 100,
+ left: 0,
+ top: 0,
+ width: "100%",
+ height: "100%",
+};
+
+function getItemStyles(
+ initialOffset: XYCoord | null,
+ currentOffset: XYCoord | null,
+ isSnapToGrid: boolean,
+) {
+ if (!initialOffset || !currentOffset) {
+ return {
+ display: "none",
+ };
+ }
+
+ let { x, y } = currentOffset;
+
+ if (isSnapToGrid) {
+ x -= initialOffset.x;
+ y -= initialOffset.y;
+ [x, y] = snapToGrid(x, y);
+ x += initialOffset.x;
+ y += initialOffset.y;
+ }
+
+ const transform = `translate(${x}px, ${y}px)`;
+ return {
+ transform,
+ WebkitTransform: transform,
+ };
+}
+
+export interface CustomDragLayerProps {
+ snapToGrid: boolean;
+}
+
+export const CustomDragLayer: FC<CustomDragLayerProps> = (props) => {
+ const { itemType, isDragging, item, initialOffset, currentOffset } =
+ useDragLayer((monitor) => ({
+ item: monitor.getItem(),
+ itemType: monitor.getItemType(),
+ initialOffset: monitor.getInitialSourceClientOffset(),
+ currentOffset: monitor.getSourceClientOffset(),
+ isDragging: monitor.isDragging(),
+ }));
+
+ if (!isDragging) {
+ return null;
+ }
+ return (
+ <div style={layerStyles}>
+ <div
+ style={getItemStyles(initialOffset, currentOffset, props.snapToGrid)}
+ >
+ <div>
+ <BoxDragPreview title="123" />
+ </div>
+ </div>
+ </div>
+ );
+};
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarRecord.module.scss b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarRecord.module.scss
new file mode 100644
index 00000000..b2a17263
--- /dev/null
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarRecord.module.scss
@@ -0,0 +1,3 @@
+.calendarRecord {
+
+}
\ No newline at end of file
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/index.tsx b/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
index 1208667c..7db77520 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
+++ b/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
@@ -16,6 +16,8 @@ import CalendarTimingItem from "@/app/[lng]/accounts/components/CalendarTiming/C
import PublishDialog from "@/components/PublishDialog";
import { useAccountStore } from "@/store/account";
import { useShallow } from "zustand/react/shallow";
+import { HTML5Backend } from "react-dnd-html5-backend";
+import { DndProvider } from "react-dnd";
export interface ICalendarTimingRef {}
export interface ICalendarTimingProps {}
@@ -116,26 +118,28 @@ const CalendarTiming = memo(
className="calendarTiming-calendar"
ref={calendarTimingCalendarRef}
>
- <FullCalendar
- ref={calendarRef}
- locale={getFullCalendarLang(lng)}
- plugins={[dayGridPlugin]}
- initialView="dayGridMonth"
- initialDate={currentDate}
- headerToolbar={false}
- stickyFooterScrollbar={true}
- dayCellContent={(arg) => {
- return (
- <CalendarTimingItem
- arg={arg}
- onClickPub={() => {
- setPublishDialogOpen(true);
- }}
- />
- );
- }}
- datesSet={handleDatesSet}
- />
+ <DndProvider backend={HTML5Backend}>
+ <FullCalendar
+ ref={calendarRef}
+ locale={getFullCalendarLang(lng)}
+ plugins={[dayGridPlugin]}
+ initialView="dayGridMonth"
+ initialDate={currentDate}
+ headerToolbar={false}
+ stickyFooterScrollbar={true}
+ dayCellContent={(arg) => {
+ return (
+ <CalendarTimingItem
+ arg={arg}
+ onClickPub={() => {
+ setPublishDialogOpen(true);
+ }}
+ />
+ );
+ }}
+ datesSet={handleDatesSet}
+ />
+ </DndProvider>
</div>
</CSSTransition>
</div>