Refactor event handlers to remove unused event parameter

In several areas of the code, event handlers had an unused event parameter. This change removes these unused parameters to improve the code's readability and maintainability. Specifically, the changes were made in the "Navbar.astro", "[...slug].astro", and "services.astro" components.
This commit is contained in:
Emil Gulamov 2024-02-24 23:59:08 +04:00
parent bdfe5a4539
commit b422d079fb
4 changed files with 47 additions and 46 deletions

View file

@ -210,7 +210,7 @@ import { navBarLinks } from "../../utils/navigation.ts";
window
.matchMedia("(prefers-color-scheme: dark)")
.addEventListener("change", (e) => {
.addEventListener("change", () => {
if (HSThemeAppearance.getOriginalAppearance() === "auto") {
HSThemeAppearance.setAppearance("auto", false);
}

View file

@ -27,7 +27,6 @@ interface Props {
class="group inline-flex items-center gap-x-2 rounded-full border-2 border-neutral-50 px-3 py-2 text-sm font-semibold text-neutral-50 transition duration-300 hover:border-neutral-100/70 hover:text-neutral-100/70 disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-700 dark:text-neutral-800 dark:hover:border-neutral-700/70 dark:hover:text-neutral-800/70 dark:focus:outline-none"
href={url}
target="_blank"
>
{btnTitle}
<svg
@ -69,11 +68,13 @@ interface Props {
<script>
class AstroBanner extends HTMLElement {
connectedCallback() {
const btnId = this.getAttribute('btnId');
const btnId = this.getAttribute("btnId");
const button = this.querySelector(`#${btnId}`);
button.addEventListener('click', () => this.remove());
if (button != null) {
button.addEventListener("click", () => this.remove());
}
}
}
customElements.define('astro-banner', AstroBanner);
customElements.define("astro-banner", AstroBanner);
</script>

View file

@ -197,7 +197,7 @@ const { product } = Astro.props;
<script is:inline src="/scripts/vendor/gsap/gsap.min.js"></script>
<script>
window.addEventListener("load", (event) => {
window.addEventListener("load", () => {
if (window.gsap) {
const gsap = window.gsap;
gsap.set("#fadeText", {

View file

@ -110,7 +110,7 @@ const articles: Article[] = [
If 'single' is true, it displays one image, otherwise it displays two.
-->
{
articles.map((article, index) => {
articles.map(article => {
return article.isRightSection ? (
<RightSection
title={article.title}