import { withProfiler } from '@sentry/react';
import { HTML5Backend } from 'react-dnd-html5-backend';
import {
  DndProvider,
  MouseTransition,
  MultiBackendOptions,
  TouchTransition,
} from 'react-dnd-multi-backend';
import { TouchBackend } from 'react-dnd-touch-backend';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';
import App from './App';
import store from './store/store';
import { isiOSBrowser } from './utils/browsers';

// Wrap App with Sentry profiling
const WrappedApp = $featureFlags.sentry ? withProfiler(App) : App;

function Root() {
  const options: MultiBackendOptions = {
    backends: isiOSBrowser()
      ? [
          {
            id: 'touch',
            backend: TouchBackend,
            transition: TouchTransition,
            options: { delayTouchStart: 150 },
          },
        ]
      : [
          { id: 'html5', backend: HTML5Backend, transition: MouseTransition },
          {
            id: 'touch',
            backend: TouchBackend,
            transition: TouchTransition,
            options: { delayTouchStart: 150 },
          },
        ],
  };
  return (
    <Router>
      <Provider store={store}>
        <DndProvider options={options}>
          <WrappedApp />
        </DndProvider>
      </Provider>
    </Router>
  );
}

export default Root;

import { withProfiler } from '@sentry/react';
import { HTML5Backend } from 'react-dnd-html5-backend';
import {
  DndProvider,
  MouseTransition,
  MultiBackendOptions,
  TouchTransition,
} from 'react-dnd-multi-backend';
import { TouchBackend } from 'react-dnd-touch-backend';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';
import App from './App';
import store from './store/store';

// Wrap App with Sentry profiling
const WrappedApp = $featureFlags.sentry ? withProfiler(App) : App;

function Root() {
  const options: MultiBackendOptions = {
    backends: [
      { id: 'html5', backend: HTML5Backend, transition: MouseTransition },
      {
        id: 'touch',
        backend: TouchBackend,
        transition: TouchTransition,
        options: { delayTouchStart: 150 },
      },
    ],
  };
  return (
    <Router>
      <Provider store={store}>
        <DndProvider options={options}>
          <WrappedApp />
        </DndProvider>
      </Provider>
    </Router>
  );
}

export default Root;

Revert "Temp: try removing native drag and drop for iOS"
Revert "Temp: try removing native drag and drop for iOS"

This reverts commit 1e0336c65445331ade43e68de8dcbf31be9ffd97.
