From a651bd3ec472b62370a141c40ca859c824f9d5e3 Mon Sep 17 00:00:00 2001 From: NotII <46204250+NotII@users.noreply.github.com> Date: Sun, 6 Apr 2025 15:39:37 +0100 Subject: [PATCH] fix --- app/dashboard/chats/[id]/page.tsx | 5 ++-- app/dashboard/chats/new/page.tsx | 11 ++++++++- app/dashboard/promotions/page.tsx | 11 ++++++++- app/layout.tsx | 16 +++++++------ app/not-found.tsx | 40 +++++++++++++++++++++++++++++++ scripts/fix-metadata.js | 1 - 6 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 app/not-found.tsx diff --git a/app/dashboard/chats/[id]/page.tsx b/app/dashboard/chats/[id]/page.tsx index a4f82af..a2408cb 100644 --- a/app/dashboard/chats/[id]/page.tsx +++ b/app/dashboard/chats/[id]/page.tsx @@ -8,10 +8,11 @@ export const metadata: Metadata = { description: "View and respond to customer messages", }; -export default function ChatDetailPage({ params }: { params: { id: string } }) { +export default async function ChatDetailPage({ params }: { params: { id: string } }) { + const chatId = await params.id; return ( - + ); } \ No newline at end of file diff --git a/app/dashboard/chats/new/page.tsx b/app/dashboard/chats/new/page.tsx index df117d8..bae11da 100644 --- a/app/dashboard/chats/new/page.tsx +++ b/app/dashboard/chats/new/page.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import NewChatForm from "@/components/dashboard/NewChatForm"; import Dashboard from "@/components/dashboard/dashboard"; @@ -8,6 +8,15 @@ export const metadata: Metadata = { description: "Begin a new conversation with a customer", }; +export const viewport: Viewport = { + width: "device-width", + initialScale: 1, + themeColor: [ + { media: "(prefers-color-scheme: dark)", color: "#000000" }, + { media: "(prefers-color-scheme: light)", color: "#D53F8C" }, + ], +}; + export default function NewChatPage() { return ( diff --git a/app/dashboard/promotions/page.tsx b/app/dashboard/promotions/page.tsx index 407a1c0..625ef32 100644 --- a/app/dashboard/promotions/page.tsx +++ b/app/dashboard/promotions/page.tsx @@ -1,6 +1,6 @@ import { Suspense } from "react"; import Dashboard from "@/components/dashboard/dashboard"; -import { Metadata } from "next"; +import { Metadata, Viewport } from "next"; import PromotionsList from "@/components/dashboard/promotions/PromotionsList"; import PromotionsPageSkeleton from "@/components/dashboard/promotions/PromotionsPageSkeleton"; @@ -9,6 +9,15 @@ export const metadata: Metadata = { description: "Manage promotion codes for your store on Ember Market" }; +export const viewport: Viewport = { + width: "device-width", + initialScale: 1, + themeColor: [ + { media: "(prefers-color-scheme: dark)", color: "#000000" }, + { media: "(prefers-color-scheme: light)", color: "#D53F8C" }, + ], +}; + export default function PromotionsPage() { return ( diff --git a/app/layout.tsx b/app/layout.tsx index acdda23..923f313 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,10 +4,11 @@ import { ThemeProvider } from "@/components/layout/theme-provider" import { Toaster } from "sonner" import type React from "react" import KeepOnline from "@/components/KeepOnline" +import { Metadata, Viewport } from "next" const inter = Inter({ subsets: ["latin"] }) -export const metadata = { +export const metadata: Metadata = { title: "Ember | E-Commerce Management Platform", description: "Transform your e-commerce experience with Ember, a comprehensive platform that integrates secure cryptocurrency payments, efficient order management, and advanced analytics to help you optimize performance, boost sales, and expand your customer base", keywords: "e-commerce, marketplace, cryptocurrency payments, order management, vendor platform, online business", @@ -56,16 +57,17 @@ export const metadata = { description: "Streamlined e-commerce management with secure cryptocurrency payments", images: ["/twitter-image.jpg"], }, - viewport: { - width: "device-width", - initialScale: 1, - maximumScale: 1, - }, +} + +export const viewport: Viewport = { + width: "device-width", + initialScale: 1, + maximumScale: 1, themeColor: [ { media: "(prefers-color-scheme: dark)", color: "#000000" }, { media: "(prefers-color-scheme: light)", color: "#D53F8C" }, ], -} +}; export default function RootLayout({ children, diff --git a/app/not-found.tsx b/app/not-found.tsx new file mode 100644 index 0000000..457f036 --- /dev/null +++ b/app/not-found.tsx @@ -0,0 +1,40 @@ +import { Metadata, Viewport } from "next"; +import Link from "next/link"; +import { buttonVariants } from "@/components/ui/button"; +import { ArrowLeft } from "lucide-react"; + +export const metadata: Metadata = { + title: "Page Not Found | Ember Market", + description: "The page you're looking for doesn't exist or has been moved.", +}; + +export const viewport: Viewport = { + width: "device-width", + initialScale: 1, + themeColor: [ + { media: "(prefers-color-scheme: dark)", color: "#000000" }, + { media: "(prefers-color-scheme: light)", color: "#D53F8C" }, + ], +}; + +export default function NotFound() { + return ( +
+
+

404

+

Page Not Found

+

+ The page you're looking for doesn't exist or has been moved. +

+
+ + + + Back to Home + +
+ ); +} diff --git a/scripts/fix-metadata.js b/scripts/fix-metadata.js index 8e1347f..df9439d 100644 --- a/scripts/fix-metadata.js +++ b/scripts/fix-metadata.js @@ -1,6 +1,5 @@ const fs = require('fs'); const path = require('path'); -const glob = require('glob'); // Define default viewport and themeColor values const defaultViewport = {