Move app to apps/web-react in pnpm workspace layout

This commit is contained in:
Kalle
2026-08-16 09:20:33 +03:00
parent 7e365ccfcf
commit bbc8ea57af
2913 changed files with 227 additions and 250 deletions

View File

@@ -0,0 +1,16 @@
import type { MiddlewareFunction } from "react-router";
import { viewerTimezoneAsyncLocalStorage } from "./timezone-context.server";
import { viewerTimezoneFromCookieHeader } from "./timezone-cookie";
/**
* Resolves the viewer's timezone from their cookie and makes it available to
* loaders via `getViewerTimezone` for the duration of the request.
*/
export const timezoneMiddleware: MiddlewareFunction<Response> = (
{ request },
next,
) =>
viewerTimezoneAsyncLocalStorage.run(
{ timezone: viewerTimezoneFromCookieHeader(request.headers.get("Cookie")) },
() => next(),
);