Skip to content

Commit

Permalink
Merge pull request #41 from mapcomponents/Add-MultiTab
Browse files Browse the repository at this point in the history
Removing test App and Fixing Hash Router
  • Loading branch information
JannikBrack authored Nov 28, 2024
2 parents 7a50846 + c2599e2 commit 5ca8777
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 281 deletions.
2 changes: 1 addition & 1 deletion multi_tab/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Button} from "@mui/material";
function App() {

const openTable = () => {
const newUrl = `${window.location.href}table`;
const newUrl = `${window.location.href}#/table`;
window.open(newUrl, "_blank", "popup");
}
return (
Expand Down
10 changes: 6 additions & 4 deletions multi_tab/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {MapComponentsProvider} from "@mapcomponents/react-maplibre";
import App from './App';
import DataTableManager from './components/DataTableManager.jsx';
import './index.css';
import { Route, HashRouter as Router } from "react-router-dom";
import {HashRouter as Router, Route, Routes} from "react-router-dom";
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {DataContextProvider} from "./contexts/DataContext";
import pwaUrl from "./lib/pwaUrl";
Expand All @@ -20,7 +20,6 @@ if ('serviceWorker' in navigator) {
});
});
}
const pathname = window.location.pathname;


ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
Expand All @@ -29,8 +28,11 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<MapComponentsProvider>
<DataContextProvider>
<Router>
<Route path={pathname + "/table"} element={<DataTableManager />} />
<Route path={pathname + "/"} element={<App />} />
<Routes>
<Route path="*" element={<div>404 - Page Not Found</div>}/>
<Route path={`/table`} element={<DataTableManager/>}/>
<Route path={`/`} element={<App/>}/>
</Routes>
</Router>
</DataContextProvider>
</MapComponentsProvider>
Expand Down
24 changes: 0 additions & 24 deletions test_app/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions test_app/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions test_app/eslint.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions test_app/index.html

This file was deleted.

28 changes: 0 additions & 28 deletions test_app/package.json

This file was deleted.

1 change: 0 additions & 1 deletion test_app/public/vite.svg

This file was deleted.

42 changes: 0 additions & 42 deletions test_app/src/App.css

This file was deleted.

35 changes: 0 additions & 35 deletions test_app/src/App.jsx

This file was deleted.

1 change: 0 additions & 1 deletion test_app/src/assets/react.svg

This file was deleted.

68 changes: 0 additions & 68 deletions test_app/src/index.css

This file was deleted.

10 changes: 0 additions & 10 deletions test_app/src/main.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions test_app/vite.config.js

This file was deleted.

0 comments on commit 5ca8777

Please sign in to comment.