mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-18 17:02:12 +00:00
Modal and Router wrapped in FocusableProvider
This commit is contained in:
parent
315abac6f8
commit
f546014424
2 changed files with 13 additions and 2 deletions
|
|
@ -1,6 +1,12 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { FocusableProvider } from 'stremio-common';
|
||||
|
||||
const Modal = (props) => ReactDOM.createPortal(<div {...props} />, document.body);
|
||||
const Modal = (props) => ReactDOM.createPortal(
|
||||
<FocusableProvider>
|
||||
<div {...props} />
|
||||
</FocusableProvider>,
|
||||
document.getElementById('app')
|
||||
);
|
||||
|
||||
export default Modal;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import React, { Component, Fragment } from 'react';
|
|||
import pathToRegexp from 'path-to-regexp';
|
||||
import PathUtils from 'path';
|
||||
import UrlUtils from 'url';
|
||||
import { FocusableProvider } from 'stremio-common';
|
||||
|
||||
class Router extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -99,7 +100,11 @@ class Router extends Component {
|
|||
{
|
||||
this.state.views
|
||||
.filter(({ element }) => React.isValidElement(element))
|
||||
.map(({ path, element }) => <div key={path} className={this.props.routeContainerClassName}>{element}</div>)
|
||||
.map(({ path, element }) => (
|
||||
<FocusableProvider key={path}>
|
||||
<div className={this.props.routeContainerClassName}>{element}</div>
|
||||
</FocusableProvider>
|
||||
))
|
||||
}
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue