mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 23:12:13 +00:00
onPathNotMatch moved out of route config
This commit is contained in:
parent
83e225aecc
commit
b405fce103
2 changed files with 18 additions and 16 deletions
|
|
@ -1,17 +1,23 @@
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const { Router } = require('stremio-navigation');
|
const { Router } = require('stremio-navigation');
|
||||||
const { homePath, onPathNotMatch, views: viewsConfig } = require('./routerConfig');
|
const routerConfig = require('./routerConfig');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
|
|
||||||
const App = () => (
|
const App = () => {
|
||||||
<React.StrictMode>
|
const onPathNotMatch = React.useCallback(() => {
|
||||||
<Router
|
window.history.back();
|
||||||
className={styles['router']}
|
}, []);
|
||||||
homePath={homePath}
|
|
||||||
viewsConfig={viewsConfig}
|
return (
|
||||||
onPathNotMatch={onPathNotMatch}
|
<React.StrictMode>
|
||||||
/>
|
<Router
|
||||||
</React.StrictMode>
|
className={styles['router']}
|
||||||
);
|
homePath={routerConfig.homePath}
|
||||||
|
viewsConfig={routerConfig.views}
|
||||||
|
onPathNotMatch={onPathNotMatch}
|
||||||
|
/>
|
||||||
|
</React.StrictMode>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = App;
|
module.exports = App;
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,8 @@ const views = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
const onPathNotMatch = () => {
|
|
||||||
window.history.back();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
homePath,
|
homePath,
|
||||||
views,
|
views
|
||||||
onPathNotMatch
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue