refactor: remove unused SentryErrorButton component and adjust related files

- Deleted the SentryErrorButton component as it was not needed.
- Updated the cookbook page to remove the SentryErrorButton reference.
- Adjusted the search component to fix a self-closing tag issue.
- Ensured the toggleLike function call is correctly formatted in the view component.
- Added sendDefaultPii option to Sentry configuration for improved error tracking.
This commit is contained in:
Ruidy 2025-05-26 15:53:09 +02:00
parent bfd83a367b
commit 4ab8d98e2c
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
5 changed files with 3 additions and 94 deletions

View file

@ -1,91 +0,0 @@
<!--
This is just a very simple component that throws an example error.
Feel free to delete this file.
-->
<script setup>
import * as Sentry from "@sentry/nuxt";
const hasSentError = ref(false);
const throwError = () => {
Sentry.startSpan(
{
name: "Example Frontend Span",
op: "test",
},
() => {
hasSentError.value = true;
throw new Error("Sentry Example Error");
},
);
};
</script>
<template>
<div v-if="hasSentError" class="success">
Sample error was sent to Sentry.
</div>
<button v-else @click="throwError">
<span>Throw Sample Error</span>
</button>
</template>
<style scoped>
button {
border-radius: 8px;
color: white;
cursor: pointer;
background-color: #553db8;
border: none;
padding: 0;
margin-top: 4px;
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
"Helvetica Neue",
sans-serif;
& > span {
display: inline-block;
padding: 12px 16px;
border-radius: inherit;
font-size: 20px;
font-weight: bold;
line-height: 1;
background-color: #7553ff;
border: 1px solid #553db8;
transform: translateY(-4px);
}
&:hover > span {
transform: translateY(-8px);
}
&:active > span {
transform: translateY(0);
}
}
.success {
width: max-content;
padding: 12px 16px;
border-radius: 8px;
font-size: 20px;
line-height: 1;
background-color: #00f261;
border: 1px solid #00bf4d;
color: #181423;
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
"Helvetica Neue",
sans-serif;
}
</style>

View file

@ -10,7 +10,7 @@
:autofocus="autofocus"
@focus="isFocused = true"
@blur="isFocused = false"
/>
>
<kbd
class="hidden md:inline-block kbd kbd-sm"
:class="{ 'opacity-50': !isFocused }"

View file

@ -78,8 +78,8 @@ const shareRecipe = async (recipe: Recipe) => {
</button>
<button
class="btn btn-ghost"
@click="toggleLike(recipe.id)"
:class="{ 'text-red-500': likedRecipes.has(recipe.id) }"
@click="toggleLike(recipe.id)"
>
<icon
:name="likedRecipes.has(recipe.id) ? 'uil:heart' : 'uil:heart-alt'"

View file

@ -6,7 +6,6 @@ const cookbook = useStorage<Recipe[]>("cookbook", [], localStorage);
<template>
<main>
<sentry-error-button />
<div
v-if="cookbook.length === 0"
class="flex justify-center items-center min-h-screen"

View file

@ -17,6 +17,7 @@ Sentry.init({
],
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
sendDefaultPii: true,
_experiments: {
enableLogs: true,
},