Skip to content

Commit 975ef60

Browse files
authored
Merge pull request #838 from Temi-suwa18/fix/issues-780-784-785-791
Fix #780, #784, #785, #791: next/image migration, react-hook-form + react-query proofs-of-concept, config drift
2 parents 933b8d5 + 875e117 commit 975ef60

14 files changed

Lines changed: 311 additions & 194 deletions

File tree

frontend/next.config.mjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3+
images: {
4+
remotePatterns: [
5+
{
6+
protocol: "https",
7+
// Wildcard subdomain — matches any Supabase project's Storage host,
8+
// since the project ref (NEXT_PUBLIC_SUPABASE_URL) differs per deployment.
9+
hostname: "**.supabase.co",
10+
pathname: "/storage/v1/object/**",
11+
},
12+
{
13+
// avatarUrl can also come from GitHub profile import (backend/src/app.ts
14+
// ghData.avatarUrl), which next/image also needs allowlisted.
15+
protocol: "https",
16+
hostname: "avatars.githubusercontent.com",
17+
},
18+
],
19+
},
320
webpack: (config, { isServer }) => {
421
if (!isServer) {
522
config.resolve.fallback = {

frontend/package-lock.json

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111
"test:e2e": "playwright test"
1212
},
1313
"dependencies": {
14+
"@hookform/resolvers": "^5.4.0",
1415
"@stellar/freighter-api": "^4.1.0",
1516
"@stellar/stellar-sdk": "^13.3.0",
17+
"@tanstack/react-query": "^5.101.4",
1618
"clsx": "^2.1.1",
1719
"framer-motion": "^12.38.0",
1820
"lucide-react": "^1.7.0",
1921
"next": "14.2.35",
2022
"qrcode.react": "^4.2.0",
2123
"react": "^18.3.1",
2224
"react-dom": "^18.3.1",
25+
"react-hook-form": "^7.82.0",
2326
"recharts": "^3.8.1",
24-
"tailwind-merge": "^3.5.0"
27+
"tailwind-merge": "^3.5.0",
28+
"zod": "^4.4.3"
2529
},
2630
"devDependencies": {
2731
"@playwright/test": "^1.61.1",

frontend/src/app/dashboard/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
import { motion } from "framer-motion";
1414
import { formatRateLimitedMessage, parseRateLimitInfo } from "@/lib/rate-limit";
1515
import { apiFetch } from "@/lib/api-client";
16-
17-
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:4000";
16+
import { API_BASE_URL } from "@/lib/config";
1817

1918
interface Stats {
2019
totalEarned: number;

frontend/src/app/explore/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { useState, useEffect, useRef } from "react";
44
import Link from "next/link";
5+
import Image from "next/image";
56
import { API_BASE_URL } from "@/lib/config";
67
import { useInfiniteScroll } from "@/hooks/use-infinite-scroll";
78
import { EmptyState } from "@/components/empty-state";
@@ -223,9 +224,11 @@ export default function ExplorePage() {
223224
className="rounded-[2rem] border border-white/10 bg-white/5 p-6 transition hover:border-mint/30 hover:bg-white/10"
224225
>
225226
{profile.avatarUrl ? (
226-
<img
227+
<Image
227228
src={profile.avatarUrl}
228229
alt={profile.displayName}
230+
width={80}
231+
height={80}
229232
className="h-20 w-20 rounded-full object-cover mb-4"
230233
/>
231234
) : (

frontend/src/app/layout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Metadata } from "next";
22
import { SITE_URL } from "@/lib/config";
3+
import { Providers } from "./providers";
34
import "./globals.css";
45

56
export const metadata: Metadata = {
@@ -47,7 +48,9 @@ export default function RootLayout({
4748
}}
4849
/>
4950
</head>
50-
<body>{children}</body>
51+
<body>
52+
<Providers>{children}</Providers>
53+
</body>
5154
</html>
5255
);
5356
}

frontend/src/app/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from "next/link";
2+
import Image from "next/image";
23
import { AppShell } from "@/components/app-shell";
34
import { ProfileCard } from "@/components/profile-card";
45

@@ -175,9 +176,11 @@ export default async function HomePage() {
175176
>
176177
<div className="flex items-center gap-3">
177178
{profile.avatarUrl ? (
178-
<img
179+
<Image
179180
src={profile.avatarUrl}
180181
alt={profile.displayName}
182+
width={40}
183+
height={40}
181184
className="h-10 w-10 rounded-full object-cover"
182185
/>
183186
) : (

0 commit comments

Comments
 (0)