PluginProbe
Vimeography: Vimeo Video Gallery WordPress Plugin / 2.2
Vimeography: Vimeo Video Gallery WordPress Plugin v2.2
2.4.9 2.4.8 trunk 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 0.6 0.6.1 0.6.2 0.6.3 0.6.4 0.6.5 0.6.6 0.6.7 0.6.8 0.6.8.1 0.6.9 0.6.9.1 0.6.9.2 0.7 0.8 All 103 releases
vimeography / lib / admin / app / src / containers / App.tsx

App.tsx in Vimeography: Vimeo Video Gallery WordPress Plugin 2.2, at lib/admin/app/src/containers/App.tsx

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import * as React from "react";
2 import URLSearchParams from "@ungap/url-search-params";
3 import { MemoryRouter as Router, Switch, Route } from "react-router-dom";
4
5 import { QueryClient, QueryClientProvider } from "react-query";
6 const queryClient = new QueryClient();
7
8 import ThemesProvider from "../providers/Themes";
9 import GalleryProvider from "../providers/Gallery";
10 import NotificationProvider from "../providers/Notification";
11 import GalleryEditor from "../components/GalleryEditor/GalleryEditor";
12
13 import ListGalleries from "../pages/ListGalleries/ListGalleries";
14
15 const App = () => {
16 const params = new URLSearchParams(document.location.search.substring(1));
17
18 const id = params.get(`id`);
19 const page = params.get(`page`);
20
21 // Need to fake a top-level router here since
22 // these subcomponents implement a MemoryRouter
23 const isListGalleries = page === `vimeography-edit-galleries` && id === null;
24 const isEditGallery = page === `vimeography-edit-galleries` && id !== null;
25
26 return (
27 <QueryClientProvider client={queryClient}>
28 <NotificationProvider>
29 <ThemesProvider>
30 <Router>
31 {isListGalleries && <ListGalleries />}
32
33 {isEditGallery && (
34 <GalleryProvider id={id}>
35 <GalleryEditor />
36 </GalleryProvider>
37 )}
38 </Router>
39 </ThemesProvider>
40 </NotificationProvider>
41 </QueryClientProvider>
42 );
43 };
44
45 export default App;
46