@openstack_dev/gatsby-theme-marketing-oif-core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.eslintrc.json +27 -0
  2. package/.github/workflows/eslint.yml +15 -0
  3. package/.husky/pre-commit +4 -0
  4. package/.nvmrc +1 -0
  5. package/LICENSE.md +201 -0
  6. package/README.md +10 -0
  7. package/babel.config.json +12 -0
  8. package/gatsby-browser.js +5 -0
  9. package/gatsby-config.js +217 -0
  10. package/gatsby-node.js +162 -0
  11. package/gatsby-ssr.js +50 -0
  12. package/package.json +154 -0
  13. package/src/cms/cms-utils.js +8 -0
  14. package/src/cms/cms.js +12 -0
  15. package/src/cms/config/collections/configurationsCollection/announcementBanner/index.js +59 -0
  16. package/src/cms/config/collections/configurationsCollection/announcementBanner/typeDefs.js +11 -0
  17. package/src/cms/config/collections/configurationsCollection/footer/index.js +158 -0
  18. package/src/cms/config/collections/configurationsCollection/footer/typeDefs.js +37 -0
  19. package/src/cms/config/collections/configurationsCollection/index.js +16 -0
  20. package/src/cms/config/collections/configurationsCollection/navbar/index.js +62 -0
  21. package/src/cms/config/collections/configurationsCollection/navbar/typeDefs.js +13 -0
  22. package/src/cms/config/collections/configurationsCollection/siteSettings/index.js +117 -0
  23. package/src/cms/config/collections/configurationsCollection/siteSettings/typeDefs.js +15 -0
  24. package/src/cms/config/collections/configurationsCollection/typeDefs.js +9 -0
  25. package/src/cms/config/collections/typeDefs.js +5 -0
  26. package/src/cms/config/fields.js +268 -0
  27. package/src/cms/config/index.js +35 -0
  28. package/src/cms/config/patterns.js +51 -0
  29. package/src/cms/preview-templates/.gitkeep +0 -0
  30. package/src/cms/widgets/.gitkeep +0 -0
  31. package/src/components/AnnouncementBanner/index.js +26 -0
  32. package/src/components/AnnouncementBanner/index.module.scss +131 -0
  33. package/src/components/AnnouncementBanner/template.js +40 -0
  34. package/src/components/Footer/index.js +40 -0
  35. package/src/components/Footer/index.module.scss +59 -0
  36. package/src/components/Footer/template.js +55 -0
  37. package/src/components/Header/index.js +8 -0
  38. package/src/components/Header/template.js +5 -0
  39. package/src/components/Layout.js +32 -0
  40. package/src/components/Link.js +41 -0
  41. package/src/components/Navbar/index.js +460 -0
  42. package/src/components/Navbar/index.module.scss +301 -0
  43. package/src/components/SponsoredProjectsNav/index.js +22 -0
  44. package/src/components/SponsoredProjectsNav/index.module.scss +7 -0
  45. package/src/components/SubscribeForm/index.js +47 -0
  46. package/src/components/SubscribeForm/index.module.scss +114 -0
  47. package/src/components/Tracking/custom-bing-tracker.js +5 -0
  48. package/src/components/Tracking/custom-google-tracker.js +51 -0
  49. package/src/components/head-components.js +20 -0
  50. package/src/components/svgs/RightArrow.jsx +9 -0
  51. package/src/content/announcement-banner/OpenInfrastructureFoundation-icon-RGB.svg +1 -0
  52. package/src/content/announcement-banner/index.json +8 -0
  53. package/src/content/footer/index.json +139 -0
  54. package/src/content/navbar/index.json +304 -0
  55. package/src/content/site-settings/index.json +1 -0
  56. package/src/images/icon.png +0 -0
  57. package/src/images/openstack-logo-full.svg +57 -0
  58. package/src/images/openstack-logo-vert.svg +57 -0
  59. package/src/images/right-arrow.svg +3 -0
  60. package/src/pages/404.js +49 -0
  61. package/src/pages/auth/[...].js +36 -0
  62. package/src/pages/index.js +14 -0
  63. package/src/reducers/.gitkeep +0 -0
  64. package/src/reducers/index.js +5 -0
  65. package/src/routes/.gitkeep +0 -0
  66. package/src/routes/authorization-callback-route.js +71 -0
  67. package/src/routes/login-callback-route.js +62 -0
  68. package/src/routes/logout-callback-route.js +72 -0
  69. package/src/state/.gitkeep +0 -0
  70. package/src/state/ReduxWrapper.js +29 -0
  71. package/src/state/storage.js +21 -0
  72. package/src/state/store.js +43 -0
  73. package/src/templates/.gitkeep +0 -0
  74. package/src/theme.js +36 -0
  75. package/src/utils/cacheUtils.js +48 -0
  76. package/src/utils/cssUtils.js +62 -0
  77. package/src/utils/envVariables.js +52 -0
  78. package/src/utils/expiredToken.js +15 -0
  79. package/src/utils/filePath.js +95 -0
  80. package/static/admin/admin.css +3 -0
  81. package/static/fonts/fonts.css +65 -0
  82. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300.woff +0 -0
  83. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300.woff2 +0 -0
  84. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300italic.woff +0 -0
  85. package/static/fonts/nunito-sans/nunito-sans-v12-latin-300italic.woff2 +0 -0
  86. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600.woff +0 -0
  87. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600.woff2 +0 -0
  88. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600italic.woff +0 -0
  89. package/static/fonts/nunito-sans/nunito-sans-v12-latin-600italic.woff2 +0 -0
  90. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700.woff +0 -0
  91. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700.woff2 +0 -0
  92. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700italic.woff +0 -0
  93. package/static/fonts/nunito-sans/nunito-sans-v12-latin-700italic.woff2 +0 -0
package/gatsby-ssr.js ADDED
@@ -0,0 +1,50 @@
1
+ import * as ReactDOMServer from "react-dom/server";
2
+ import { JSDOM } from "jsdom";
3
+ import { XMLHttpRequest } from "xmlhttprequest";
4
+ import { ThemeProvider } from "@mui/material/styles";
5
+ import CssBaseline from "@mui/material/CssBaseline";
6
+ import theme from "./src/theme";
7
+ import ReduxWrapper from "./src/state/ReduxWrapper";
8
+ import { HeadComponents } from "./src/components/head-components";
9
+
10
+
11
+ export const onRenderBody = ({
12
+ setHtmlAttributes,
13
+ setHeadComponents,
14
+ setPreBodyComponents,
15
+ setPostBodyComponents,
16
+ }, pluginOptions) => {
17
+ if (process.env.NODE_ENV === `production`) {
18
+ setHeadComponents(HeadComponents);
19
+ }
20
+ };
21
+
22
+ export const replaceRenderer = ({
23
+ bodyComponent,
24
+ setHeadComponents,
25
+ replaceBodyHTMLString,
26
+ }) => {
27
+
28
+ const html = ReactDOMServer.renderToString(
29
+ <ThemeProvider theme={theme}>
30
+ <CssBaseline />
31
+ {bodyComponent}
32
+ </ThemeProvider>
33
+ );
34
+
35
+ replaceBodyHTMLString(html);
36
+ };
37
+
38
+ export const wrapRootElement = ReduxWrapper;
39
+
40
+ // build enabler polyfills
41
+ global.dom = new JSDOM("...");
42
+ global.window = dom.window;
43
+ global.document = dom.window.document;
44
+ global.navigator = global.window.navigator;
45
+ global.window.matchMedia = () => ({
46
+ matches: false,
47
+ addListener: () => {},
48
+ removeListener: () => {}
49
+ });
50
+ global.XMLHttpRequest = XMLHttpRequest;
package/package.json ADDED
@@ -0,0 +1,154 @@
1
+ {
2
+ "name": "@openstack_dev/gatsby-theme-marketing-oif-core",
3
+ "version": "1.0.0",
4
+ "description": "Base theme for Marketing Sites",
5
+ "author": "smarcet",
6
+ "keywords": [
7
+ "gatsby"
8
+ ],
9
+ "scripts": {
10
+ "clean": "find . -name \"node_modules\" -type d -prune -exec rm -rf '{}' + && yarn && yarn gatsby-clean",
11
+ "gatsby-clean": "gatsby clean",
12
+ "start": "npm run develop",
13
+ "build": "NODE_ENV=production NODE_OPTIONS=--max-old-space-size=10240 cross-env node --trace-warnings node_modules/.bin/gatsby build --log-pages",
14
+ "develop": "NODE_OPTIONS=--max-old-space-size=8192 npm run gatsby-clean && node --trace-warnings node_modules/.bin/gatsby develop --S -H 0.0.0.0",
15
+ "format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",
16
+ "prepare": "husky",
17
+ "lint": "eslint src",
18
+ "precommit": "npx lint-staged --diff=origin/main --verbose"
19
+ },
20
+ "lint-staged": {
21
+ "*.{js,jsx}": "eslint --fix",
22
+ "**/*": "prettier --write --ignore-unknown"
23
+ },
24
+ "dependencies": {
25
+ "@fortawesome/fontawesome-free": "^6.5.2",
26
+ "@mui/icons-material": "^5.15.15",
27
+ "@mui/material": "^5.15.15",
28
+ "@ncwidgets/file-relation": "^0.8.0",
29
+ "@ncwidgets/id": "^0.8.1",
30
+ "@react-pdf/renderer": "^3.1.12",
31
+ "@react-spring/web": "^9.4.3",
32
+ "@sentry/browser": "^7.39.0",
33
+ "@sentry/cli": "^2.13.0",
34
+ "@sentry/gatsby": "7.39.0",
35
+ "@sentry/integrations": "^7.39.0",
36
+ "@sentry/react": "^7.39.0",
37
+ "@sentry/webpack-plugin": "^1.20.0",
38
+ "@types/googlemaps": "^3.39.9",
39
+ "@types/markerclustererplus": "^2.1.33",
40
+ "@types/react": "^16.9.42",
41
+ "axios": "^0.19.2",
42
+ "babel-preset-gatsby": "^3.9.0",
43
+ "browser-tabs-lock": "^1.2.15",
44
+ "buffer": "^6.0.3",
45
+ "chain-function": "^1.0.1",
46
+ "classnames": "^2.3.1",
47
+ "clean-html": "^1.5.0",
48
+ "codemirror": "^5.55.0",
49
+ "core-js": "^2.6.11",
50
+ "cross-env": "^7.0.3",
51
+ "crypto-js": "^4.1.1",
52
+ "decap-cms-app": "^3.1.9",
53
+ "dotenv": "^8.2.0",
54
+ "dropzone": "^5.7.2",
55
+ "final-form": "4.20.7",
56
+ "formik": "^2.2.9",
57
+ "gatsby": "^5.8.1",
58
+ "gatsby-alias-imports": "^1.0.6",
59
+ "gatsby-plugin-cookiebot": "^1.0.3",
60
+ "gatsby-plugin-decap-cms": "^4.0.4",
61
+ "gatsby-plugin-google-fonts-v2": "^1.0.1",
62
+ "gatsby-plugin-google-tagmanager": "^5.13.1",
63
+ "gatsby-plugin-image": "^3.8.0",
64
+ "gatsby-plugin-linkedin-insight": "^1.0.1",
65
+ "gatsby-plugin-manifest": "^5.12.3",
66
+ "gatsby-plugin-netlify": "^5.1.0",
67
+ "gatsby-plugin-quantcast-tag": "^0.1.1",
68
+ "gatsby-plugin-sass": "^6.8.0",
69
+ "gatsby-plugin-sharp": "^5.12.3",
70
+ "gatsby-plugin-twitter-pixel": "^2.0.2",
71
+ "gatsby-remark-images": "^7.8.0",
72
+ "gatsby-source-filesystem": "^5.8.0",
73
+ "gatsby-transformer-json": "^5.8.0",
74
+ "gatsby-transformer-remark": "^6.8.0",
75
+ "gatsby-transformer-sharp": "^5.12.3",
76
+ "history": "^4.10.1",
77
+ "i18n-react": "^0.6.4",
78
+ "i18next": "^21.8.3",
79
+ "i18next-browser-languagedetector": "^6.1.4",
80
+ "i18next-http-backend": "^1.4.0",
81
+ "idtoken-verifier": "^2.2.2",
82
+ "image-size": "^1.0.1",
83
+ "immutability-helper": "2.9.1",
84
+ "immutable": "^5.0.0-beta.5",
85
+ "jsdom": "^16.2.2",
86
+ "lodash": "^4.17.19",
87
+ "lz-string": "^1.4.4",
88
+ "markdown-it": "^12.0.0",
89
+ "markdown-to-jsx": "^7.3.2",
90
+ "moment": "^2.27.0",
91
+ "moment-timezone": "^0.5.31",
92
+ "navigation-widget": "1.0.27",
93
+ "netlify-cms-lib-widgets": "^1.8.0",
94
+ "openstack-uicore-foundation": "^4.1.70",
95
+ "path-browserify": "^1.0.1",
96
+ "prop-types": "^15.6.0",
97
+ "react": "^18.2.0",
98
+ "react-avatar-editor": "11.0.9",
99
+ "react-block-image": "^1.0.0",
100
+ "react-bootstrap": "^0.33.1",
101
+ "react-datetime": "^2.16.3",
102
+ "react-dnd": "15.1.1",
103
+ "react-dnd-html5-backend": "^16.0.1",
104
+ "react-dom": "^18.2.0",
105
+ "react-final-form": "6.5.9",
106
+ "react-helmet": "^6.1.0",
107
+ "react-i18next": "^11.16.9",
108
+ "react-iframe-comm": "^1.2.2",
109
+ "react-immutable-proptypes": "^2.2.0",
110
+ "react-laag": "^2.0.5",
111
+ "react-medium-image-zoom": "^4.3.5",
112
+ "react-redux": "^7.2.6",
113
+ "react-rte": "^0.16.3",
114
+ "react-select": "^2.4.4",
115
+ "react-slick": "^0.27.0",
116
+ "react-star-ratings": "^2.3.0",
117
+ "react-stars": "^2.2.5",
118
+ "react-tabs": "^3.0.0",
119
+ "react-tooltip": "^3.11.6",
120
+ "react-transition-group": "^4.4.2",
121
+ "react-useportal": "^1.0.16",
122
+ "redux": "^4.1.2",
123
+ "redux-persist": "^6.0.0",
124
+ "redux-thunk": "^2.4.1",
125
+ "sanitize-html": "^2.7.0",
126
+ "sass": "^1.49.9",
127
+ "simple-oauth2": "^4.1.0",
128
+ "slick-carousel": "^1.8.1",
129
+ "smoothscroll-polyfill": "^0.4.4",
130
+ "socket.io-client": "^4.5.2",
131
+ "stream-browserify": "^3.0.0",
132
+ "superagent": "8.0.9",
133
+ "sweetalert2": "^9.17.0",
134
+ "urijs": "^1.19.2",
135
+ "use-fit-text": "^2.4.0",
136
+ "uuid": "^7.0.0",
137
+ "validator": "^9.4.1",
138
+ "what-input": "^5.2.10",
139
+ "xmlhttprequest": "^1.8.0",
140
+ "yup": "^0.32.11"
141
+ },
142
+ "devDependencies": {
143
+ "eslint": "^7.32.0 || ^8.2.0",
144
+ "eslint-config-airbnb": "^19.0.4",
145
+ "eslint-plugin-import": "^2.25.3",
146
+ "eslint-plugin-jsx-a11y": "^6.5.1",
147
+ "eslint-plugin-only-warn": "^1.1.0",
148
+ "eslint-plugin-react": "^7.28.0",
149
+ "eslint-plugin-react-hooks": "^4.3.0",
150
+ "lint-staged": "^15.1.0",
151
+ "husky": "^9.0.11",
152
+ "prettier": "^2.0.5"
153
+ }
154
+ }
@@ -0,0 +1,8 @@
1
+ if (typeof window !== "undefined") {
2
+ // add admin.css
3
+ const link = document.createElement("link");
4
+ link.type = "text/css";
5
+ link.rel = "stylesheet";
6
+ link.href = "/admin/admin.css";
7
+ document.head.appendChild(link);
8
+ }
package/src/cms/cms.js ADDED
@@ -0,0 +1,12 @@
1
+ import CMS from 'decap-cms-app'
2
+ import config from "./config";
3
+
4
+ import "./cms-utils";
5
+
6
+ import { Widget as FileRelationWidget } from "@ncwidgets/file-relation";
7
+ import { Widget as IdWidget } from "@ncwidgets/id";
8
+
9
+ CMS.init({ config });
10
+
11
+ CMS.registerWidget(IdWidget);
12
+ CMS.registerWidget(FileRelationWidget);
@@ -0,0 +1,59 @@
1
+ import { imageField, stringField } from "../../../fields";
2
+
3
+ import {
4
+ ANNOUNCEMENT_BANNER_FILE_PATH
5
+ } from "../../../../../utils/filePath";
6
+
7
+
8
+ /*
9
+ - file: "src/content/banners/announcement.json"
10
+ label: "Announcement Banner"
11
+ name: "announcement_banner"
12
+ fields:
13
+ - {label: "Title", name: "title", widget: string, required: false}
14
+ - {label: "Logo", name: "logo", widget: image, required: false}
15
+ - {label: "Text", name: "text", widget: string, required: false}
16
+ - {label: "CTA Title", name: "cta_title", widget: String, required: false}
17
+ - {label: "CTA Label", name: "cta_label", widget: String, required: false}
18
+ - {label: "CTA Link", name: "cta_link", widget: String, required: false}
19
+ */
20
+
21
+ const announcementBanner = {
22
+ label: "Announcement Banner",
23
+ name: "announcement-banner",
24
+ file: ANNOUNCEMENT_BANNER_FILE_PATH,
25
+ fields: [
26
+ stringField({
27
+ label: "Title",
28
+ name: "title",
29
+ required: false
30
+ }),
31
+ imageField({
32
+ label: "Logo",
33
+ name: "logo",
34
+ required: false
35
+ }),
36
+ stringField({
37
+ label: "Text",
38
+ name: "text",
39
+ required: false
40
+ }),
41
+ stringField({
42
+ label: "CTA Title",
43
+ name: "cta_title",
44
+ required: false
45
+ }),
46
+ stringField({
47
+ label: "CTA Label",
48
+ name: "cta_label",
49
+ required: false
50
+ }),
51
+ stringField({
52
+ label: "CTA Link",
53
+ name: "cta_link",
54
+ required: false
55
+ }),
56
+ ]
57
+ };
58
+
59
+ export default announcementBanner;
@@ -0,0 +1,11 @@
1
+
2
+ module.exports = `
3
+ type AnnouncementBannerJson implements Node {
4
+ title: String
5
+ logo: File @fileByRelativePath
6
+ text: String
7
+ cta_title: String
8
+ cta_label: String
9
+ cta_link: String
10
+ }
11
+ `;
@@ -0,0 +1,158 @@
1
+ import {
2
+ booleanField,
3
+ stringField,
4
+ objectField,
5
+ listField
6
+ } from "../../../fields";
7
+
8
+ import {
9
+ FOOTER_FILE_PATH
10
+ } from "@utils/filePath";
11
+
12
+ /*
13
+ - file: "src/content/footer.json"
14
+ label: "Footer"
15
+ name: "footer"
16
+ fields:
17
+ - {label: "Columns", name: "columns", widget: list, fields: [
18
+ {label: "Title", name: "title", widget: string},
19
+ {label: "Display", name: "display", widget: boolean, required: false},
20
+ {label: "Items", name: "items", widget: list, fields: [
21
+ {label: "Title", name: "title", widget: string},
22
+ {label: "Link", name: "link", widget: string},
23
+ ]}
24
+ ]}
25
+ - {label: "Logo", name: "logo", widget: object, fields: [
26
+ {label: "Display", name: "display", widget: boolean, required: false},
27
+ ]}
28
+ - {label: "Social", name: "social", widget: object, fields: [
29
+ {label: "Title", name: "title", widget: string},
30
+ {label: "Display", name: "display", widget: boolean, required: false},
31
+ {label: "Networks", name: "networks", widget: list, fields: [
32
+ {label: "Icon", name: "icon", widget: string},
33
+ {label: "Link", name: "link", widget: string},
34
+ {label: "Display", name: "display", widget: boolean, required: false},
35
+ ]}
36
+ ]}
37
+ - {label: "Legal", name: "legal", widget: list, fields: [
38
+ {label: "Title", name: "title", widget: string},
39
+ {label: "Link", name: "link", widget: string},
40
+ ]}
41
+ */
42
+
43
+ const footer = {
44
+ label: "Footer",
45
+ name: "footer",
46
+ file: FOOTER_FILE_PATH,
47
+ fields: [
48
+ listField({
49
+ label: "Columns",
50
+ name: "columns",
51
+ fields: [
52
+ stringField({
53
+ label: "Title",
54
+ name: "title"
55
+ }),
56
+ booleanField({
57
+ label: "Display",
58
+ name: "display",
59
+ required: false
60
+ }),
61
+ listField({
62
+ label: "Items",
63
+ name: "items",
64
+ fields: [
65
+ stringField({
66
+ label: "Title",
67
+ name: "title"
68
+ }),
69
+ stringField({
70
+ label: "Link",
71
+ name: "link"
72
+ })
73
+ ]
74
+ })
75
+ ]
76
+ }),
77
+ objectField({
78
+ label: "Logo",
79
+ name: "logo",
80
+ fields: [
81
+ booleanField({
82
+ label: "Display",
83
+ name: "display",
84
+ required: false
85
+ })
86
+ ]
87
+ }),
88
+ objectField({
89
+ label: "Social",
90
+ name: "social",
91
+ fields: [
92
+ stringField({
93
+ label: "Title",
94
+ name: "title"
95
+ }),
96
+ booleanField({
97
+ label: "Display",
98
+ name: "display",
99
+ required: false
100
+ }),
101
+ listField({
102
+ label: "Networks",
103
+ name: "networks",
104
+ fields: [
105
+ stringField({
106
+ label: "Icon",
107
+ name: "icon"
108
+ }),
109
+ stringField({
110
+ label: "Link",
111
+ name: "link"
112
+ }),
113
+ booleanField({
114
+ label: "Display",
115
+ name: "display",
116
+ required: false
117
+ })
118
+ ]
119
+ })
120
+ ]
121
+ }),
122
+ listField({
123
+ label: "Legal",
124
+ name: "legal",
125
+ fields: [
126
+ stringField({
127
+ label: "Title",
128
+ name: "title"
129
+ }),
130
+ stringField({
131
+ label: "Link",
132
+ name: "link"
133
+ })
134
+ ]
135
+ }),
136
+ objectField({
137
+ label: "Credit",
138
+ name: "credit",
139
+ fields: [
140
+ stringField({
141
+ label: "Title",
142
+ name: "title"
143
+ }),
144
+ stringField({
145
+ label: "Content",
146
+ name: "content"
147
+ }),
148
+ booleanField({
149
+ label: "Display",
150
+ name: "display",
151
+ required: false
152
+ })
153
+ ]
154
+ })
155
+ ]
156
+ };
157
+
158
+ export default footer;
@@ -0,0 +1,37 @@
1
+
2
+ module.exports = `
3
+ type Link {
4
+ title: String
5
+ link: String
6
+ }
7
+ type Networks {
8
+ icon: String
9
+ link: String
10
+ display: Boolean
11
+ }
12
+ type Social {
13
+ title: String
14
+ display: Boolean
15
+ networks: [Networks]
16
+ }
17
+ type Logo {
18
+ display: Boolean
19
+ }
20
+ type Credit {
21
+ title: String
22
+ display: Boolean
23
+ content: String
24
+ }
25
+ type Columns {
26
+ title: String
27
+ display: Boolean
28
+ items: [Link]
29
+ }
30
+ type FooterJson implements Node {
31
+ legal: [Link]
32
+ social: Social
33
+ credit: Credit
34
+ logo: Logo
35
+ columns: [Columns]
36
+ }
37
+ `;
@@ -0,0 +1,16 @@
1
+ import { collectionDefaults } from "../../patterns";
2
+
3
+ import siteSettings from "./siteSettings";
4
+ import navbar from "./navbar";
5
+ import footer from "./footer";
6
+ import announcementBanner from "./announcementBanner";
7
+
8
+ const configurationsCollection = {
9
+ ...collectionDefaults({
10
+ label: "Configurations",
11
+ name: "configurations",
12
+ }),
13
+ files: [siteSettings, navbar, footer, announcementBanner],
14
+ };
15
+
16
+ export default configurationsCollection;
@@ -0,0 +1,62 @@
1
+ import { NAVBAR_FILE_PATH } from "@utils/filePath";
2
+ import { booleanField, stringField, listField } from "../../../fields";
3
+
4
+ const navbar = {
5
+ label: "Navbar",
6
+ name: "navbar",
7
+ file: NAVBAR_FILE_PATH,
8
+ fields: [
9
+ listField({
10
+ label: "Navbar",
11
+ name: "items",
12
+ fields: [
13
+ stringField({
14
+ label: "Title",
15
+ name: "title",
16
+ }),
17
+ stringField({
18
+ label: "Link",
19
+ name: "link",
20
+ }),
21
+ booleanField({
22
+ label: "Display?",
23
+ name: "display",
24
+ required: false,
25
+ }),
26
+ booleanField({
27
+ label: "Requires Auth?",
28
+ name: "requiresAuth",
29
+ required: false,
30
+ default: false,
31
+ }),
32
+ listField({
33
+ label: "SubItems",
34
+ name: "items",
35
+ fields: [
36
+ stringField({
37
+ label: "Title",
38
+ name: "title",
39
+ }),
40
+ stringField({
41
+ label: "Link",
42
+ name: "link",
43
+ }),
44
+ booleanField({
45
+ label: "Display?",
46
+ name: "display",
47
+ required: false,
48
+ }),
49
+ booleanField({
50
+ label: "Requires Auth?",
51
+ name: "requiresAuth",
52
+ required: false,
53
+ default: false,
54
+ }),
55
+ ],
56
+ }),
57
+ ],
58
+ }),
59
+ ],
60
+ };
61
+
62
+ export default navbar;
@@ -0,0 +1,13 @@
1
+ module.exports = `
2
+ type NavbarItem {
3
+ title: String
4
+ link: String
5
+ display: Boolean
6
+ requiresAuth: Boolean
7
+ items: [NavbarItem]
8
+ }
9
+
10
+ type NavbarJson implements Node {
11
+ items: [NavbarItem]
12
+ }
13
+ `;