@openeventkit/event-site 2.0.108-beta.9 → 2.0.109

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.
@@ -1,21 +1,12 @@
1
- import path, { dirname } from "path";
2
- import dotenv from "dotenv";
3
- import { createRequire } from "module";
4
- import { fileURLToPath } from "url";
5
- import remarkGfm from "remark-gfm";
1
+ const path = require("path");
6
2
 
7
- const require = createRequire(import.meta.url);
8
- const __dirname = dirname(fileURLToPath(import.meta.url));
9
-
10
- dotenv.config({
3
+ require("dotenv").config({
11
4
  path: `.env.${process.env.NODE_ENV}`
12
5
  });
13
6
 
14
7
  const {
15
8
  STATIC_CONTENT_DIR_PATH,
16
- PAGES_DIR_PATH,
17
9
  CONTENT_PAGES_DIR_PATH,
18
- CONTENT_PAGES_PATH_NAME,
19
10
  SITE_SETTINGS_FILE_PATH,
20
11
  SITE_SETTINGS_DIR_PATH,
21
12
  MARKETING_SETTINGS_FILE_PATH
@@ -126,38 +117,24 @@ const plugins = [
126
117
  name: "marketingSettings"
127
118
  }
128
119
  },
129
- {
130
- resolve: "gatsby-plugin-page-creator",
131
- options: {
132
- path: path.resolve(PAGES_DIR_PATH),
133
- ignore: [`**/${CONTENT_PAGES_PATH_NAME}/**`],
134
- }
135
- },
136
120
  "gatsby-plugin-image",
137
121
  "gatsby-plugin-sharp",
138
122
  "gatsby-transformer-sharp",
139
123
  "gatsby-transformer-json",
140
124
  {
141
- resolve: "gatsby-plugin-mdx",
125
+ resolve: "gatsby-transformer-remark",
142
126
  options: {
143
- extensions: [".mdx", ".md"],
144
- gatsbyRemarkPlugins: [
127
+ plugins: [
145
128
  {
146
129
  resolve: "gatsby-remark-images",
147
130
  options: {
148
- // It's important to specify the maxWidth (in pixels) of
131
+ // It"s important to specify the maxWidth (in pixels) of
149
132
  // the content container as this plugin uses this as the
150
133
  // base for generating different widths of each image.
151
134
  maxWidth: 2048
152
135
  }
153
136
  }
154
- ],
155
- mdxOptions: {
156
- remarkPlugins: [
157
- // Add GitHub Flavored Markdown (GFM) support
158
- remarkGfm
159
- ]
160
- }
137
+ ]
161
138
  }
162
139
  },
163
140
  {
@@ -214,9 +191,10 @@ const plugins = [
214
191
  "gatsby-plugin-netlify", // make sure to keep it last in the array
215
192
  ];
216
193
 
217
- const siteMetadata = {
218
- title,
219
- description
194
+ module.exports = {
195
+ siteMetadata: {
196
+ title,
197
+ description
198
+ },
199
+ plugins
220
200
  };
221
-
222
- export { siteMetadata, plugins };
package/gatsby-node.js CHANGED
@@ -22,7 +22,7 @@ const {
22
22
  SPEAKERS_IDX_FILE_PATH,
23
23
  VOTEABLE_PRESENTATIONS_FILE_PATH,
24
24
  MARKETING_SETTINGS_FILE_PATH,
25
- CONTENT_PAGES_PATH_NAME,
25
+ MAINTENANCE_FILE_PATH,
26
26
  SPONSORS_FILE_PATH,
27
27
  FONTS_SCSS_FILE_PATH
28
28
  } = require("./src/utils/filePath");
@@ -226,7 +226,7 @@ exports.onPreBootstrap = async () => {
226
226
  const summitApiBaseUrl = process.env.GATSBY_SUMMIT_API_BASE_URL;
227
227
  let marketingSettings = await SSR_getMarketingSettings(process.env.GATSBY_MARKETING_API_BASE_URL, summitId);
228
228
  const colorSettings = fs.existsSync(COLORS_FILE_PATH) ? JSON.parse(fs.readFileSync(COLORS_FILE_PATH)) : require(`./${DEFAULT_COLORS_FILE_PATH}`);
229
- const siteSettings = fs.existsSync(SITE_SETTINGS_FILE_PATH) ? JSON.parse(fs.readFileSync(SITE_SETTINGS_FILE_PATH)) : {};
229
+ const globalSettings = fs.existsSync(SITE_SETTINGS_FILE_PATH) ? JSON.parse(fs.readFileSync(SITE_SETTINGS_FILE_PATH)) : {};
230
230
 
231
231
  const config = {
232
232
  client: {
@@ -328,13 +328,13 @@ exports.onPreBootstrap = async () => {
328
328
  fs.writeFileSync(VOTEABLE_PRESENTATIONS_FILE_PATH, JSON.stringify(allVoteablePresentations), "utf8");
329
329
 
330
330
  // setting build times
331
- siteSettings.staticJsonFilesBuildTime = fileBuildTimes;
332
- siteSettings.lastBuild = Date.now();
331
+ globalSettings.staticJsonFilesBuildTime = fileBuildTimes;
332
+ globalSettings.lastBuild = Date.now();
333
333
 
334
- fs.writeFileSync(SITE_SETTINGS_FILE_PATH, JSON.stringify(siteSettings), "utf8");
334
+ fs.writeFileSync(SITE_SETTINGS_FILE_PATH, JSON.stringify(globalSettings), "utf8");
335
335
 
336
336
  // Read fonts from site settings
337
- const siteFonts = siteSettings.siteFont;
337
+ const siteFonts = globalSettings.siteFont;
338
338
 
339
339
  if(siteFonts && Object.keys(siteFonts).length > 0) {
340
340
  // Generate the SCSS file
@@ -360,56 +360,85 @@ exports.createSchemaCustomization = ({ actions }) => {
360
360
 
361
361
  exports.onCreateNode = ({ node, actions, getNode }) => {
362
362
  const { createNodeField } = actions;
363
- if (node.internal.type === "Mdx") {
363
+ if (node.internal.type === "MarkdownRemark") {
364
364
  const value = createFilePath({ node, getNode });
365
365
  createNodeField({
366
366
  name: "slug",
367
367
  node,
368
- value
368
+ value,
369
369
  })
370
370
  }
371
371
  };
372
372
 
373
- exports.createPages = async ({ actions, graphql }) => {
373
+ exports.createPages = ({ actions, graphql }) => {
374
374
  const { createPage, createRedirect } = actions;
375
375
 
376
- const result = await graphql(`
376
+ const maintenanceMode = fs.existsSync(MAINTENANCE_FILE_PATH) ?
377
+ JSON.parse(fs.readFileSync(MAINTENANCE_FILE_PATH)) : { enabled: false };
378
+
379
+ // create a catch all redirect
380
+ if (maintenanceMode.enabled) {
381
+ createRedirect({
382
+ fromPath: "/*",
383
+ toPath: "/maintenance/"
384
+ });
385
+ }
386
+
387
+ return graphql(`
377
388
  {
378
- allMdx {
379
- nodes {
380
- id
381
- fields {
382
- slug
383
- }
384
- frontmatter {
385
- templateKey
386
- }
387
- internal {
388
- contentFilePath
389
+ allMarkdownRemark(limit: 1000) {
390
+ edges {
391
+ node {
392
+ id
393
+ fields {
394
+ slug
395
+ }
396
+ frontmatter {
397
+ templateKey
398
+ }
389
399
  }
390
400
  }
391
401
  }
392
402
  }
393
- `);
403
+ `).then((result) => {
404
+ const {
405
+ errors,
406
+ data: {
407
+ allMarkdownRemark: {
408
+ edges
409
+ }
410
+ }
411
+ } = result;
412
+
413
+ if (errors) {
414
+ errors.forEach((e) => console.error(e.toString()));
415
+ return Promise.reject(errors);
416
+ }
394
417
 
395
- if (result.errors) {
396
- result.errors.forEach((e) => console.error(e.toString()));
397
- return Promise.reject(result.errors);
398
- }
418
+ edges.forEach((edge) => {
419
+ const { id, fields, frontmatter: { templateKey } } = edge.node;
420
+
421
+ var slug = fields.slug;
422
+ if (slug.match(/content-pages/)) {
423
+ slug = slug.replace("/content-pages/", "/");
424
+ }
399
425
 
400
- const nodes = result.data.allMdx.nodes;
401
-
402
- nodes.forEach((node) => {
403
- const { id, fields: { slug }, frontmatter: { templateKey }, internal: { contentFilePath } } = node;
404
- const template = require.resolve(`./src/templates/${String(templateKey)}`);
405
- // remove content pages namespace from path
406
- const path = slug.replace(`${CONTENT_PAGES_PATH_NAME}`, "/");
407
- const page = {
408
- path: path,
409
- component: `${template}?__contentFilePath=${contentFilePath}`,
410
- context: { id }
411
- };
412
- createPage(page);
426
+ const page = {
427
+ path: slug,
428
+ component: require.resolve(
429
+ `./src/templates/${String(templateKey)}.js`
430
+ ),
431
+ context: {
432
+ id,
433
+ },
434
+ };
435
+
436
+ // dont create pages if maintenance mode enabled
437
+ // gatsby disregards redirect if pages created for path
438
+ if (maintenanceMode.enabled && !page.path.match(/maintenance/)) return;
439
+
440
+ createPage(page);
441
+ });
413
442
  });
414
443
  };
415
444
 
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@openeventkit/event-site",
3
3
  "description": "Event Site",
4
- "version": "2.0.108-beta.9",
4
+ "version": "2.0.109",
5
5
  "author": "Tipit LLC",
6
6
  "dependencies": {
7
- "@mdx-js/react": "^3.0.1",
8
- "@mui/base": "^5.0.0-beta.40",
7
+ "@mui/base": "^5.0.0-alpha.114",
9
8
  "@mux/mux-player-react": "^1.14.1",
10
9
  "@ncwidgets/file-relation": "^0.8.0",
11
10
  "@ncwidgets/id": "^0.8.1",
@@ -45,20 +44,19 @@
45
44
  "font-awesome": "^4.7.0",
46
45
  "formik": "^2.2.9",
47
46
  "full-schedule-widget": "3.0.5",
48
- "gatsby": "^5.9.1",
47
+ "gatsby": "^5.8.1",
49
48
  "gatsby-alias-imports": "^1.0.6",
50
49
  "gatsby-plugin-google-tagmanager": "^5.13.1",
51
50
  "gatsby-plugin-image": "^3.8.0",
52
51
  "gatsby-plugin-manifest": "^5.12.3",
53
- "gatsby-plugin-mdx": "^5.12.3",
54
52
  "gatsby-plugin-netlify": "^5.1.0",
55
53
  "gatsby-plugin-netlify-cms": "^7.8.0",
56
- "gatsby-plugin-page-creator": "^5.13.1",
57
54
  "gatsby-plugin-sass": "^6.8.0",
58
55
  "gatsby-plugin-sharp": "^5.12.3",
59
56
  "gatsby-remark-images": "^7.8.0",
60
- "gatsby-source-filesystem": "^5.12.3",
61
- "gatsby-transformer-json": "^5.12.3",
57
+ "gatsby-source-filesystem": "^5.8.0",
58
+ "gatsby-transformer-json": "^5.8.0",
59
+ "gatsby-transformer-remark": "^6.8.0",
62
60
  "gatsby-transformer-sharp": "^5.12.3",
63
61
  "history": "^4.10.1",
64
62
  "i18n-react": "^0.6.4",
@@ -112,7 +110,7 @@
112
110
  "redux": "^4.1.2",
113
111
  "redux-persist": "^6.0.0",
114
112
  "redux-thunk": "^2.4.1",
115
- "remark-gfm": "^4.0.0",
113
+ "sanitize-html": "^2.7.0",
116
114
  "sass": "^1.49.9",
117
115
  "schedule-filter-widget": "3.0.1",
118
116
  "simple-chat-widget": "^1.0.31",
@@ -124,7 +122,7 @@
124
122
  "stream-browserify": "^3.0.0",
125
123
  "stream-chat": "^2.7.2",
126
124
  "stream-chat-react": "3.1.7",
127
- "summit-registration-lite": "5.0.30",
125
+ "summit-registration-lite": "5.0.31",
128
126
  "superagent": "8.0.9",
129
127
  "sweetalert2": "^9.17.0",
130
128
  "upcoming-events-widget": "3.0.5",
@@ -1,15 +1,8 @@
1
1
 
2
2
  module.exports = `
3
- type MdxFields {
4
- slug: String
5
- }
6
- type MdxFrontmatter {
3
+ type MarkdownRemarkFrontmatter {
7
4
  templateKey: String
8
5
  title: String
9
6
  userRequirement: String
10
7
  }
11
- type Mdx {
12
- frontmatter: MdxFrontmatter
13
- fields: MdxFields
14
- }
15
8
  `;
@@ -1,18 +1,21 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
- import ContentPageTemplate from "../../templates/content-page/template";
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import { ContentPageTemplate } from '../../templates/content-page'
4
4
 
5
- const ContentPagePreview = ({ entry, widgetFor }) =>
6
- <ContentPageTemplate
7
- title={entry.getIn(["data", "title"])}
8
- content={widgetFor("body")}
9
- />;
5
+ const ContentPagePreview = ({ entry, getAsset, widgetFor }) => {
6
+ return (
7
+ <ContentPageTemplate
8
+ title={entry.getIn(['data', 'title'])}
9
+ content={widgetFor('body')}
10
+ />
11
+ )
12
+ }
10
13
 
11
14
  ContentPagePreview.propTypes = {
12
15
  entry: PropTypes.shape({
13
- getIn: PropTypes.func
16
+ getIn: PropTypes.func,
14
17
  }),
15
- widgetFor: PropTypes.func
16
- };
18
+ getAsset: PropTypes.func,
19
+ }
17
20
 
18
- export default ContentPagePreview;
21
+ export default ContentPagePreview
@@ -0,0 +1,42 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import sanitizeHtml from 'sanitize-html';
4
+
5
+ export const HTMLContent = ({ content, className }) => {
6
+ const [cleanHTML, setCleanHTML] = useState(content);
7
+
8
+ useEffect(() => {
9
+ const clean = sanitizeHtml(content, {
10
+ // adds custom settings to default settings (https://www.npmjs.com/package/sanitize-html#default-options)
11
+ allowedTags: sanitizeHtml.defaults.allowedTags.concat(['iframe', 'img']),
12
+ allowedAttributes: {
13
+ ...sanitizeHtml.defaults.allowedAttributes,
14
+ 'iframe': ['src', 'width', 'height', 'frameborder', 'allow', 'allowfullscreen'],
15
+ 'a': ['target'],
16
+ '*': ['href', 'class']
17
+ },
18
+ exclusiveFilter: (frame) => {
19
+ // removing a and p tags with no text or media childrens
20
+ return (frame.tag === 'a' || frame.tag === 'p') && !frame.text.trim() && !frame.mediaChildren;
21
+ }
22
+ });
23
+ setCleanHTML(clean);
24
+ }, [content])
25
+
26
+ return (
27
+ <div className={className} dangerouslySetInnerHTML={{ __html: cleanHTML }} />
28
+ )
29
+ }
30
+
31
+ const Content = ({ content, className }) => (
32
+ <div className={className}>{content}</div>
33
+ )
34
+
35
+ Content.propTypes = {
36
+ content: PropTypes.node,
37
+ className: PropTypes.string,
38
+ }
39
+
40
+ HTMLContent.propTypes = Content.propTypes
41
+
42
+ export default Content
@@ -343,7 +343,7 @@ const ProfilePopupComponent = ({ userProfile, idpLoading, closePopup, showProfil
343
343
  </div>
344
344
  </div>
345
345
  <div className={`columns is-mobile ${styles.inputRow}`}>
346
- <div className='column is-one-quarter'>Twitter</div>
346
+ <div className='column is-one-quarter'>X</div>
347
347
  <div className='column is-two-thirds'>
348
348
  <input
349
349
  className={`${styles.input} ${styles.isMedium}`}
@@ -0,0 +1,5 @@
1
+ {
2
+ "enabled": false,
3
+ "title": "Site under maintenance",
4
+ "subtitle": "Please reload page shortly"
5
+ }
@@ -1 +1,50 @@
1
- {"widgets":{"chat":{"enabled":true,"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"favicon":{"asset":"icon.png"},"idpLogo":{"idpLogoDark":"","idpLogoLight":"","idpLogoAlt":""},"identityProviderButtons":[{"buttonColor":"#082238","providerLabel":"Continue with FNid","providerLogo":"logo_fn.svg","providerLogoSize":27},{"buttonColor":"#0A66C2","providerLabel":"Sign in with LinkedIn","providerParam":"linkedin","providerLogo":"logo_linkedin.svg","providerLogoSize":18},{"buttonColor":"#000000","providerLabel":"Sign in with Apple","providerParam":"apple","providerLogoSize":17,"providerLogo":"logo_apple.svg"},{"buttonColor":"#1877F2","providerLabel":"Login with Facebook","providerParam":"facebook","providerLogo":"logo_facebook.svg","providerLogoSize":20}],"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":1715959223162},{"file":"src/data/events.json","build_time":1715959234014},{"file":"src/data/events.idx.json","build_time":1715959234024},{"file":"src/data/speakers.json","build_time":1715959236830},{"file":"src/data/speakers.idx.json","build_time":1715959236832},{"file":"src/content/sponsors.json","build_time":1715959237223},{"file":"src/data/voteable-presentations.json","build_time":1715959237604}],"lastBuild":1715959237604}
1
+ {
2
+ "widgets": {
3
+ "chat": {
4
+ "enabled": true,
5
+ "showQA": false,
6
+ "showHelp": false,
7
+ "defaultScope": "page"
8
+ },
9
+ "schedule": {
10
+ "allowClick": true
11
+ }
12
+ },
13
+ "favicon": {
14
+ "asset": "icon.png"
15
+ },
16
+ "idpLogo": {
17
+ "idpLogoDark": "",
18
+ "idpLogoLight": "",
19
+ "idpLogoAlt": ""
20
+ },
21
+ "identityProviderButtons": [
22
+ {
23
+ "buttonColor": "#082238",
24
+ "providerLabel": "Continue with FNid",
25
+ "providerLogo": "logo_fn.svg",
26
+ "providerLogoSize": 27
27
+ },
28
+ {
29
+ "buttonColor": "#0A66C2",
30
+ "providerLabel": "Sign in with LinkedIn",
31
+ "providerParam": "linkedin",
32
+ "providerLogo": "logo_linkedin.svg",
33
+ "providerLogoSize": 18
34
+ },
35
+ {
36
+ "buttonColor": "#000000",
37
+ "providerLabel": "Sign in with Apple",
38
+ "providerParam": "apple",
39
+ "providerLogoSize": 17,
40
+ "providerLogo": "logo_apple.svg"
41
+ },
42
+ {
43
+ "buttonColor": "#1877F2",
44
+ "providerLabel": "Login with Facebook",
45
+ "providerParam": "facebook",
46
+ "providerLogo": "logo_facebook.svg",
47
+ "providerLogoSize": 20
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,3 @@
1
+ ---
2
+ templateKey: maintenance-page
3
+ ---
@@ -0,0 +1,92 @@
1
+ import * as React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { connect } from "react-redux";
4
+ import { graphql } from "gatsby";
5
+ import { Redirect } from "@gatsbyjs/reach-router";
6
+ import Seo from "../components/Seo";
7
+ import Layout from "../components/Layout";
8
+ import Content, { HTMLContent } from "../components/Content";
9
+ import { titleFromPathname } from "../utils/urlFormating";
10
+
11
+
12
+ import { USER_REQUIREMENTS } from "../cms/config/collections/contentPagesCollection"
13
+
14
+ export const ContentPageTemplate = ({
15
+ title,
16
+ content,
17
+ contentComponent
18
+ }) => {
19
+ const PageContent = contentComponent || Content
20
+
21
+ return (
22
+ <div className="content">
23
+ <h1>{title}</h1>
24
+ <PageContent content={content} />
25
+ </div>
26
+ )
27
+ }
28
+
29
+ ContentPageTemplate.propTypes = {
30
+ title: PropTypes.string,
31
+ content: PropTypes.string,
32
+ contentComponent: PropTypes.func,
33
+ }
34
+
35
+ const ContentPage = ({ data, isLoggedUser, hasTicket, isAuthorized }) => {
36
+ const { frontmatter: {title, userRequirement}, html } = data.markdownRemark
37
+ // if isAuthorized byoass the AUTHZ check
38
+ if (!isAuthorized && (
39
+ (userRequirement === USER_REQUIREMENTS.loggedIn && !isLoggedUser) || (userRequirement === USER_REQUIREMENTS.hasTicket && !hasTicket)
40
+ )) {
41
+ return <Redirect to='/' noThrow />
42
+ }
43
+
44
+ return (
45
+ <Layout>
46
+ <ContentPageTemplate
47
+ contentComponent={HTMLContent}
48
+ title={title}
49
+ content={html}
50
+ />
51
+ </Layout>
52
+ )
53
+ }
54
+
55
+ ContentPage.propTypes = {
56
+ data: PropTypes.shape({
57
+ markdownRemark: PropTypes.shape({
58
+ frontmatter: PropTypes.object,
59
+ }),
60
+ }),
61
+ isLoggedUser: PropTypes.bool,
62
+ hasTicket: PropTypes.bool
63
+ };
64
+
65
+ const mapStateToProps = ({ loggedUserState, userState }) => ({
66
+ isLoggedUser: loggedUserState.isLoggedUser,
67
+ hasTicket: userState.hasTicket,
68
+ isAuthorized: userState.isAuthorized
69
+ });
70
+
71
+ export default connect(mapStateToProps, null)(ContentPage);
72
+
73
+ export const contentPageQuery = graphql`
74
+ query ($id: String!) {
75
+ markdownRemark(id: { eq: $id }) {
76
+ html
77
+ frontmatter {
78
+ title
79
+ userRequirement
80
+ }
81
+ }
82
+ }
83
+ `;
84
+
85
+ export const Head = ({
86
+ location
87
+ }) => (
88
+ <Seo
89
+ title={titleFromPathname(location.pathname)}
90
+ location={location}
91
+ />
92
+ );
@@ -402,7 +402,7 @@ export const FullProfilePageTemplate = ({ user, getIDPProfile, updateProfile, up
402
402
  />
403
403
  </div>
404
404
  <div className={`column is-half ${styles.inputField}`}>
405
- <b>Twitter</b>
405
+ <b>X</b>
406
406
  <input
407
407
  className={`${styles.input} ${styles.isLarge}`}
408
408
  type="text"
@@ -0,0 +1,40 @@
1
+ import * as React from "react";
2
+ import PropTypes from "prop-types";
3
+ import maintenanceMode from "content/maintenance.json";
4
+
5
+ import HeroComponent from "../components/HeroComponent";
6
+
7
+ import "../styles/bulma.scss";
8
+
9
+ const MaintenancePageTemplate = ({
10
+ title,
11
+ subtitle
12
+ }) => {
13
+ return (
14
+ <HeroComponent
15
+ title={title}
16
+ subtitle={subtitle}
17
+ />
18
+ );
19
+ }
20
+
21
+ MaintenancePageTemplate.propTypes = {
22
+ title: PropTypes.string,
23
+ subtitle: PropTypes.string,
24
+ }
25
+
26
+ const MaintenancePage = () => {
27
+ const {
28
+ title,
29
+ subtitle
30
+ } = maintenanceMode;
31
+
32
+ return (
33
+ <MaintenancePageTemplate
34
+ title={title}
35
+ subtitle={subtitle}
36
+ />
37
+ )
38
+ };
39
+
40
+ export default MaintenancePage;
@@ -1,9 +1,7 @@
1
1
  const DATA_DIR_PATH = "src/data";
2
2
  const STATIC_CONTENT_DIR_PATH = "src/content";
3
3
  const DEFAULTS_DIR_PATH = "src/defaults";
4
- const PAGES_DIR_PATH = "src/pages";
5
- const CONTENT_PAGES_PATH_NAME = `content-pages`;
6
- const CONTENT_PAGES_DIR_PATH = `${PAGES_DIR_PATH}/${CONTENT_PAGES_PATH_NAME}`;
4
+ const CONTENT_PAGES_DIR_PATH = "src/pages/content-pages";
7
5
  const STYLES_DIR_PATH = "src/styles";
8
6
  const DEFAULT_COLORS_FILE_PATH = `${DEFAULTS_DIR_PATH}/colors.json`;
9
7
  const COLORS_FILE_PATH = `${DATA_DIR_PATH}/colors.json`;
@@ -35,6 +33,7 @@ const VOTEABLE_PRESENTATIONS_FILE_NAME = "voteable-presentations.json";
35
33
  const VOTEABLE_PRESENTATIONS_FILE_PATH = `${DATA_DIR_PATH}/${VOTEABLE_PRESENTATIONS_FILE_NAME}`;
36
34
  const POSTERS_PAGES_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/posters-pages.json`;
37
35
  const MARKETING_SETTINGS_FILE_PATH = `${DATA_DIR_PATH}/marketing-settings.json`;
36
+ const MAINTENANCE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/maintenance.json`;
38
37
  const EXPO_HALL_PAGE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/expo-hall-page/index.json`;
39
38
  const INVITATIONS_REJECT_PAGE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/invitations-reject-page/index.json`;
40
39
  const SPONSORS_FILE_NAME = "sponsors.json";
@@ -45,27 +44,25 @@ const APPLE_PAY_DOMAIN_FILE_PATH = `/static/.well-known/`
45
44
  const APPLE_PAY_DOMAIN_FILE_NAME = `apple-developer-merchantid-domain-association`;
46
45
 
47
46
  exports.REQUIRED_DIR_PATHS = [
48
- DATA_DIR_PATH,
49
- STATIC_CONTENT_DIR_PATH,
50
- CONTENT_PAGES_DIR_PATH,
51
- STYLES_DIR_PATH,
52
- SITE_SETTINGS_DIR_PATH,
53
- MARKETING_PAGE_DIR_PATH,
54
- LOBBY_PAGE_DIR_PATH,
55
- INVITATIONS_REJECT_PAGE_FILE_PATH,
56
- NAVBAR_DIR_PATH,
57
- FOOTER_DIR_PATH
47
+ DATA_DIR_PATH,
48
+ STATIC_CONTENT_DIR_PATH,
49
+ CONTENT_PAGES_DIR_PATH,
50
+ STYLES_DIR_PATH,
51
+ SITE_SETTINGS_DIR_PATH,
52
+ MARKETING_PAGE_DIR_PATH,
53
+ LOBBY_PAGE_DIR_PATH,
54
+ INVITATIONS_REJECT_PAGE_FILE_PATH,
55
+ NAVBAR_DIR_PATH,
56
+ FOOTER_DIR_PATH
58
57
  ];
59
58
  exports.STATIC_CONTENT_DIR_PATH = STATIC_CONTENT_DIR_PATH;
60
- exports.PAGES_DIR_PATH = PAGES_DIR_PATH;
61
- exports.CONTENT_PAGES_PATH_NAME = CONTENT_PAGES_PATH_NAME;
62
- exports.CONTENT_PAGES_DIR_PATH = CONTENT_PAGES_DIR_PATH;
63
59
  exports.DEFAULT_COLORS_FILE_PATH = DEFAULT_COLORS_FILE_PATH;
64
60
  exports.COLORS_FILE_PATH = COLORS_FILE_PATH;
65
61
  exports.COLORS_SASS_FILE_PATH = COLORS_SASS_FILE_PATH;
66
62
  exports.FONTS_SCSS_FILE_PATH = FONTS_SCSS_FILE_PATH;
67
63
  exports.SITE_SETTINGS_DIR_PATH = SITE_SETTINGS_DIR_PATH;
68
64
  exports.SITE_SETTINGS_FILE_PATH = SITE_SETTINGS_FILE_PATH;
65
+ exports.CONTENT_PAGES_DIR_PATH = CONTENT_PAGES_DIR_PATH;
69
66
  exports.MARKETING_PAGE_FILE_PATH = MARKETING_PAGE_FILE_PATH;
70
67
  exports.LOBBY_PAGE_FILE_PATH = LOBBY_PAGE_FILE_PATH;
71
68
  exports.ADS_FILE_PATH = ADS_FILE_PATH;
@@ -86,6 +83,7 @@ exports.VOTEABLE_PRESENTATIONS_FILE_NAME = VOTEABLE_PRESENTATIONS_FILE_NAME;
86
83
  exports.VOTEABLE_PRESENTATIONS_FILE_PATH = VOTEABLE_PRESENTATIONS_FILE_PATH;
87
84
  exports.POSTERS_PAGES_FILE_PATH = POSTERS_PAGES_FILE_PATH;
88
85
  exports.MARKETING_SETTINGS_FILE_PATH = MARKETING_SETTINGS_FILE_PATH;
86
+ exports.MAINTENANCE_FILE_PATH = MAINTENANCE_FILE_PATH;
89
87
  exports.EXPO_HALL_PAGE_FILE_PATH = EXPO_HALL_PAGE_FILE_PATH;
90
88
  exports.INVITATIONS_REJECT_PAGE_FILE_PATH = INVITATIONS_REJECT_PAGE_FILE_PATH;
91
89
  exports.SPONSORS_FILE_PATH = SPONSORS_FILE_PATH;
@@ -1,74 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import { connect } from "react-redux";
4
- import { graphql } from "gatsby";
5
- import { Redirect } from "@gatsbyjs/reach-router";
6
- import { MDXProvider } from "@mdx-js/react";
7
- import ContentPageTemplate from "./template";
8
- import Layout from "../../components/Layout";
9
- import Seo from "../../components/Seo";
10
- import { titleFromPathname } from "../../utils/urlFormating";
11
-
12
- import { USER_REQUIREMENTS } from "../../cms/config/collections/contentPagesCollection";
13
-
14
- const ContentPage = ({
15
- data,
16
- isAuthorized,
17
- isLoggedUser,
18
- hasTicket,
19
- children
20
- }) => {
21
- const { frontmatter: { title, userRequirement } } = data.mdx;
22
- if (!isAuthorized && (
23
- (userRequirement === USER_REQUIREMENTS.loggedIn && !isLoggedUser) ||
24
- (userRequirement === USER_REQUIREMENTS.hasTicket && !hasTicket)
25
- )) {
26
- return <Redirect to="/" noThrow />;
27
- }
28
- return (
29
- <Layout>
30
- <ContentPageTemplate
31
- title={title}
32
- content={children}
33
- />
34
- </Layout>
35
- );
36
- };
37
-
38
- ContentPage.propTypes = {
39
- data: PropTypes.object.isRequired,
40
- isAuthorized: PropTypes.bool.isRequired,
41
- isLoggedUser: PropTypes.bool.isRequired,
42
- hasTicket: PropTypes.bool.isRequired,
43
- children: PropTypes.node.isRequired
44
- };
45
-
46
- const mapStateToProps = ({ loggedUserState, userState }) => ({
47
- isLoggedUser: loggedUserState.isLoggedUser,
48
- hasTicket: userState.hasTicket,
49
- isAuthorized: userState.isAuthorized
50
- });
51
-
52
- const StoreConnectedContentPage = connect(mapStateToProps)(ContentPage);
53
-
54
- export default StoreConnectedContentPage;
55
-
56
- export const query = graphql`
57
- query($id: String!) {
58
- mdx(id: { eq: $id }) {
59
- frontmatter {
60
- title
61
- userRequirement
62
- }
63
- }
64
- }
65
- `;
66
-
67
- export const Head = ({
68
- location
69
- }) => (
70
- <Seo
71
- title={titleFromPathname(location.pathname)}
72
- location={location}
73
- />
74
- );
@@ -1,15 +0,0 @@
1
- // This file is intended to allow for theme extension with component shadowing.
2
- // You can add your component imports and map them here to be used as shortcodes in MDX content.
3
-
4
- // Import components here when needed
5
- // import Grid from "../../../../components/Grid";
6
- // import SpeakerCard from "../../../../components/SpeakerCard";
7
-
8
- const shortcodes = {
9
- // Map your components here
10
- // Example:
11
- // Grid,
12
- // SpeakerCard
13
- };
14
-
15
- export default shortcodes;
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
- import { MDXProvider } from "@mdx-js/react";
4
-
5
- import shortcodes from "./shortcodes";
6
-
7
- const ContentPageTemplate = ({ title, content }) => (
8
- <div className="content">
9
- <h1>{title}</h1>
10
- <MDXProvider components={shortcodes}>
11
- {content}
12
- </MDXProvider>
13
- </div>
14
- );
15
-
16
- export default ContentPageTemplate;
17
-
18
- ContentPageTemplate.propTypes = {
19
- title: PropTypes.string.isRequired,
20
- content: PropTypes.node.isRequired
21
- };