@@ -8421,6 +8421,37 @@ tsconfig.json
8421842134: });
84228422````
84238423
8424+ ## File: src/hooks/useClickOutside.ts
8425+ ````typescript
8426+ 1: import { useEffect, RefObject } from "react";
8427+ 2: /**
8428+ 3: * Hook that handles clicks outside of the passed ref element
8429+ 4: * @param ref - React ref object for the element to monitor
8430+ 5: * @param callback - Function to call when a click outside occurs
8431+ 6: */
8432+ 7: const useClickOutside = (
8433+ 8: ref: RefObject<HTMLElement | null>,
8434+ 9: callback: () => void
8435+ 10: ): void => {
8436+ 11: useEffect(() => {
8437+ 12: const handleClick = (event: MouseEvent | TouchEvent) => {
8438+ 13: if (ref.current && !ref.current.contains(event.target as Node)) {
8439+ 14: callback();
8440+ 15: }
8441+ 16: };
8442+ 17: // Add event listeners
8443+ 18: document.addEventListener("mousedown", handleClick);
8444+ 19: document.addEventListener("touchend", handleClick);
8445+ 20: // Cleanup function
8446+ 21: return () => {
8447+ 22: document.removeEventListener("mousedown", handleClick);
8448+ 23: document.removeEventListener("touchend", handleClick);
8449+ 24: };
8450+ 25: }, [ref, callback]); // Re-run effect if ref or callback changes
8451+ 26: };
8452+ 27: export default useClickOutside;
8453+ ````
8454+
84248455## File: src/hooks/useMobile.tsx
84258456````typescript
84268457 1: import { useState, useEffect } from "react";
@@ -13214,45 +13245,6 @@ tsconfig.json
132141324521: SOFTWARE.
1321513246````
1321613247
13217- ## File: lighthouserc.json
13218- ````json
13219- 1: {
13220- 2: "ci": {
13221- 3: "collect": {
13222- 4: "numberOfRuns": 1,
13223- 5: "url": [
13224- 6: "http://localhost:3000/",
13225- 7: "http://localhost:3000/cv",
13226- 8: "http://localhost:3000/prosjekter",
13227- 9: "http://localhost:3000/kontakt"
13228- 10: ],
13229- 11: "port": 3000,
13230- 12: "settings": {
13231- 13: "onlyCategories": [
13232- 14: "performance",
13233- 15: "accessibility",
13234- 16: "best-practices",
13235- 17: "seo"
13236- 18: ],
13237- 19: "skipAudits": ["uses-http2"]
13238- 20: }
13239- 21: },
13240- 22: "upload": {
13241- 23: "target": "temporary-public-storage"
13242- 24: },
13243- 25: "assert": {
13244- 26: "assertions": {
13245- 27: "categories:performance": ["warn", { "minScore": 0.6 }],
13246- 28: "categories:accessibility": ["warn", { "minScore": 0.9 }],
13247- 29: "categories:best-practices": ["warn", { "minScore": 0.9 }],
13248- 30: "categories:seo": ["warn", { "minScore": 0.9 }],
13249- 31: "uses-http2": "off"
13250- 32: }
13251- 33: }
13252- 34: }
13253- 35: }
13254- ````
13255-
1325613248## File: next.config.ts
1325713249````typescript
1325813250 1: import type { NextConfig } from "next";
@@ -14503,37 +14495,6 @@ tsconfig.json
145031449548: }
1450414496````
1450514497
14506- ## File: src/hooks/useClickOutside.ts
14507- ````typescript
14508- 1: import { useEffect, RefObject } from "react";
14509- 2: /**
14510- 3: * Hook that handles clicks outside of the passed ref element
14511- 4: * @param ref - React ref object for the element to monitor
14512- 5: * @param callback - Function to call when a click outside occurs
14513- 6: */
14514- 7: const useClickOutside = (
14515- 8: ref: RefObject<HTMLElement | null>,
14516- 9: callback: () => void
14517- 10: ): void => {
14518- 11: useEffect(() => {
14519- 12: const handleClick = (event: MouseEvent | TouchEvent) => {
14520- 13: if (ref.current && !ref.current.contains(event.target as Node)) {
14521- 14: callback();
14522- 15: }
14523- 16: };
14524- 17: // Add event listeners
14525- 18: document.addEventListener("mousedown", handleClick);
14526- 19: document.addEventListener("touchend", handleClick);
14527- 20: // Cleanup function
14528- 21: return () => {
14529- 22: document.removeEventListener("mousedown", handleClick);
14530- 23: document.removeEventListener("touchend", handleClick);
14531- 24: };
14532- 25: }, [ref, callback]); // Re-run effect if ref or callback changes
14533- 26: };
14534- 27: export default useClickOutside;
14535- ````
14536-
1453714498## File: src/utils/eslint/package.json
1453814499````json
1453914500 1: {
@@ -14557,6 +14518,46 @@ tsconfig.json
145571451819: }
1455814519````
1455914520
14521+ ## File: lighthouserc.json
14522+ ````json
14523+ 1: {
14524+ 2: "ci": {
14525+ 3: "collect": {
14526+ 4: "numberOfRuns": 1,
14527+ 5: "url": [
14528+ 6: "http://localhost:3000/",
14529+ 7: "http://localhost:3000/cv",
14530+ 8: "http://localhost:3000/prosjekter",
14531+ 9: "http://localhost:3000/kontakt"
14532+ 10: ],
14533+ 11: "port": 3000,
14534+ 12: "settings": {
14535+ 13: "onlyCategories": [
14536+ 14: "performance",
14537+ 15: "accessibility",
14538+ 16: "best-practices",
14539+ 17: "seo"
14540+ 18: ],
14541+ 19: "skipAudits": ["uses-http2"]
14542+ 20: }
14543+ 21: },
14544+ 22: "upload": {
14545+ 23: "target": "temporary-public-storage"
14546+ 24: },
14547+ 25: "assert": {
14548+ 26: "assertions": {
14549+ 27: "categories:performance": ["warn", { "minScore": 0.6 }],
14550+ 28: "categories:accessibility": ["warn", { "minScore": 0.9 }],
14551+ 29: "categories:best-practices": ["warn", { "minScore": 0.9 }],
14552+ 30: "categories:seo": ["warn", { "minScore": 0.9 }],
14553+ 31: "uses-responsive-images": ["error", { "maxWastedBytes": 102400 }],
14554+ 32: "uses-http2": "off"
14555+ 33: }
14556+ 34: }
14557+ 35: }
14558+ 36: }
14559+ ````
14560+
1456014561## File: src/components/Layout/MobileMenu.component.tsx
1456114562````typescript
1456214563 1: "use client";
0 commit comments