@@ -47,4 +47,4 @@ const Client = () => {
);
};
-export default Client;
+export default AdminPage;
diff --git a/src/app/dashboard/(admin)/admin/email/_components/Toptab/index.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/Toptab/index.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/Toptab/index.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/Toptab/index.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/_components/new-template/NewTemplate.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/new-template/NewTemplate.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/new-template/NewTemplate.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/new-template/NewTemplate.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/_components/new-template/NewTemplate.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/new-template/NewTemplate.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/new-template/NewTemplate.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/new-template/NewTemplate.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/_components/page-header/index.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/page-header/index.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/page-header/index.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/page-header/index.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/_components/page-header/pageHeader.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/page-header/pageHeader.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/page-header/pageHeader.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/page-header/pageHeader.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/_components/pagination/index.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/pagination/index.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/pagination/index.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/pagination/index.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/_components/template-card/TemplateCard.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/_components/template-card/TemplateCard.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/_components/template-card/TemplateCard.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/_components/template-card/TemplateCard.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/[templateId]/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/[templateId]/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/[templateId]/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/[templateId]/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/AddLogo.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/AddLogo.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/AddLogo.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/AddLogo.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/ImageBody.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/ImageBody.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/ImageBody.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/ImageBody.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/Input.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/Input.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/Input.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/Input.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/Modal.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/Modal.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/Modal.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/Modal.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/SideEditNav.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/SideEditNav.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/SideEditNav.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/SideEditNav.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/manage-template/ManageTemplate.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/manage-template/ManageTemplate.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/manage-template/ManageTemplate.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/manage-template/ManageTemplate.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/new-template/NewTemplate.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/new-template/NewTemplate.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/new-template/NewTemplate.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/new-template/NewTemplate.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/preview-card/index.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/preview-card/index.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/_components/preview-card/index.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/_components/preview-card/index.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/edit-in-buit-templates/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/edit-in-buit-templates/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/_components/generate-field/generate-field.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/_components/generate-field/generate-field.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/_components/generate-field/generate-field.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/_components/generate-field/generate-field.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/_components/tips/index.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/_components/tips/index.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/_components/tips/index.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/_components/tips/index.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/layout.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/layout.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/layout.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/layout.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/page.testx.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/page.testx.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/page.testx.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/page.testx.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/HtmlTemplateViewer.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/HtmlTemplateViewer.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/HtmlTemplateViewer.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/HtmlTemplateViewer.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/TemplateViewer.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/TemplateViewer.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/TemplateViewer.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/TemplateViewer.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/index.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/index.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/index.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/index.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/manual.md b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/manual.md
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/manual.md
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/manual.md
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/template-example.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/template-example.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/_component.tsx/template-example.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/_component.tsx/template-example.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/page.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/page.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/page.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/page.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/generate-with-html/preview-template/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/page.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/page.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/page.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/page.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/email/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/email/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/email/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/email/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/(overview)/layout.tsx b/src/app/dashboard/(admin)/admin/(overview)/layout.tsx
new file mode 100644
index 000000000..e1b6d7de3
--- /dev/null
+++ b/src/app/dashboard/(admin)/admin/(overview)/layout.tsx
@@ -0,0 +1,18 @@
+import { Suspense } from "react";
+
+import Sidebar from "~/app/dashboard/(admin)/_components/layout/Sidebar";
+
+export default function AdminLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+
+
+
+ {children}
+
+
+ );
+}
diff --git a/src/app/dashboard/(admin)/admin/page.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/page.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/page.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/page.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/page.tsx
similarity index 58%
rename from src/app/dashboard/(admin)/admin/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/page.tsx
index 1f476ebc5..6822724ad 100644
--- a/src/app/dashboard/(admin)/admin/page.tsx
+++ b/src/app/dashboard/(admin)/admin/(overview)/page.tsx
@@ -1,4 +1,4 @@
-import Client from "./client";
+import AdminPage from "~/app/dashboard/(admin)/admin/(overview)/client";
export const metadata = {
title: "Dashboard",
@@ -6,8 +6,8 @@ export const metadata = {
"Super Admin Dashboard using ShadCN UI components, adhering to design specifications and best practices for accessibility.",
};
-const AdminDashboardPage = () => {
- return
;
+const Admin = () => {
+ return
;
};
-export default AdminDashboardPage;
+export default Admin;
diff --git a/src/app/dashboard/(admin)/admin/products/_components/ProductModal/add-product-modal.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/add-product-modal.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/_components/ProductModal/add-product-modal.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/add-product-modal.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/products/_components/ProductModal/add-product-modal.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/add-product-modal.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/_components/ProductModal/add-product-modal.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/add-product-modal.tsx
diff --git a/src/app/dashboard/(admin)/admin/products/_components/ProductModal/delete-dialog.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/delete-dialog.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/_components/ProductModal/delete-dialog.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/delete-dialog.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/products/_components/ProductModal/delete-dialog.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/delete-dialog.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/_components/ProductModal/delete-dialog.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductModal/delete-dialog.tsx
diff --git a/src/app/dashboard/(admin)/admin/products/_components/ProductTable/product-table.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductTable/product-table.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/_components/ProductTable/product-table.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductTable/product-table.tsx
diff --git a/src/app/dashboard/(admin)/admin/products/_components/ProductTable/product.table.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductTable/product.table.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/_components/ProductTable/product.table.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/_components/ProductTable/product.table.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/products/data/mock.products.ts b/src/app/dashboard/(admin)/admin/(overview)/products/data/mock.products.ts
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/data/mock.products.ts
rename to src/app/dashboard/(admin)/admin/(overview)/products/data/mock.products.ts
diff --git a/src/app/dashboard/(admin)/admin/products/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/products/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/products/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/products/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/assets/style.css b/src/app/dashboard/(admin)/admin/(overview)/users/assets/style.css
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/assets/style.css
rename to src/app/dashboard/(admin)/admin/(overview)/users/assets/style.css
diff --git a/src/app/dashboard/(admin)/admin/users/component/addUserModal.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/addUserModal.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/addUserModal.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/addUserModal.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/component/dialogue/delete-dialog.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/dialogue/delete-dialog.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/dialogue/delete-dialog.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/dialogue/delete-dialog.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/component/dialogue/delete-dialog.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/dialogue/delete-dialog.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/dialogue/delete-dialog.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/dialogue/delete-dialog.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/component/userModal.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/userModal.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/userModal.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/userModal.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/component/userTable.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/userTable.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/userTable.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/userTable.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/component/userTableBody.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/userTableBody.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/userTableBody.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/userTableBody.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/component/userTableHead.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/component/userTableHead.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/component/userTableHead.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/component/userTableHead.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/data/user-dummy-data.ts b/src/app/dashboard/(admin)/admin/(overview)/users/data/user-dummy-data.ts
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/data/user-dummy-data.ts
rename to src/app/dashboard/(admin)/admin/(overview)/users/data/user-dummy-data.ts
diff --git a/src/app/dashboard/(admin)/admin/users/page.test.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/page.test.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/page.test.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/page.test.tsx
diff --git a/src/app/dashboard/(admin)/admin/users/page.tsx b/src/app/dashboard/(admin)/admin/(overview)/users/page.tsx
similarity index 100%
rename from src/app/dashboard/(admin)/admin/users/page.tsx
rename to src/app/dashboard/(admin)/admin/(overview)/users/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/_components/layout/sidebar/index.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/_components/layout/sidebar/index.tsx
similarity index 88%
rename from src/app/dashboard/(user-dashboard)/settings/_components/layout/sidebar/index.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/_components/layout/sidebar/index.tsx
index 84b9fb5a0..223ca222a 100644
--- a/src/app/dashboard/(user-dashboard)/settings/_components/layout/sidebar/index.tsx
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/_components/layout/sidebar/index.tsx
@@ -19,37 +19,37 @@ import { FC, ForwardRefExoticComponent, RefAttributes } from "react";
const sideItems = [
{
route: "General",
- link: "/dashboard/settings",
+ link: "/dashboard/admin/settings",
icon: User,
id: "general",
},
{
route: "Account",
- link: "/dashboard/settings/account",
+ link: "/dashboard/admin/settings/account",
icon: UserRoundCog,
id: "account",
},
{
route: "Notification",
- link: "/dashboard/settings/notification",
+ link: "/dashboard/admin/settings/notification",
icon: Bell,
id: "notification",
},
{
route: "Payment Information",
- link: "/dashboard/settings/payment-information",
+ link: "/dashboard/admin/settings/payment-information",
icon: Banknote,
id: "payment-information",
},
{
route: "Data and Privacy",
- link: "/dashboard/settings/data-and-privacy",
+ link: "/dashboard/admin/settings/data-and-privacy",
icon: Database,
id: "data-and-privacy",
},
{
route: "Language and Region",
- link: "/dashboard/settings/language-and-region",
+ link: "/dashboard/admin/settings/language-and-region",
icon: Globe,
id: "language-and-region",
},
@@ -58,19 +58,19 @@ const sideItems = [
const organizationLinks = [
{
route: "Members",
- link: "/dashboard/settings/organization/members",
+ link: "/dashboard/admin/settings/organization/members",
icon: UsersIcon,
id: "members",
},
{
route: "Roles and permissions",
- link: "/dashboard/settings/organization/roles-and-permissions",
+ link: "/dashboard/admin/settings/organization/roles-and-permissions",
icon: Bell,
id: "roles-and-permissions",
},
{
route: "Integrations",
- link: "/dashboard/settings/organization/integrations",
+ link: "/dashboard/admin/settings/organization/integrations",
icon: Banknote,
id: "integrations",
},
diff --git a/src/app/dashboard/(user-dashboard)/settings/account/_component.tsx/password.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/account/_component.tsx/password.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/account/_component.tsx/password.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/account/_component.tsx/password.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/account/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/account/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/account/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/account/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/data-and-privacy/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/data-and-privacy/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/data-and-privacy/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/data-and-privacy/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/(settings)/settings/language-and-region/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/language-and-region/page.tsx
new file mode 100644
index 000000000..9dab664b7
--- /dev/null
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/language-and-region/page.tsx
@@ -0,0 +1,107 @@
+import { Button } from "~/components/ui/button";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "~/components/ui/select";
+
+const languages = [
+ { value: "en", label: "English" },
+ { value: "es", label: "Spanish" },
+ { value: "fr", label: "French" },
+];
+
+const regions = [
+ { value: "us", label: "United States" },
+ { value: "uk", label: "United Kingdom" },
+ { value: "ca", label: "Canada" },
+];
+
+const timeZones = [
+ { value: "utc+0", label: "(UTC+00:00) Coordinated Universal Time" },
+ { value: "utc+8", label: "(UTC+08:00) Beijing, Hong Kong, Singapore" },
+ { value: "utc-5", label: "(UTC-05:00) Eastern Time (US & Canada)" },
+ { value: "utc-8", label: "(UTC-08:00) Pacific Time (US & Canada)" },
+];
+
+const LanguageRegion = () => {
+ return (
+ <>
+
+
+ Language & Region
+
+
+ Customize your language and region preferences
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default LanguageRegion;
diff --git a/src/app/dashboard/(user-dashboard)/settings/layout.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/layout.tsx
similarity index 75%
rename from src/app/dashboard/(user-dashboard)/settings/layout.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/layout.tsx
index 4d0896c29..7a435a806 100644
--- a/src/app/dashboard/(user-dashboard)/settings/layout.tsx
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/layout.tsx
@@ -9,9 +9,7 @@ const layout: FC
= ({ children }) => {
return (
-
- {children}
-
+
{children}
);
};
diff --git a/src/app/dashboard/(user-dashboard)/settings/notification/_action/notification-store.ts b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_action/notification-store.ts
similarity index 97%
rename from src/app/dashboard/(user-dashboard)/settings/notification/_action/notification-store.ts
rename to src/app/dashboard/(admin)/admin/(settings)/settings/notification/_action/notification-store.ts
index 8c84698e3..d489c7456 100644
--- a/src/app/dashboard/(user-dashboard)/settings/notification/_action/notification-store.ts
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_action/notification-store.ts
@@ -2,7 +2,6 @@ import create from "zustand";
import { notificationSettingsProperties } from "../_types/notification-settings.types";
-// Define the Zustand store
interface NotificationStore {
settings: notificationSettingsProperties;
updateSettings: (
diff --git a/src/app/dashboard/(user-dashboard)/settings/notification/_action/notification.ts b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_action/notification.ts
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/notification/_action/notification.ts
rename to src/app/dashboard/(admin)/admin/(settings)/settings/notification/_action/notification.ts
diff --git a/src/app/dashboard/(user-dashboard)/settings/notification/_components/header.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_components/header.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/notification/_components/header.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/notification/_components/header.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/notification/_components/notification-switch-box.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_components/notification-switch-box.tsx
similarity index 93%
rename from src/app/dashboard/(user-dashboard)/settings/notification/_components/notification-switch-box.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/notification/_components/notification-switch-box.tsx
index 4a7271842..bd1387604 100644
--- a/src/app/dashboard/(user-dashboard)/settings/notification/_components/notification-switch-box.tsx
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_components/notification-switch-box.tsx
@@ -7,7 +7,7 @@ interface IProperties {
name: keyof notificationSettingsProperties;
isChecked: boolean;
onToggle: (name: keyof notificationSettingsProperties) => void;
- className?: string; // Add className as an optional property
+ className?: string;
}
export const NotificationSwitchBox = ({
diff --git a/src/app/dashboard/(user-dashboard)/settings/notification/_types/notification-settings.types.ts b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/_types/notification-settings.types.ts
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/notification/_types/notification-settings.types.ts
rename to src/app/dashboard/(admin)/admin/(settings)/settings/notification/_types/notification-settings.types.ts
diff --git a/src/app/dashboard/(user-dashboard)/settings/notification/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/notification/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/notification/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/notification/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/language-and-region/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/integrations/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/language-and-region/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/organization/integrations/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/organization/members/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/members/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/organization/members/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/organization/members/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/organization/roles-and-permissions/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/roles-and-permissions/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/organization/roles-and-permissions/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/organization/roles-and-permissions/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx
diff --git a/src/app/dashboard/(user-dashboard)/settings/organization/integrations/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/payment-information/page.tsx
similarity index 100%
rename from src/app/dashboard/(user-dashboard)/settings/organization/integrations/page.tsx
rename to src/app/dashboard/(admin)/admin/(settings)/settings/payment-information/page.tsx
diff --git a/src/app/dashboard/(admin)/admin/settings/page.tsx b/src/app/dashboard/(admin)/admin/settings/page.tsx
deleted file mode 100644
index 3659df6ca..000000000
--- a/src/app/dashboard/(admin)/admin/settings/page.tsx
+++ /dev/null
@@ -1,191 +0,0 @@
-"use client";
-
-import Image from "next/image";
-import { useRef, useState } from "react";
-
-import { Button } from "~/components/ui/button";
-
-const AdminSettings = () => {
- const [profileUrl, setProfileUrl] = useState("");
- const fileUploaderReference = useRef(null);
- const handleImageUpload = () => {
- if (fileUploaderReference.current !== null) {
- fileUploaderReference.current.click();
- }
- };
- const displayUploadedImg = async () => {
- if (
- fileUploaderReference.current !== null &&
- fileUploaderReference.current.files !== null
- ) {
- const uploadedFile = fileUploaderReference.current?.files[0];
- const cachedURL = URL?.createObjectURL(uploadedFile);
- setProfileUrl(cachedURL);
- }
- };
- return (
- <>
-
-
-
-
-
-
- {profileUrl === "" ? (
-
CN
- ) : (
- ""
- )}
-
-
-
- Upload your photo
-
-
- Please help your teammates recognize you
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Maximum of 64 characters
-
-
-
-
-
-
-
- >
- );
-};
-
-export default AdminSettings;
diff --git a/src/app/dashboard/(admin)/layout.tsx b/src/app/dashboard/(admin)/layout.tsx
index f348cb15d..9d4b79dfe 100644
--- a/src/app/dashboard/(admin)/layout.tsx
+++ b/src/app/dashboard/(admin)/layout.tsx
@@ -1,7 +1,7 @@
import { Suspense } from "react";
+import Providers from "~/components/providers";
import DashboardNavbar from "./_components/layout/navbar";
-import Sidebar from "./_components/layout/Sidebar";
export default function AdminLayout({
children,
@@ -9,9 +9,9 @@ export default function AdminLayout({
children: React.ReactNode;
}) {
return (
-
-
+
+
{children}
diff --git a/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx b/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx
index 51dcef30d..e30fbd1af 100644
--- a/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx
+++ b/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx
@@ -2,7 +2,7 @@
import { BellIcon, HelpCircle } from "lucide-react";
import { useSession } from "next-auth/react";
-import { useRouter } from "next/navigation";
+import { useRouter } from "next-nprogress-bar";
import { useEffect } from "react";
import DashboardLogo from "~/app/dashboard/(admin)/_components/layout/logo";
@@ -17,8 +17,37 @@ import {
PopoverTrigger,
} from "~/components/ui/popover";
+// const navlinks = [
+// {
+// route: "Overview",
+// link: "/dashboard/overview",
+// id: "dashboard",
+// },
+// {
+// route: "Customers",
+// link: "/dashboard/customers",
+// id: "customers",
+// },
+// {
+// route: "Products",
+// link: "/dashboard/products",
+// id: "products",
+// },
+// // {
+// // route: "Settings",
+// // link: "/dashboard/settings",
+// // id: "settings",
+// // },
+// ];
+
+// interface User {
+// email: string;
+// image: string;
+// name: string;
+// }
+
const UserNavbar = () => {
- const { data: session, status } = useSession();
+ const { status } = useSession();
const router = useRouter();
useEffect(() => {
if (status === "unauthenticated") {
@@ -73,7 +102,7 @@ const UserNavbar = () => {
/>
-
+
diff --git a/src/app/dashboard/(user-dashboard)/_components/layout/navbar/navlinks.tsx b/src/app/dashboard/(user-dashboard)/_components/layout/navbar/navlinks.tsx
index ea67b6d97..bb98a47a9 100644
--- a/src/app/dashboard/(user-dashboard)/_components/layout/navbar/navlinks.tsx
+++ b/src/app/dashboard/(user-dashboard)/_components/layout/navbar/navlinks.tsx
@@ -21,11 +21,6 @@ const links = [
link: "/dashboard/products",
id: "products",
},
- {
- route: "Settings",
- link: "/dashboard/settings",
- id: "settings",
- },
];
type NavlinksProperties = {
diff --git a/src/app/dashboard/(user-dashboard)/layout.tsx b/src/app/dashboard/(user-dashboard)/layout.tsx
index 9518eb265..17ef651bc 100644
--- a/src/app/dashboard/(user-dashboard)/layout.tsx
+++ b/src/app/dashboard/(user-dashboard)/layout.tsx
@@ -1,5 +1,6 @@
import { Suspense } from "react";
+import Providers from "~/components/providers";
import UserNavbar from "./_components/layout/navbar";
export default function AdminLayout({
@@ -9,6 +10,7 @@ export default function AdminLayout({
}) {
return (
+
{children}
diff --git a/src/app/dashboard/(user-dashboard)/settings/payment-information/page.tsx b/src/app/dashboard/(user-dashboard)/settings/payment-information/page.tsx
deleted file mode 100644
index db4d38750..000000000
--- a/src/app/dashboard/(user-dashboard)/settings/payment-information/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-const page = () => {
- return
page
;
-};
-
-export default page;
diff --git a/src/app/dashboard/(user-dashboard)/settings/payment-information/upgrade/_components/upgrade.tsx b/src/app/dashboard/(user-dashboard)/settings/payment-information/upgrade/_components/upgrade.tsx
new file mode 100644
index 000000000..8ad078e4c
--- /dev/null
+++ b/src/app/dashboard/(user-dashboard)/settings/payment-information/upgrade/_components/upgrade.tsx
@@ -0,0 +1,232 @@
+"use client";
+
+import { ArrowLeft, ChevronDown, ChevronUp } from "lucide-react";
+import Image from "next/image";
+import Link from "next/link";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+import CustomButton from "~/components/common/common-button/common-button";
+import CustomInput from "~/components/common/input/input";
+import PlanUpgradeSuccessfulModal from "~/components/common/modals/plan-upgrade-successful";
+
+const billingOption = [
+ {
+ name: "Pay monthly",
+ description: "$20/ month/member ",
+ },
+ {
+ name: "Pay yearly",
+ description: "$200/ year/member ",
+ },
+];
+
+const paymentMethod = [
+ {
+ name: "Credit Card",
+ icon: "/user-dashboard/svg/credit-card.svg",
+ width: 64,
+ },
+ {
+ name: "Stripe Payment",
+ icon: "/user-dashboard/svg/stripe-logo.svg",
+ width: 84,
+ },
+ {
+ name: "Paypal Payment",
+ icon: "/user-dashboard/svg/paypal-logo.svg",
+ width: 153,
+ },
+];
+
+const Upgrade = () => {
+ const [open, setOpen] = useState
(false);
+ const router = useRouter();
+
+ const [isDetailsVisible, setIsDetailsVisible] = useState(false);
+
+ const toggleDetails = () => {
+ setIsDetailsVisible(!isDetailsVisible);
+ };
+
+ return (
+
+
+
+
+
+
+ Upgrade to Basic
+
+
+
+ Do more with unlimited users and Integration when you upgrade
+
+
+
+
+
+
+
+
+
+
+
+
+ {billingOption.map((item, index) => (
+ -
+
+
+ ))}
+
+
+
+
+ $20 /month
+ : }
+ isRightIconVisible={true}
+ size="sm"
+ onClick={toggleDetails}
+ >
+ Details
+
+
+
+ {isDetailsVisible && (
+
+
+ Members in your workspace
+ 1
+
+
+ x$20/month/member
+ $20
+
+
+
+ Subtotal
+ $20
+
+
+ Tax if applicable
+ $20
+
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
setOpen(true)}
+ >
+ Proceed to Payment
+
+
+
+ setOpen(!open)} show={open} />
+
+ );
+};
+
+export default Upgrade;
diff --git a/src/app/dashboard/(user-dashboard)/settings/payment-information/upgrade/page.tsx b/src/app/dashboard/(user-dashboard)/settings/payment-information/upgrade/page.tsx
new file mode 100644
index 000000000..936f4f49c
--- /dev/null
+++ b/src/app/dashboard/(user-dashboard)/settings/payment-information/upgrade/page.tsx
@@ -0,0 +1,7 @@
+import Upgrade from "./_components/upgrade";
+
+const page = () => {
+ return ;
+};
+
+export default page;
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 81a2ae3fa..0dd641a48 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -21,7 +21,7 @@ export default function RootLayout({
return (
-
+
{children}
diff --git a/src/components/card/user-card.tsx b/src/components/card/user-card.tsx
index 89ba13ed3..a25b36845 100644
--- a/src/components/card/user-card.tsx
+++ b/src/components/card/user-card.tsx
@@ -1,6 +1,6 @@
import { ChevronDown } from "lucide-react";
-import type { DefaultSession } from "next-auth";
-import { signOut } from "next-auth/react";
+import { signOut, useSession } from "next-auth/react";
+import Link from "next/link";
import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar";
import {
@@ -21,31 +21,26 @@ const handleLogout = async () => {
});
};
-type UserCardProperties = {
- status: "authenticated" | "loading" | "unauthenticated";
- session: DefaultSession | null;
-};
-
-const UserCard = ({ session, status }: UserCardProperties) => {
+const UserCard = () => {
+ const { data: session, status } = useSession();
const { user } = session ?? {};
- const loading = status === "loading";
- const isAuth = status === "authenticated";
+
return (
-
+
- {user?.name}
+ {user?.first_name} {user?.last_name}
{user?.email ?? "Signed In"}
-
- Profile
- ⇧P
-
-
- Billing
- ⇧B
-
-
- New Team
-
+
+
+ Overview
+ ⇧O
+
+
+
+
+ Customers
+ ⇧C
+
+
+
+
+ Products
+ ⇧P
+
+
-
+
Log out
⇧Q
diff --git a/src/components/common/comment-component/comment-actions.tsx b/src/components/common/comment-component/comment-actions.tsx
index 83acd781d..f705337c9 100644
--- a/src/components/common/comment-component/comment-actions.tsx
+++ b/src/components/common/comment-component/comment-actions.tsx
@@ -1,10 +1,4 @@
-import {
- Forward,
- MessageCircle,
- Share2,
- ThumbsDown,
- ThumbsUp,
-} from "lucide-react";
+import { MessageCircle, Share2, ThumbsDown, ThumbsUp } from "lucide-react";
import CustomButton from "../common-button/common-button";
import ButtonWrapper from "./button-wrapper";
@@ -36,13 +30,13 @@ const CommentActions = ({
0 ? "px-2" : "pl-2 pr-4"}`}
+ className={`h-9 w-auto bg-transparent p-0.5 transition-all duration-200 ease-in-out hover:bg-primary hover:text-white ${likes > 0 ? "px-2" : "pl-2 pr-4"}`}
aria-label="Like Button"
>
{likes > 0 && (
{likes}
@@ -53,7 +47,7 @@ const CommentActions = ({
0 ? "px-[5.33px] sm:px-2" : "pl-[5.33px] pr-[10.67px] sm:pl-2 sm:pr-4"}`}
+ className={`h-9 w-auto bg-transparent p-0.5 transition-all duration-200 ease-in-out hover:bg-primary hover:text-white ${dislikes > 0 ? "px-[5.33px] sm:px-2" : "pl-[5.33px] pr-[10.67px] sm:pl-2 sm:pr-4"}`}
aria-label="Dislike Button"
>
{dislikes > 0 && (
{dislikes}
@@ -72,7 +66,7 @@ const CommentActions = ({
-
-
-
-
-
-
{type === "comment" && onReply && (
onReply?.()}>
void;
+}
+
+const PlanUpgradeFailedModal: React.FC = ({
+ show,
+ onClose,
+}) => {
+ return (
+
+ );
+};
+
+export default PlanUpgradeFailedModal;
diff --git a/src/components/common/modals/plan-upgrade-successful/index.tsx b/src/components/common/modals/plan-upgrade-successful/index.tsx
new file mode 100644
index 000000000..80e0b3c39
--- /dev/null
+++ b/src/components/common/modals/plan-upgrade-successful/index.tsx
@@ -0,0 +1,51 @@
+"use client";
+
+import React from "react";
+
+import CustomButton from "~/components/common/common-button/common-button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogOverlay,
+ DialogTitle,
+} from "~/components/ui/dialog";
+
+interface ModalProperties {
+ show: boolean;
+ onClose: () => void;
+}
+
+const PlanUpgradeSuccessfulModal: React.FC = ({
+ show,
+ onClose,
+}) => {
+ return (
+
+ );
+};
+
+export default PlanUpgradeSuccessfulModal;
diff --git a/src/components/layouts/navbar/layout.tsx b/src/components/layout.tsx
similarity index 54%
rename from src/components/layouts/navbar/layout.tsx
rename to src/components/layout.tsx
index 79c270274..b72e26461 100644
--- a/src/components/layouts/navbar/layout.tsx
+++ b/src/components/layout.tsx
@@ -1,5 +1,6 @@
"use client";
+import Providers from "~/components/providers";
import AuthProvider from "~/contexts/authContext";
export default function RootLayout({
@@ -7,5 +8,10 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
- return {children};
+ return (
+
+
+ {children}
+
+ );
}
diff --git a/src/components/layouts/BlogCards/index.tsx b/src/components/layouts/BlogCards/index.tsx
index 47cfc0eaa..85737ce22 100644
--- a/src/components/layouts/BlogCards/index.tsx
+++ b/src/components/layouts/BlogCards/index.tsx
@@ -1,6 +1,7 @@
import Image, { StaticImageData } from "next/image";
-import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
+import BlogLabel from "~/app/(landing-routes)/blog/_component/label";
+import { Card, CardHeader, CardTitle } from "~/components/ui/card";
interface BlogCardProperties {
title: string;
@@ -18,36 +19,34 @@ const BlogCard: React.FC = ({
readTime,
category,
image,
- labelClassName,
onClick,
}) => {
return (
-
-
+
+
-
- {category}
-
-
-
- {title}
+
+
+
+
+
+ {title}
-
-
-
+
{date}
{readTime} mins read
-
+
);
};
diff --git a/src/components/layouts/navbar/index.tsx b/src/components/layouts/navbar/index.tsx
index 948e8375e..1a9b9bbe7 100644
--- a/src/components/layouts/navbar/index.tsx
+++ b/src/components/layouts/navbar/index.tsx
@@ -13,7 +13,7 @@ import MobileNav from "./mobile-navbar";
const Navbar = () => {
const [scrolling, setIsScrolling] = useState
(false);
- const { data: session, status } = useSession();
+ const { status } = useSession();
const version = "v1.0";
useVersionSync(version);
@@ -75,7 +75,7 @@ const Navbar = () => {
)}
-
+ {status === "authenticated" && }
);
diff --git a/src/config/auth.config.ts b/src/config/auth.config.ts
index cd88b8fc9..d8204d7e9 100644
--- a/src/config/auth.config.ts
+++ b/src/config/auth.config.ts
@@ -105,11 +105,16 @@ export default {
}): Promise {
session.user = {
id: token.id as string,
- name: token.name as string,
- first_name: token.first_name as string,
- last_name: token.last_name as string,
+ first_name:
+ (token.first_name as string) ||
+ ((token.name ? token.name.split(" ")[0] : "") as string),
+ last_name:
+ (token.last_name as string) ||
+ ((token.name
+ ? token.name.split(" ").slice(1).join(" ")
+ : "") as string),
email: token.email as string,
- image: token.avatar_url as string,
+ image: token.picture || (token.avatar_url as string),
role: token.role as string,
access_token: token.access_token as string,
};
diff --git a/src/lib/auth.ts b/src/lib/auth.ts
index 75a591a4e..a7eaf505b 100644
--- a/src/lib/auth.ts
+++ b/src/lib/auth.ts
@@ -16,7 +16,6 @@ declare module "next-auth" {
interface Session {
user: {
id: User["id"];
- name: User["fullname"];
first_name: User["first_name"];
last_name: User["last_name"];
email: User["email"];
diff --git a/src/test/blog/comment/comment-actions.test.tsx b/src/test/blog/comment/comment-actions.test.tsx
index 0530b06f5..c6e0436e5 100644
--- a/src/test/blog/comment/comment-actions.test.tsx
+++ b/src/test/blog/comment/comment-actions.test.tsx
@@ -8,7 +8,7 @@ describe("comment actions component", () => {
const mockOnReply = vi.fn();
it('should render all buttons correctly when type is "comment"', () => {
- expect.assertions(5);
+ expect.assertions(4);
render(
{
onLike={mockOnLike}
onDislike={mockOnDislike}
onReply={mockOnReply}
+ isReplyActive={false}
/>,
);
expect(screen.getByTestId("like-button")).toBeInTheDocument();
expect(screen.getByTestId("dislike-button")).toBeInTheDocument();
expect(screen.getByTestId("share-button")).toBeInTheDocument();
- expect(screen.getByTestId("forward-button")).toBeInTheDocument();
expect(screen.getByTestId("reply-button")).toBeInTheDocument();
});
it('should render all buttons correctly when type is "reply"', () => {
- expect.assertions(5);
+ expect.assertions(4);
render(
{
dislikes={2}
onLike={mockOnLike}
onDislike={mockOnDislike}
+ isReplyActive={false}
/>,
);
expect(screen.getByTestId("like-button")).toBeInTheDocument();
expect(screen.getByTestId("dislike-button")).toBeInTheDocument();
expect(screen.getByTestId("share-button")).toBeInTheDocument();
- expect(screen.getByTestId("forward-button")).toBeInTheDocument();
expect(screen.queryByTestId("reply-button")).not.toBeInTheDocument();
});
@@ -56,6 +56,7 @@ describe("comment actions component", () => {
onLike={mockOnLike}
onDislike={mockOnDislike}
onReply={mockOnReply}
+ isReplyActive={false}
/>,
);
@@ -74,6 +75,7 @@ describe("comment actions component", () => {
onLike={mockOnLike}
onDislike={mockOnDislike}
onReply={mockOnReply}
+ isReplyActive={false}
/>,
);
@@ -81,21 +83,4 @@ describe("comment actions component", () => {
fireEvent.click(dislikeButton);
expect(mockOnDislike).toHaveBeenCalledTimes(1);
});
-
- it('should call onReply when the reply button is clicked and type is "comment"', () => {
- expect.assertions(1);
- render(
- ,
- );
-
- fireEvent.click(screen.getByTestId("reply-button"));
- expect(mockOnReply).toHaveBeenCalledWith();
- });
});
diff --git a/src/test/blog/comment/index.test.tsx b/src/test/blog/comment/index.test.tsx
index 046fabd95..953e87249 100644
--- a/src/test/blog/comment/index.test.tsx
+++ b/src/test/blog/comment/index.test.tsx
@@ -8,8 +8,17 @@ import Comment, {
describe("comment box component", () => {
const mockSession: Session = {
- expires: "1",
- user: { email: "a", name: "skeby", image: "c" },
+ user: {
+ id: "12345",
+ name: "Current User",
+ first_name: "Current",
+ last_name: "User",
+ email: "user@example.com",
+ image: "path/to/image",
+ role: "user",
+ access_token: "some-token",
+ },
+ expires: "2100-01-01T00:00:00.000Z",
};
const defaultProps: CommentProperties = {
id: "1",