Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging -> Master #329

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
403 changes: 196 additions & 207 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@rollbar/react": "^0.11.2",
"@vis.gl/react-google-maps": "^1.1.0",
"bootstrap": "^5.3.3",
"firebase": "^10.13.0",
"firebase": "^10.13.2",
"nanoid": "^5.0.7",
"posthog-js": "^1.155.4",
"react": "^18.3.1",
Expand Down
41 changes: 41 additions & 0 deletions src/components/statics/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";
import { Container, Card, Button } from "react-bootstrap";
import { useRouteError } from "react-router-dom";

interface ErrorPageProps {
onRetry?: () => void;
}

const GenericErrorPage: React.FC<ErrorPageProps> = ({ onRetry }) => {
const error = useRouteError() as Error;
const title = "An Error Occurred";
const message = "We are sorry, something went wrong.";

return (
<Container className="container-main">
<Card className="card-main">
<Card.Img
alt="Ministry Mapper logo"
className="mm-logo"
src="/android-chrome-192x192.png"
/>
<Card.Body>
<Card.Title className="text-center">{title}</Card.Title>
<Card.Text className="text-center">{message}</Card.Text>
{error && (
<Card.Text className="text-center">
<small>{error.message}</small>
</Card.Text>
)}
{onRetry && (
<div className="text-center">
<Button onClick={onRetry}>Retry</Button>
</div>
)}
</Card.Body>
</Card>
</Container>
);
};

export default GenericErrorPage;
35 changes: 13 additions & 22 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import Main from "./pages/index";
import { BrowserRouter } from "react-router-dom";
import { StrictMode } from "react";
import NiceModal from "@ebay/nice-modal-react";
import RollbarMiddleware from "./components/middlewares/rollbar";
import MapsMiddleware from "./components/middlewares/googlemap";
import PostHogMiddleware from "./components/middlewares/posthog";

const root = createRoot(document.getElementById("root") as HTMLElement);
root.render(
<StrictMode>
<RollbarMiddleware>
<PostHogMiddleware>
<MapsMiddleware>
<NiceModal.Provider>
<BrowserRouter>
<Main />
</BrowserRouter>
</NiceModal.Provider>
</MapsMiddleware>
</PostHogMiddleware>
</RollbarMiddleware>
</StrictMode>
);
const rootElement = document.getElementById("root");

if (rootElement) {
const root = createRoot(rootElement);
root.render(
<StrictMode>
<Main />
</StrictMode>
);
} else {
console.error("Root element not found");
}
Loading
Loading