Skip to content

Commit 0695b0e

Browse files
committed
bug/fixes
1 parent 8d0a8e1 commit 0695b0e

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ThemeProvider } from '@/components/theme-provider';
44
import { TooltipProvider } from '@/components/ui/tooltip';
55
import { metadata, viewport, geistSans, geistMono } from '@/config/siteconfig';
66
import Script from 'next/script';
7+
import React from "react";
78

89
export { metadata, viewport };
910

src/app/not-found.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ const WEATHER_BACKGROUNDS = [
1515
] as const;
1616

1717
const WeatherBackground = memo(() => (
18-
<div className="fixed inset-0 -z-10 pointer-events-none opacity-[0.07] dark:opacity-10" aria-hidden="true">
18+
<div
19+
className="fixed inset-0 -z-10 pointer-events-none opacity-[0.07] dark:opacity-10"
20+
aria-hidden="true"
21+
>
1922
{WEATHER_BACKGROUNDS.map(({ emoji, label, position }, index) => (
2023
<div
2124
key={label}
@@ -27,7 +30,10 @@ const WeatherBackground = memo(() => (
2730
role="presentation"
2831
aria-hidden="true"
2932
>
30-
<span className="text-5xl transform hover:scale-110 transition-transform duration-300" aria-label={label}>
33+
<span
34+
className="text-5xl transform hover:scale-110 transition-transform duration-300"
35+
aria-label={label}
36+
>
3137
{emoji}
3238
</span>
3339
</div>
@@ -84,9 +90,7 @@ export default function NotFound() {
8490
>
8591
404
8692
</h1>
87-
<h2 className="text-2xl font-semibold text-foreground">
88-
Page Not Found
89-
</h2>
93+
<h2 className="text-2xl font-semibold text-foreground">Page Not Found</h2>
9094
</div>
9195

9296
{/* Description */}
@@ -136,4 +140,4 @@ export default function NotFound() {
136140
</div>
137141
</main>
138142
);
139-
}
143+
}

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useGeolocation } from '@/hooks/useGeolocation';
44
import { useEffect, useState, useCallback, Suspense, lazy } from 'react';
5-
import { DEFAULT_COORDINATES } from '@/types/weather';
5+
import { DEFAULT_COORDINATES } from '@/constants';
66
import NavBar from '@/components/views/navbar';
77
import WeatherDashboardSkeleton from '@/components/views/dashboard-skeleton';
88
import Footer from '@/components/views/footer';
@@ -45,7 +45,7 @@ export default function WeatherApp() {
4545
const { weatherData, error, isLoading, setError } = useWeatherData(
4646
debouncedCoordinates,
4747
locationLoading,
48-
hasInitialLoad,
48+
hasInitialLoad
4949
);
5050

5151
// Location handlers

src/constants/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {Coordinates} from "@/types/weather";
2+
3+
export const DEFAULT_COORDINATES: Coordinates = {
4+
lat: 40.712776,
5+
lon: -74.005974,
6+
};

src/hooks/useGeolocation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
'use client';
12
import { useState, useEffect, useRef, useCallback } from 'react';
2-
import { DEFAULT_COORDINATES } from '@/types/weather';
3+
import { DEFAULT_COORDINATES } from '@/constants';
34

45
interface GeolocationState {
56
latitude: number;

src/hooks/useWeatherData.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import { useEffect, useState } from 'react';
24
import { WeatherData } from '@/types/weather';
35
import { fetchWeatherData } from '@/actions/weatherActions';

src/types/weather.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ export interface Coordinates {
55
lon: number;
66
}
77

8-
export const DEFAULT_COORDINATES: Coordinates = {
9-
lat: 40.712776,
10-
lon: -74.005974,
11-
};
12-
138
export interface WeatherCondition {
149
id: number;
1510
main: string;

0 commit comments

Comments
 (0)