This commit is contained in:
2026-04-22 15:22:22 +07:00
parent cb5e4b0ceb
commit 0750c35e92
7 changed files with 361 additions and 776 deletions
+12 -77
View File
@@ -1,84 +1,7 @@
const mongoose = require("mongoose");
const socialLinkSchema = new mongoose.Schema(
{
platform: {
type: String,
required: true,
enum: ["linkedin", "twitter", "instagram", "youtube", "facebook"],
},
url: {
type: String,
required: true,
},
icon: String,
order: {
type: Number,
default: 0,
},
},
{ _id: false },
);
const languageSchema = new mongoose.Schema(
{
name: {
type: String,
required: true,
},
value: {
type: String,
required: true,
},
},
{ _id: false },
);
const menuItemSchema = new mongoose.Schema(
{
label: {
type: String,
required: true,
},
href: {
type: String,
required: true,
},
icon: String,
order: {
type: Number,
default: 0,
},
children: [this],
},
{ _id: false },
);
const headerSchema = new mongoose.Schema(
{
// Top bar
top: {
phone: String,
email: String,
location: String,
socialLinks: [socialLinkSchema],
languages: [languageSchema],
},
// Offcanvas
offcanvas: {
description: String,
contactInfo: {
address: String,
email: String,
workingHours: String,
phone: String,
},
},
// Menu
menu: [menuItemSchema],
// Logo
logo: {
light: String,
@@ -86,6 +9,18 @@ const headerSchema = new mongoose.Schema(
alt: String,
},
// Sign In Button
signInButton: {
label: {
type: String,
default: "Sign In",
},
href: {
type: String,
default: "/signin",
},
},
// CTA Button
ctaButton: {
label: String,