huridocs/uwazi

View on GitHub
app/react/App/DNDHTML5Backend.ts

Summary

Maintainability
A
0 mins
Test Coverage
C
75%
//@ts-ignore: Temporary while rewrite of components with dnd
import { DragDropContext } from 'react-dnd-old';
import { HTML5Backend } from 'react-dnd-html5-backend-old';

let context: any;

function DNDHTMLBackend(DecoratedClass: any) {
  if (context) {
    return context(DecoratedClass);
  }
  context = DragDropContext(HTML5Backend);
  return context(DecoratedClass);
}

export { DNDHTMLBackend };