Skip to content

Add a ConfigContext and replace all inlined event copy #57

Description

@Kaushik4141

New apps/web/src/contexts/ConfigContext.tsx fetches GET /api/v1/settings once at boot, holds it in context, and exposes useConfig(). Wrap <App /> in main.tsx.

Show a spinner until it resolves. If the fetch fails, show a setup-help message naming the likely cause — a misconfigured VITE_API_URL — rather than a blank screen. That error path is most of the value here, since it is the first thing a self-deployer will hit.

Then replace the inlined copy

Each string becomes its config value, and the surrounding block hides when the value is null.

  • LoginScreen.tsx:39 event name, :51-53 tagline
  • ProgressScreen.tsx:69 logo, :76 award name, :81 "Stall Directory", :135 "all 11 stalls", :155 "All Stalls Rated!"
  • RatingScreen.tsx:66, :84, :87, :266
  • RatingScreen.tsx:270 — drop the "Innovating sustainable hardware…" fallback entirely; render nothing when the description is empty
  • CompletionScreen.tsx:72 (11/11), :82-83
  • ScannerScreen.tsx:143-144, :169
  • App.tsx:121, :260

Page title

  • apps/web/index.html:7 is still <title>web</title>, the Vite default

The title must be in the served HTML before JS runs, so it cannot come from the runtime fetch. Use a small Vite HTML transform fed by a VITE_APP_NAME build var, and add <meta name="description"> and og:title from the same source.

Blocked by the settings issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockerBlocks other work; land this firstenhancementNew feature or requestfrontendReact / web app

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions