mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-28 08:49:01 +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 { Router } = require('stremio-navigation');
|
||||
const { homePath, onPathNotMatch, views: viewsConfig } = require('./routerConfig');
|
||||
const routerConfig = require('./routerConfig');
|
||||
const styles = require('./styles');
|
||||
|
||||
const App = () => (
|
||||
<React.StrictMode>
|
||||
<Router
|
||||
className={styles['router']}
|
||||
homePath={homePath}
|
||||
viewsConfig={viewsConfig}
|
||||
onPathNotMatch={onPathNotMatch}
|
||||
/>
|
||||
</React.StrictMode>
|
||||
);
|
||||
const App = () => {
|
||||
const onPathNotMatch = React.useCallback(() => {
|
||||
window.history.back();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<React.StrictMode>
|
||||
<Router
|
||||
className={styles['router']}
|
||||
homePath={routerConfig.homePath}
|
||||
viewsConfig={routerConfig.views}
|
||||
onPathNotMatch={onPathNotMatch}
|
||||
/>
|
||||
</React.StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
module.exports = App;
|
||||
|
|
|
|||
|
|
@ -45,12 +45,8 @@ const views = [
|
|||
}
|
||||
]
|
||||
];
|
||||
const onPathNotMatch = () => {
|
||||
window.history.back();
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
homePath,
|
||||
views,
|
||||
onPathNotMatch
|
||||
views
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue