mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 23:12:13 +00:00
Modals and Focusables use CommonJS modules
This commit is contained in:
parent
54064ae430
commit
f8371bd44c
8 changed files with 29 additions and 30 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
const React = require('react');
|
||||
|
||||
const FocusableContext = React.createContext(false);
|
||||
|
||||
FocusableContext.displayName = 'FocusableContext';
|
||||
|
||||
export default FocusableContext;
|
||||
module.exports = FocusableContext;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import withModalsContainer from '../Modal/withModalsContainer';
|
||||
import FocusableContext from './FocusableContext';
|
||||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
const withModalsContainer = require('../Modal/withModalsContainer');
|
||||
const FocusableContext = require('./FocusableContext');
|
||||
|
||||
class FocusableProvider extends Component {
|
||||
class FocusableProvider extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
|
@ -74,4 +74,4 @@ const FocusableProviderWithModalsContainer = withModalsContainer(FocusableProvid
|
|||
|
||||
FocusableProviderWithModalsContainer.displayName = 'FocusableProviderWithModalsContainer';
|
||||
|
||||
export default FocusableProviderWithModalsContainer;
|
||||
module.exports = FocusableProviderWithModalsContainer;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import FocusableProvider from './FocusableProvider';
|
||||
import withFocusable from './withFocusable';
|
||||
const FocusableProvider = require('./FocusableProvider');
|
||||
const withFocusable = require('./withFocusable');
|
||||
|
||||
export {
|
||||
module.exports = {
|
||||
FocusableProvider,
|
||||
withFocusable
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import FocusableContext from './FocusableContext';
|
||||
const React = require('react');
|
||||
const FocusableContext = require('./FocusableContext');
|
||||
|
||||
const withFocusable = (Component) => {
|
||||
return function withFocusable(props) {
|
||||
|
|
@ -11,4 +11,4 @@ const withFocusable = (Component) => {
|
|||
};
|
||||
};
|
||||
|
||||
export default withFocusable;
|
||||
module.exports = withFocusable;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { FocusableProvider } from 'stremio-common';
|
||||
import withModalsContainer from './withModalsContainer';
|
||||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
const ReactDOM = require('react-dom');
|
||||
const FocusableProvider = require('../Focusable/FocusableProvider');
|
||||
const withModalsContainer = require('./withModalsContainer');
|
||||
|
||||
const onModalsContainerDomTreeChange = ({ modalsContainerElement, contentElement }) => {
|
||||
return modalsContainerElement.lastElementChild === contentElement;
|
||||
|
|
@ -25,4 +25,4 @@ const ModalWithModalsContainer = withModalsContainer(Modal);
|
|||
|
||||
ModalWithModalsContainer.displayName = 'ModalWithModalsContainer';
|
||||
|
||||
export default ModalWithModalsContainer;
|
||||
module.exports = ModalWithModalsContainer;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import React from 'react';
|
||||
const React = require('react');
|
||||
|
||||
const ModalsContainerContext = React.createContext(null);
|
||||
|
||||
ModalsContainerContext.displayName = 'ModalsContainerContext';
|
||||
|
||||
export default ModalsContainerContext;
|
||||
|
||||
module.exports = ModalsContainerContext;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import ModalsContainerContext from './ModalsContainerContext';
|
||||
import Modal from './Modal';
|
||||
import withModalsContainer from './withModalsContainer';
|
||||
const ModalsContainerContext = require('./ModalsContainerContext');
|
||||
const Modal = require('./Modal');
|
||||
const withModalsContainer = require('./withModalsContainer');
|
||||
|
||||
export {
|
||||
module.exports = {
|
||||
ModalsContainerContext,
|
||||
Modal,
|
||||
withModalsContainer
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import ModalsContainerContext from './ModalsContainerContext';
|
||||
const React = require('react');
|
||||
const ModalsContainerContext = require('./ModalsContainerContext');
|
||||
|
||||
const withModalsContainer = (Component) => {
|
||||
return function withModalsContainer(props) {
|
||||
|
|
@ -11,4 +11,4 @@ const withModalsContainer = (Component) => {
|
|||
};
|
||||
};
|
||||
|
||||
export default withModalsContainer;
|
||||
module.exports = withModalsContainer;
|
||||
|
|
|
|||
Loading…
Reference in a new issue