Some checks failed
CI / Lint, Unit & Integration Tests (push) Has been cancelled
Add a "Get set up" checklist to the app home page that auto-detects progress from real data (has a location, has weekly slots, has zones if on Growth+) — the one step that can't be data-detected (enabling the storefront widget in the theme editor) is a manual acknowledgment stored in Shop.settings.onboarding, reusing the JSON settings field templates.server.ts already established for widgetCopy. Add app/routes/app.help.tsx (linked from nav as "Help"): a short in-app reference on locations/slots, why enforcement is server-side, zones/rates, the dashboard, POS/checkout, and data handling — documenting only features that actually exist in this codebase. Both pass typecheck/lint/build but haven't been exercised in a live embedded admin session (documented in README); the remaining Phase 8 items (accessibility pass, performance budget, empty/loading/error-state review) are deferred to that live pass rather than guessed at blind. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import type { HeadersFunction, LoaderFunctionArgs } from "@remix-run/node";
|
|
import { Link, Outlet, useLoaderData, useRouteError } from "@remix-run/react";
|
|
import { boundary } from "@shopify/shopify-app-remix/server";
|
|
import { AppProvider } from "@shopify/shopify-app-remix/react";
|
|
import { NavMenu } from "@shopify/app-bridge-react";
|
|
import polarisStyles from "@shopify/polaris/build/esm/styles.css?url";
|
|
|
|
import { authenticate } from "../shopify.server";
|
|
|
|
export const links = () => [{ rel: "stylesheet", href: polarisStyles }];
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
await authenticate.admin(request);
|
|
|
|
return { apiKey: process.env.SHOPIFY_API_KEY || "" };
|
|
};
|
|
|
|
export default function App() {
|
|
const { apiKey } = useLoaderData<typeof loader>();
|
|
|
|
return (
|
|
<AppProvider isEmbeddedApp apiKey={apiKey}>
|
|
<NavMenu>
|
|
<Link to="/app" rel="home">
|
|
Home
|
|
</Link>
|
|
<Link to="/app/locations">Locations</Link>
|
|
<Link to="/app/slots">Weekly slots</Link>
|
|
<Link to="/app/blackouts">Blackout dates</Link>
|
|
<Link to="/app/zones">Delivery zones</Link>
|
|
<Link to="/app/rates">Delivery rates</Link>
|
|
<Link to="/app/dashboard">Dispatch dashboard</Link>
|
|
<Link to="/app/billing">Billing</Link>
|
|
<Link to="/app/help">Help</Link>
|
|
</NavMenu>
|
|
<Outlet />
|
|
</AppProvider>
|
|
);
|
|
}
|
|
|
|
// Shopify needs Remix to catch some thrown responses, so that their headers are included in the response.
|
|
export function ErrorBoundary() {
|
|
return boundary.error(useRouteError());
|
|
}
|
|
|
|
export const headers: HeadersFunction = (headersArgs) => {
|
|
return boundary.headers(headersArgs);
|
|
};
|