Skip to content

Commit

Permalink
Merge pull request #25 from Parrit/copyright_sentry
Browse files Browse the repository at this point in the history
Ensure sentry startup
  • Loading branch information
Pinwheeler authored Jan 28, 2025
2 parents 2cac5e3 + 4f97c4f commit 80f4f8b
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 29 deletions.
58 changes: 30 additions & 28 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ReactGA from "react-ga4";
import "~/styles/global.css";
import layoutStyles from "~/styles/layout.css?url";
import errorStyles from "~/styles/error.css?url";
import { useEffect } from "react";
import { useEffect, useState } from "react";

Check warning on line 24 in app/root.tsx

View workflow job for this annotation

GitHub Actions / lint

'useState' is defined but never used

export const meta: MetaFunction = () => [
{
Expand Down Expand Up @@ -50,32 +50,34 @@ export const loader: LoaderFunction = async () => {
};

const InitializeSentry = (environment: string) => {
Sentry.init({
dsn: "https://c8a47fcd86fce0c2b5913396f6b08533@o4508546853830656.ingest.us.sentry.io/4508546855272448",
tracesSampleRate: 1,
environment,

integrations: [
Sentry.browserTracingIntegration({
useEffect,
useLocation,
useMatches,
}),
Sentry.replayIntegration({
maskAllText: true,
blockAllMedia: true,
}),
],

replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1,
beforeSend(event) {
if (window.location.hostname === "localhost") {
return null;
}
return event;
},
});
if (!Sentry.isInitialized()) {
Sentry.init({
dsn: "https://c8a47fcd86fce0c2b5913396f6b08533@o4508546853830656.ingest.us.sentry.io/4508546855272448",
tracesSampleRate: 1,
environment,

integrations: [
Sentry.browserTracingIntegration({
useEffect,
useLocation,
useMatches,
}),
Sentry.replayIntegration({
maskAllText: true,
blockAllMedia: true,
}),
],

replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1,
beforeSend(event) {
if (window.location.hostname === "localhost") {
return null;
}
return event;
},
});
}
};

function App() {
Expand All @@ -86,7 +88,7 @@ function App() {

useEffect(() => {
if (!SENTRY_ENVIRONMENT) {
console.error("No sentry environment. Bugs will not be reported.");
console.warn("No sentry environment. Bugs will not be reported.");
return;
}

Expand Down
6 changes: 5 additions & 1 deletion app/routes/project.$projectId/components/ui/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from "react";
import "~/styles/footer.css";
import copyright from "~/styles/images/copyright.svg";

export const Footer: React.FC = () => {
return (
<footer>
<div className="fake-copyright">© Parrit 2025</div>
<div className="fake-copyright flex items-center space-x-1">
<img className="h-2 w-2 inline-block" src={copyright} />
<span>Parrit 2025</span>
</div>
<div className="footer-links">
<a
target="_blank"
Expand Down
54 changes: 54 additions & 0 deletions app/styles/images/copyright.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 80f4f8b

Please sign in to comment.