Skip to content

Commit b82a895

Browse files
committed
feat(axiom): split up portal and website tabs into separate globals
1 parent 211dac3 commit b82a895

File tree

5 files changed

+158
-196
lines changed

5 files changed

+158
-196
lines changed

apps/axiom/src/components/Nav/navIconMap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ MousePointer2,
1212
Inbox,
1313
Trophy,
1414
Flag,
15+
Shell,
1516
CalendarDays,
1617
Cpu
1718
} from 'lucide-react'
@@ -23,6 +24,7 @@ export const navIconMap: Partial<
2324
media: Image,
2425
brands: Star,
2526
users: User,
27+
portal: Shell,
2628
emails: Mail,
2729
organizerTeams: Signature,
2830
groups: PersonStanding,

libs/cms/configs/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
Users,
1818
Hackathons,
1919
} from "@/db/collections/models";
20-
import {Hackathon2025} from "@/db/globals";
20+
import { Website, Portal} from "@/db/globals";
2121
import { linkedinOAuth, githubOAuth, discordOAuth, googleOAuth } from '@/cms/auth'
2222

2323
import { formBuilderPlugin } from '@payloadcms/plugin-form-builder'
@@ -29,7 +29,8 @@ import sharp from "sharp";
2929
export const baseConfig = {
3030
defaultDepth: 3,
3131
globals: [
32-
Hackathon2025,
32+
Website,
33+
Portal
3334
],
3435
collections: [
3536
Groups,

libs/db/globals/Portal.ts

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/* eslint-disable node/prefer-global/process */
2+
import type { GlobalConfig } from "payload";
3+
4+
export const Portal: GlobalConfig = {
5+
slug: "portal",
6+
access: {
7+
read: () => true,
8+
// update: ({ req }) => req.user?.roles?.some(role => role.admin === true || role.name === 'owner'),
9+
},
10+
versions: {
11+
drafts: true,
12+
},
13+
admin: {
14+
livePreview: {
15+
url: process.env.NODE_ENV === "development" ? process.env.CUHACKING_2025_PORTAL_LOCAL_URL : process.env.CUHACKING_2025_PORTAL_PUBLIC_URL,
16+
breakpoints: [
17+
{
18+
label: "Mobile",
19+
name: "mobile",
20+
width: 320,
21+
height: 568,
22+
},
23+
],
24+
},
25+
hooks: {
26+
afterChange: [],
27+
},
28+
},
29+
fields: [
30+
{
31+
type: "collapsible",
32+
label: "Dashboard",
33+
fields: [
34+
{
35+
name: "cards",
36+
type: "array",
37+
fields: [
38+
{
39+
name: "title",
40+
type: "text",
41+
label: "Title",
42+
},
43+
],
44+
defaultValue: [
45+
{ title: "Welcome" },
46+
{ title: "Hackathon Countdown" },
47+
{ title: "Money Raised" },
48+
{ title: "Registrations" },
49+
{ title: "Sponsors - Coming Soon!!" },
50+
{ title: "Schedule - Coming Soon!!" },
51+
{ title: "Challenges - Coming Soon!!" },
52+
{ title: "More Features!! Maybe you'll add them!" },
53+
{ title: "Star our GitHub" },
54+
],
55+
},
56+
],
57+
},
58+
{
59+
name: "login",
60+
type: "text",
61+
label: "Login",
62+
},
63+
{
64+
name: "terms",
65+
type: "group",
66+
label: "Terms & Conditions",
67+
fields: [
68+
{
69+
name: "title",
70+
type: "text",
71+
label: "Title",
72+
defaultValue: "Legalities",
73+
},
74+
{
75+
name: "description",
76+
type: "text",
77+
label: "Description",
78+
defaultValue: "YO! Before we get into it, read these please.",
79+
},
80+
{
81+
name: "accordion",
82+
type: "array",
83+
fields: [
84+
{
85+
name: "title",
86+
type: "text",
87+
label: "Title",
88+
},
89+
{
90+
name: "text",
91+
type: "text",
92+
label: "Text",
93+
},
94+
{
95+
name: "checkbox",
96+
type: "checkbox",
97+
},
98+
{
99+
name: "checkboxLabel",
100+
type: "text",
101+
},
102+
],
103+
defaultValue: [
104+
{
105+
title: "MLH Code of Conduct",
106+
text:
107+
"TL;DR. Be respectful. Harassment and abuse are never tolerated. If you are in a situation that makes you uncomfortable at " +
108+
"an MLH Member Event, if the event itself creates an unsafe or inappropriate environment, or if interacting with an MLH " +
109+
"representative or event organizer makes you uncomfortable, please report it using the procedures included in this document.\n\n" +
110+
"Major League Hacking (MLH) stands for inclusivity. We believe that every single person has the right to hack in a safe and " +
111+
"welcoming environment.",
112+
checkbox: false,
113+
checkboxLabel: "I have read MLH Code of Conduct *",
114+
},
115+
{
116+
title: "MLH Terms & Conditions",
117+
text: "",
118+
checkbox: false,
119+
checkboxLabel: "I have read MLH Terms & Conditions",
120+
},
121+
{
122+
title: "MLH Privacy Policy",
123+
text: "",
124+
checkbox: false,
125+
checkboxLabel: "I have read MLH Privacy Policy",
126+
},
127+
{
128+
title: "cuHacking Terms & Conditions",
129+
text: "",
130+
checkbox: false,
131+
checkboxLabel: "I have read cuHacking Terms & Conditions",
132+
},
133+
],
134+
},
135+
],
136+
},
137+
{
138+
name: "profile",
139+
type: "text",
140+
label: "Profile",
141+
},
142+
{
143+
name: "registration",
144+
type: "text",
145+
label: "Registration",
146+
},
147+
],
148+
};

0 commit comments

Comments
 (0)