- added login page;

- added file upload;
- added faq item edit modal;
This commit is contained in:
Vitalii Kiiko
2024-08-23 16:55:19 +02:00
parent 0a21444ee4
commit 5095ed7365
50 changed files with 1540 additions and 576 deletions

View File

@@ -0,0 +1,37 @@
import React, { useRef } from 'react'
import { useDrag } from 'react-dnd'
import { ItemTypes } from '../ItemTypes';
import uniqid from '../../../../helpers/uniqid';
const BuilderElementItem = ({ dbId, name, label, move }) => {
const ref = useRef(null);
const [{ isDragging }, drag] = useDrag(() => ({
type: ItemTypes.FIELD,
item: () => {
return { name, dbId, id: uniqid(), index: -1 }
},
end: (item, monitor) => {
const dropResult = monitor.getDropResult()
if (item && dropResult) {
return item;
}
},
collect: (monitor) => ({
isDragging: monitor.isDragging(),
handlerId: monitor.getHandlerId(),
}),
}))
const opacity = isDragging ? 0.4 : 1
drag(ref);
return (
<div ref={ref} className="formBuilder__elementItem" style={{ opacity }}>
{label}
</div>
)
}
export default BuilderElementItem;