diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 00000000..8b578e60 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1,14 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/icon.png", + "sizes": "32x32", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/src/app/(dashboard)/dashboard/stores/[storeId]/analytics/page.tsx b/src/app/(dashboard)/dashboard/stores/[storeId]/analytics/page.tsx index b1582fef..1d7ffd1b 100644 --- a/src/app/(dashboard)/dashboard/stores/[storeId]/analytics/page.tsx +++ b/src/app/(dashboard)/dashboard/stores/[storeId]/analytics/page.tsx @@ -144,30 +144,28 @@ export default async function AnalyticsPage({ {dayCount && `in the last ${dayCount} days`} - -
- {customers.map((customer) => ( -
- - - - {customer.name?.slice(0, 2).toUpperCase()} - - -
-

- {customer.name} -

-

- {customer.email} -

-
-
- +${formatNumber(customer.totalSpent)} -
+ + {customers.map((customer) => ( +
+ + + + {customer.name?.slice(0, 2).toUpperCase()} + + +
+

+ {customer.name} +

+

+ {customer.email} +

- ))} -
+
+ +${formatNumber(customer.totalSpent)} +
+
+ ))}
diff --git a/src/app/(dashboard)/dashboard/stores/[storeId]/products/page.tsx b/src/app/(dashboard)/dashboard/stores/[storeId]/products/page.tsx index 303bf5ef..34b0e9cd 100644 --- a/src/app/(dashboard)/dashboard/stores/[storeId]/products/page.tsx +++ b/src/app/(dashboard)/dashboard/stores/[storeId]/products/page.tsx @@ -66,8 +66,8 @@ export default async function ProductsPage({ const toDay = to ? new Date(to) : undefined // Transaction is used to ensure both queries are executed in a single transaction - noStore() const productsPromise = db.transaction(async (tx) => { + noStore() try { const data = await tx .select({ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 5c81131d..de1e62f2 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,7 +6,7 @@ import "@/styles/globals.css" import { siteConfig } from "@/config/site" import { fontHeading, fontMono, fontSans } from "@/lib/fonts" -import { cn } from "@/lib/utils" +import { absoluteUrl, cn } from "@/lib/utils" import { Toaster } from "@/components/ui/toaster" import { Analytics } from "@/components/analytics" import { ThemeProvider } from "@/components/providers" @@ -52,6 +52,7 @@ export const metadata: Metadata = { icons: { icon: "/icon.png", }, + manifest: absoluteUrl("/site.webmanifest"), } export const viewport: Viewport = { diff --git a/src/components/blur-image.tsx b/src/components/blur-image.tsx new file mode 100644 index 00000000..14ed9d01 --- /dev/null +++ b/src/components/blur-image.tsx @@ -0,0 +1,27 @@ +"use client" + +// Original source: https://github.com/vercel/platforms/blob/main/components/blur-image.tsx +import type { ComponentProps } from "react" +import * as React from "react" +import Image from "next/image" + +import { cn } from "@/lib/utils" + +interface BlurImageProps extends ComponentProps {} + +export function BlurImage({ className, alt, ...props }: BlurImageProps) { + const [isLoading, setLoading] = React.useState(true) + + return ( + {alt} setLoading(false)} + {...props} + /> + ) +} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 3ec90eea..291d0e89 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -127,11 +127,11 @@ export function catchError(err: unknown) { const errors = err.issues.map((issue) => { return issue.message }) - return toast(errors.join("\n")) + return toast.error(errors.join("\n")) } else if (err instanceof Error) { - return toast(err.message) + return toast.error(err.message) } else { - return toast("Something went wrong, please try again later.") + return toast.error("Something went wrong, please try again later.") } }