Files
goodgo-platform/apps/web/app/[locale]/(auth)/loading.tsx
Ho Ngoc Hai b3836d8d0f feat(notifications): wire publisher + async feature flag (GOO-173)
Phase 1 step 3 — make NotificationsPublisher available via DI and
introduce the NOTIFICATIONS_ASYNC_ENABLED flag that will gate the
listener cutover.

- NotificationsAsyncConfig: tiny injectable that reads
  NOTIFICATIONS_ASYNC_ENABLED (truthy: 1/true/yes/on, default disabled).
  Callers don't touch process.env directly; per-category rollout can be
  added later without churn in listeners.
- NotificationsModule providers/exports now include NotificationsPublisher
  and NotificationsAsyncConfig so listeners/handlers can inject them.
- Tests (14 specs on the flag + 4 on the publisher = 18 total green):
  * default disabled when unset
  * truthy parsing (1, true, TRUE, yes, on, padded)
  * falsy parsing (false, 0, no, off, empty, unknown)
  * describe() reports human-readable state

No call sites updated yet — next commit migrates the first listener
(PaymentCompletedListener pilot) onto the publisher with the flag check.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 14:26:10 +07:00

41 lines
1.6 KiB
TypeScript

export default function AuthLoading() {
return (
<div className="rounded-lg border bg-card p-8 shadow-sm" aria-busy="true" aria-label="Đang tải trang đăng nhập">
<div className="space-y-6">
{/* Logo / title skeleton */}
<div className="text-center">
<div className="mx-auto h-8 w-24 animate-pulse rounded bg-muted" />
<div className="mx-auto mt-3 h-5 w-40 animate-pulse rounded bg-muted" />
<div className="mx-auto mt-2 h-4 w-56 animate-pulse rounded bg-muted" />
</div>
{/* Form fields skeleton */}
<div className="space-y-4">
<div>
<div className="h-4 w-16 animate-pulse rounded bg-muted" />
<div className="mt-2 h-10 w-full animate-pulse rounded-md bg-muted" />
</div>
<div>
<div className="h-4 w-20 animate-pulse rounded bg-muted" />
<div className="mt-2 h-10 w-full animate-pulse rounded-md bg-muted" />
</div>
</div>
{/* Submit button skeleton */}
<div className="h-10 w-full animate-pulse rounded-md bg-muted" />
{/* OAuth buttons skeleton */}
<div className="space-y-3">
<div className="flex items-center gap-3">
<div className="h-px flex-1 bg-muted" />
<div className="h-3 w-12 animate-pulse rounded bg-muted" />
<div className="h-px flex-1 bg-muted" />
</div>
<div className="h-10 w-full animate-pulse rounded-md bg-muted" />
<div className="h-10 w-full animate-pulse rounded-md bg-muted" />
</div>
</div>
</div>
);
}