Skip to content

fix: repair broken catalog images and seed full crop catalog + payment ledger - #1

Open
leandrogavidia wants to merge 1 commit into
jjslcripto:mainfrom
leandrogavidia:main
Open

fix: repair broken catalog images and seed full crop catalog + payment ledger#1
leandrogavidia wants to merge 1 commit into
jjslcripto:mainfrom
leandrogavidia:main

Conversation

@leandrogavidia

Copy link
Copy Markdown

Body:

image

The deployed inventory ("Mi Inventario de Cultivos") showed a broken image
and an incorrect one. Root cause: both preset crops in presetCrops.ts
pointed at bad Unsplash URLs.

  • Lechuga Romana → its Unsplash photo returned HTTP 404 → broken-image icon.

  • Albahaca Genovesa → loaded, but the photo was actually bananas (wrong content).

  • Lechuga Romana → its Unsplash photo returned HTTP 404 → broken-image icon.

  • Albahaca Genovesa → loaded, but the photo was actually bananas (wrong content).

This PR fixes the images, replaces the 2 placeholder crops with the real
catalog, hardens image loading against future dead links, and seeds the
Solana payment ledger with default records.

Changes

Crop catalog (src/presetCrops.ts)

  • Replaced the 2 broken placeholders with 11 crops: Papaya, Prontoalivio,
    Aguacate (Palta), Yuca, Plátano Bizcochito, Bananito, Café, Toronjil, Yuca,
    Tomate, Caña de azúcar.
  • Each entry has scientific name, full Spanish description, care level,
    sunlight/water/harvest info, prices and stock.
  • All images are now Wikimedia-hosted (stable, won't 404 like Unsplash).
    Every image was downloaded and visually verified for correct content.

Resilient image loading (src/App.tsx)

  • Added an onError fallback to all crop <img> tags. If any external image
    ever fails, it degrades to an inline SVG placeholder instead of a broken icon.

Solana Ledger (src/presetTransactions.ts)

  • Seeded the "Registro de Pagos" with 2 default records (Café x2 = 10.8 USDC,
    Café x1 = 4.59 USDC), wired as the default state when no transactions are
    saved (mirrors the crop-preset pattern).

Notes / follow-ups

  • localStorage caching: the catalog and ledger load from localStorage
    (solana_huerto_crops, solana_huerto_txs) first and only fall back to the
    presets when empty. Returning browsers must clear those keys to see the new
    data; fresh/incognito sessions see it immediately.
  • Prices & stock are placeholder defaults (illegible in source screenshots);
    editable in-app.
  • One crop pending: a 12th crop was cut off below the fold in the source
    screenshots and still needs to be added.
  • Sales volume now reflects only the 2 seeded transactions (≈ $15.39).

- Implemented a fallback image for broken image URLs in App component.
- Added handleImageError function to replace broken images with a fallback.
- Updated presetCrops with new crop entries including Papaya, Prontoalivio, and others.
- Introduced presetTransactions to provide initial transaction data for Solana Pay demo.
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

@leandrogavidia is attempting to deploy a commit to the jjslcripto's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant