mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-01 11:45:59 +00:00
Merge pull request #38 from Kingscliq/master
refactor of if else to tenary for simplicity
This commit is contained in:
commit
7bd4b8a665
|
@ -5,14 +5,13 @@ import './index.css';
|
||||||
|
|
||||||
function Router() {
|
function Router() {
|
||||||
const { streamData } = useMovie();
|
const { streamData } = useMovie();
|
||||||
if (streamData) return <MovieView />;
|
return streamData ? <MovieView /> : <SearchView />;
|
||||||
else return <SearchView />;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<MovieProvider>
|
<MovieProvider>
|
||||||
<Router/>
|
<Router />
|
||||||
</MovieProvider>
|
</MovieProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue