Skip to content

Commit dc6de9e

Browse files
committed
Merge branch 'main' into 825-image-size
2 parents acbb2b6 + 0921c83 commit dc6de9e

File tree

3 files changed

+116
-78
lines changed

3 files changed

+116
-78
lines changed

DOCS/repository_context.txt

Lines changed: 73 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The content is organized as follows:
1313
1. This summary section
1414
2. Repository information
1515
3. Directory structure
16+
4. Repository files (if enabled)
1617
4. Multiple file entries, each consisting of:
1718
a. A header with the file path (## File: path/to/file)
1819
b. The full contents of the file in a code block
@@ -8420,6 +8421,37 @@ tsconfig.json
84208421
34: });
84218422
````
84228423

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+
84238455
## File: src/hooks/useMobile.tsx
84248456
````typescript
84258457
1: import { useState, useEffect } from "react";
@@ -13213,45 +13245,6 @@ tsconfig.json
1321313245
21: SOFTWARE.
1321413246
````
1321513247

13216-
## File: lighthouserc.json
13217-
````json
13218-
1: {
13219-
2: "ci": {
13220-
3: "collect": {
13221-
4: "numberOfRuns": 1,
13222-
5: "url": [
13223-
6: "http://localhost:3000/",
13224-
7: "http://localhost:3000/cv",
13225-
8: "http://localhost:3000/prosjekter",
13226-
9: "http://localhost:3000/kontakt"
13227-
10: ],
13228-
11: "port": 3000,
13229-
12: "settings": {
13230-
13: "onlyCategories": [
13231-
14: "performance",
13232-
15: "accessibility",
13233-
16: "best-practices",
13234-
17: "seo"
13235-
18: ],
13236-
19: "skipAudits": ["uses-http2"]
13237-
20: }
13238-
21: },
13239-
22: "upload": {
13240-
23: "target": "temporary-public-storage"
13241-
24: },
13242-
25: "assert": {
13243-
26: "assertions": {
13244-
27: "categories:performance": ["warn", { "minScore": 0.6 }],
13245-
28: "categories:accessibility": ["warn", { "minScore": 0.9 }],
13246-
29: "categories:best-practices": ["warn", { "minScore": 0.9 }],
13247-
30: "categories:seo": ["warn", { "minScore": 0.9 }],
13248-
31: "uses-http2": "off"
13249-
32: }
13250-
33: }
13251-
34: }
13252-
35: }
13253-
````
13254-
1325513248
## File: next.config.ts
1325613249
````typescript
1325713250
1: import type { NextConfig } from "next";
@@ -14502,37 +14495,6 @@ tsconfig.json
1450214495
48: }
1450314496
````
1450414497

14505-
## File: src/hooks/useClickOutside.ts
14506-
````typescript
14507-
1: import { useEffect, RefObject } from "react";
14508-
2: /**
14509-
3: * Hook that handles clicks outside of the passed ref element
14510-
4: * @param ref - React ref object for the element to monitor
14511-
5: * @param callback - Function to call when a click outside occurs
14512-
6: */
14513-
7: const useClickOutside = (
14514-
8: ref: RefObject<HTMLElement | null>,
14515-
9: callback: () => void
14516-
10: ): void => {
14517-
11: useEffect(() => {
14518-
12: const handleClick = (event: MouseEvent | TouchEvent) => {
14519-
13: if (ref.current && !ref.current.contains(event.target as Node)) {
14520-
14: callback();
14521-
15: }
14522-
16: };
14523-
17: // Add event listeners
14524-
18: document.addEventListener("mousedown", handleClick);
14525-
19: document.addEventListener("touchend", handleClick);
14526-
20: // Cleanup function
14527-
21: return () => {
14528-
22: document.removeEventListener("mousedown", handleClick);
14529-
23: document.removeEventListener("touchend", handleClick);
14530-
24: };
14531-
25: }, [ref, callback]); // Re-run effect if ref or callback changes
14532-
26: };
14533-
27: export default useClickOutside;
14534-
````
14535-
1453614498
## File: src/utils/eslint/package.json
1453714499
````json
1453814500
1: {
@@ -14556,6 +14518,46 @@ tsconfig.json
1455614518
19: }
1455714519
````
1455814520

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+
1455914561
## File: src/components/Layout/MobileMenu.component.tsx
1456014562
````typescript
1456114563
1: "use client";
@@ -15073,7 +15075,7 @@ tsconfig.json
1507315075
35: "cookie": ">=1.0.2",
1507415076
36: "envalid": "^8.0.0",
1507515077
37: "jest": "^29.7.0",
15076-
38: "motion": "^12.8.0",
15078+
38: "motion": "^12.9.1",
1507715079
39: "next": "15.3.1",
1507815080
40: "next-sanity": "^9.10.2",
1507915081
41: "path-to-regexp": "^8.2.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"cookie": ">=1.0.2",
3636
"envalid": "^8.0.0",
3737
"jest": "^29.7.0",
38-
"motion": "^12.8.0",
38+
"motion": "^12.9.1",
3939
"next": "15.3.1",
4040
"next-sanity": "^9.10.2",
4141
"path-to-regexp": "^8.2.0",

pnpm-lock.yaml

Lines changed: 42 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)