Skip to content

Commit 6b39c27

Browse files
committed
pwa fix, og fix and cleanup
1 parent 0f8a363 commit 6b39c27

19 files changed

+59
-15
lines changed

icon.png

54.6 KB
Loading

public/favicon.ico

-22.3 KB
Binary file not shown.

public/icons/icon-128x128.png

7.26 KB
Loading

public/icons/icon-144x144.png

8.69 KB
Loading

public/icons/icon-152x152.png

9.45 KB
Loading

public/icons/icon-16x16.png

269 Bytes
Loading

public/icons/icon-180x180.png

12.6 KB
Loading

public/icons/icon-192x192.png

14 KB
Loading

public/icons/icon-32x32.png

751 Bytes
Loading

public/icons/icon-384x384.png

39.1 KB
Loading

public/icons/icon-512x512.png

52.3 KB
Loading

public/icons/icon-72x72.png

2.81 KB
Loading

public/icons/icon-96x96.png

4.53 KB
Loading

public/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "NEXT INITIATE 15",
3-
"short_name": "NEXT INITIATE 15",
4-
"description": "Next.js 15+ starter template with app router, shadcn/ui, typesafe env, icons and configs setup.",
2+
"name": "METEO",
3+
"short_name": "METEO",
4+
"description": "METEO WEATHER APP MADE WITH NEXTJS AND OPENWEATHERMAP API",
55
"icons": [
66
{
77
"src": "icons/icon-72x72.png",

src/app/(pages)/page.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export default function HomePage({
1919
const lat = searchParams.lat
2020
const lon = searchParams.lon
2121

22-
console.log("Latitude:", lat) // Debugging: check the values
23-
console.log("Longitude:", lon) // Debugging: check the values
24-
2522
return (
2623
<>
2724
<div className="container flex h-full max-w-[64rem] flex-col items-center justify-center gap-4 text-center">

src/app/api/og/route.tsx

+55-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @next/next/no-img-element */
22
import { ImageResponse } from "next/og"
33
import { type NextRequest } from "next/server"
4-
import { DEFAULT_LOCATION } from "@/configs/site"
4+
import { DEFAULT_LOCATION, siteConfig } from "@/configs/site"
55
import { type CurrentWeatherData } from "@/types"
66

77
import { env } from "@/env.js"
@@ -21,10 +21,59 @@ export async function GET(_req: NextRequest) {
2121
const lat = searchParams.get("lat")
2222
const lon = searchParams.get("lon")
2323

24-
const CurrentWeatherData: CurrentWeatherData = (await GetCurrentWeather({
25-
lat: lat ?? "",
26-
lon: lon ?? "",
27-
})) as CurrentWeatherData
24+
if (lat ?? lon) {
25+
const CurrentWeatherData: CurrentWeatherData = (await GetCurrentWeather({
26+
lat: lat ?? "",
27+
lon: lon ?? "",
28+
})) as CurrentWeatherData
29+
return new ImageResponse(
30+
(
31+
<div
32+
style={{
33+
height: "100%",
34+
width: "100%",
35+
display: "flex",
36+
flexDirection: "column",
37+
alignItems: "center",
38+
justifyContent: "center",
39+
backgroundColor: "black",
40+
borderRadius: "8px",
41+
border: "8px solid white",
42+
}}
43+
>
44+
<h1
45+
style={{
46+
fontFamily: "Inter",
47+
fontSize: "3rem",
48+
color: "white",
49+
textAlign: "center",
50+
}}
51+
>
52+
{CurrentWeatherData.name ?? DEFAULT_LOCATION.city}
53+
</h1>
54+
<img
55+
width={300}
56+
height={300}
57+
src={`${env.NEXT_PUBLIC_APP_URL}/icons/icon-512x512.png`}
58+
alt=""
59+
/>
60+
</div>
61+
),
62+
{
63+
width: 1200,
64+
height: 630,
65+
fonts: [
66+
{
67+
name: "Inter",
68+
data: fontBold,
69+
style: "normal",
70+
weight: 700,
71+
},
72+
],
73+
}
74+
)
75+
}
76+
2877
return new ImageResponse(
2978
(
3079
<div
@@ -48,7 +97,7 @@ export async function GET(_req: NextRequest) {
4897
textAlign: "center",
4998
}}
5099
>
51-
{CurrentWeatherData.name ?? DEFAULT_LOCATION.city}
100+
{siteConfig.name}
52101
</h1>
53102
<img
54103
width={300}

src/app/layout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import "@/styles/globals.css"
66
import { siteConfig } from "@/configs/site"
77
import { ThemeProvider } from "next-themes"
88

9-
import ScreenSizeDetector from "@/components/custom/ScreenSizeDetector"
109
import WrapperPage from "@/components/layout/wrapper-page"
1110

1211
const inter = Inter({ subsets: ["latin"] })

src/components/layout/wrapper-page.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { useTheme } from "next-themes"
77
import { useSessionStorage } from "usehooks-ts"
88

99
import Loader from "./loader"
10-
import Navbar from "./navbar"
1110

1211
export default function WrapperPage({
1312
children,

src/components/widgets/Map.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function Map() {
7272
const [viewport, setViewport] = useState({
7373
latitude: lat ? Number(lat) : Number(defaultLat),
7474
longitude: lon ? Number(lon) : Number(defaultLon),
75-
zoom: 9,
75+
zoom: 12,
7676
pitch: 60,
7777
bearing: -60,
7878
})

0 commit comments

Comments
 (0)