Skip to content

Commit

Permalink
cleanup of deskstructure (#633)
Browse files Browse the repository at this point in the history
* cleanup of deskstructure

* Update studio/schemas/deskStructure.ts
  • Loading branch information
anemne authored Sep 13, 2024
1 parent cac1ea9 commit 67f0689
Showing 1 changed file with 110 additions and 81 deletions.
191 changes: 110 additions & 81 deletions studio/schemas/deskStructure.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { StructureBuilder } from "sanity/structure";
import { pageBuilderID } from "./builders/pageBuilder";
import { blogId } from "./documents/blog";
//import { blogId } from "./documents/blog";
import {
TransferIcon,
UsersIcon,
CogIcon,
ControlsIcon,
ProjectsIcon,
StackCompactIcon,
InfoOutlineIcon,
HeartIcon,
SparkleIcon,
CaseIcon,
DoubleChevronRightIcon,
PinIcon,
Expand All @@ -21,86 +20,116 @@ import { compensationsId } from "./documents/compensations";
import { redirectId } from "./documents/redirect";
import { companyLocationID } from "./documents/companyLocation";

// Admin Section
const adminSection = (S: StructureBuilder) =>
S.listItem()
.title("Admin")
.icon(CaseIcon)
.child(
S.list()
.title("Company Details")
.items([
S.listItem()
.title("Company Information")
.icon(InfoOutlineIcon)
.child(
S.document()
.schemaType(companyInfoID)
.documentId(companyInfoID)
.title("Company Information"),
),
S.listItem()
.title("Company Locations")
.icon(PinIcon)
.child(
S.documentTypeList(companyLocationID).title("Company Locations"),
),
S.listItem()
.title("Legal Documents")
.icon(CogIcon)
.child(
S.documentTypeList(legalDocumentID).title("Legal Documents"),
),
]),
);

// Site Settings Section
const siteSettingSection = (S: StructureBuilder) =>
S.listItem()
.title("Site Settings")
.icon(CogIcon)
.child(
S.list()
.title("Site Settings")
.items([
S.listItem()
.title("Navigation Manager")
.icon(TransferIcon)
.child(
S.document()
.schemaType("navigationManager")
.documentId("navigationManager")
.title("Navigation Manager"),
),
S.listItem()
.title("Social Media Profiles")
.icon(UsersIcon)
.child(
S.document().schemaType(soMeLinksID).documentId(soMeLinksID),
),
S.listItem()
.title("Broken Links")
.icon(DoubleChevronRightIcon)
.child(S.documentTypeList(redirectId).title("Redirects")),
//TODO: Add SEO Settings
//TODO: Add Language selector
]),
);

// Section for dynamic and customizable Pages
const pagesSection = (S: StructureBuilder) =>
S.listItem()
.title("Pages")
.icon(ProjectsIcon)
.child(S.documentTypeList(pageBuilderID).title("Pages"));

//Section for set pages
const SpecialPagesSection = (S: StructureBuilder) =>
S.listItem()
.title("Special Pages")
.icon(SparkleIcon)
.child(
S.list()
.title("Special Pages")
.items([
// S.listItem()
// .title("Blog Overview & Settings")
// .icon(ControlsIcon)
// .child(
// S.document()
// .schemaType(blogId)
// .documentId(blogId)
// .title("Blog Overview & Settings"),
// ),
S.listItem()
.title("Compensations")
.icon(HeartIcon)
.child(
S.document()
.schemaType(compensationsId)
.documentId(compensationsId)
.title("Compensations"),
),
]),
);

// Main export
export default (S: StructureBuilder) =>
S.list()
.title("Content")
.items([
S.listItem()
.title("Company Details")
.icon(CaseIcon)
.child(
S.list()
.title("Company Details")
.items([
S.listItem()
.title("Company Information")
.icon(InfoOutlineIcon)
.child(
S.document()
.schemaType(companyInfoID)
.documentId(companyInfoID)
.title("Company Information"),
),
S.listItem()
.title("Company Locations")
.icon(PinIcon)
.child(
S.documentTypeList(companyLocationID).title(
"Company Locations",
),
),
]),
),
S.listItem()
.title("Legal Documents")
.icon(CogIcon)
.child(S.documentTypeList(legalDocumentID).title("Legal Documents")),
S.listItem()
.title("Social Media Profiles")
.icon(UsersIcon)
.child(S.document().schemaType(soMeLinksID).documentId(soMeLinksID)),
S.listItem()
.title("Navigation Manager")
.icon(TransferIcon)
.child(
S.document()
.schemaType("navigationManager")
.documentId("navigationManager")
.title("Navigation Manager"),
),
S.listItem()
.title("Dynamic Pages")
.icon(ProjectsIcon)
.child(S.documentTypeList(pageBuilderID).title("Dynamic Pages")),
S.listItem()
.title("Static Pages")
.icon(StackCompactIcon)
.child(
S.list()
.title("Static Pages")
.items([
S.listItem()
.title("Blog Overview & Settings")
.icon(ControlsIcon)
.child(
S.document()
.schemaType(blogId)
.documentId(blogId)
.title("Blog Overview & Settings"),
),
S.listItem()
.title("Compensations")
.icon(HeartIcon)
.child(
S.document()
.schemaType(compensationsId)
.documentId(compensationsId)
.title("Compensations"),
),
]),
),
S.listItem()
.title("Redirects")
.icon(DoubleChevronRightIcon)
.child(S.documentTypeList(redirectId).title("Redirects")),
adminSection(S),
siteSettingSection(S),
pagesSection(S),
SpecialPagesSection(S),
]);

0 comments on commit 67f0689

Please sign in to comment.