@openeventkit/event-site 1.0.25 → 1.0.29

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openeventkit/event-site",
3
3
  "description": "Event Site",
4
- "version": "1.0.25",
4
+ "version": "1.0.29",
5
5
  "author": "Tipit LLC",
6
6
  "dependencies": {
7
7
  "@mui/base": "^5.0.0-alpha.114",
@@ -116,7 +116,7 @@
116
116
  "stream-browserify": "^3.0.0",
117
117
  "stream-chat": "^2.7.2",
118
118
  "stream-chat-react": "3.1.7",
119
- "summit-registration-lite": "^4.0.12",
119
+ "summit-registration-lite": "^4.0.15",
120
120
  "superagent": "8.0.9",
121
121
  "sweetalert2": "^9.17.0",
122
122
  "upcoming-events-widget": "2.0.8",
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  booleanField,
3
+ stringField,
4
+ textField,
3
5
  imageField,
4
6
  selectField,
5
7
  selectOption,
@@ -10,36 +12,27 @@ import {
10
12
  SITE_SETTINGS_FILE_PATH
11
13
  } from "@utils/filePath";
12
14
 
13
- /*
14
- - file: "src/content/site-settings/index.json"
15
- label: "Site Settings"
16
- name: "site-settings"
17
- fields:
18
- - {label: "Favicons", name: favicons, widget: object, fields: [
19
- {label: "Favicon 180x180", name: favicon180, widget: image},
20
- {label: "Favicon 32x32", name: favicon32, widget: image},
21
- {label: "Favicon 16x16", name: favicon16, widget: image}
22
- ]}
23
- - {label: "Widgets", name: widgets, widget: object, fields: [
24
- {label: "Chat", name: chat, widget: object, fields: [
25
- {label: "Show QA", name: showQA, widget: boolean, required: false, default: false},
26
- {label: "Show Help", name: showHelp, widget: boolean, required: false, default: false},
27
- {label: "Default Filter Criteria", name: defaultScope, widget: select, required: false, default: 'page', options: [
28
- {label: "In this Room", value: "page" },
29
- {label: "All Attendees", value: "show" }
30
- ]}
31
- ]},
32
- {label: "Schedule", name: schedule, widget: object, fields: [
33
- {label: "Allow Clickable Behavior", name: allowClick, widget: boolean, required: false, default: true},
34
- ]}
35
- ]}
36
- */
37
-
38
15
  const siteSettings = {
39
16
  label: "Site Settings",
40
17
  name: "site-settings",
41
18
  file: SITE_SETTINGS_FILE_PATH,
42
19
  fields: [
20
+ objectField({
21
+ label: "Site Metadata",
22
+ name: "siteMetadata",
23
+ fields: [
24
+ stringField({
25
+ label: "title",
26
+ name: "title",
27
+ required: false
28
+ }),
29
+ textField({
30
+ label: "description",
31
+ name: "description",
32
+ required: false
33
+ })
34
+ ]
35
+ }),
43
36
  objectField({
44
37
  label: "Favicons",
45
38
  name: "favicons",
@@ -1,9 +1,13 @@
1
1
 
2
2
  module.exports = `
3
+ type SiteMetadata {
4
+ title: String
5
+ description: String
6
+ }
3
7
  type Favicons {
4
- favicon180: String
5
- favicon32: String
6
- favicon16: String
8
+ favicon180: File @fileByRelativePath
9
+ favicon32: File @fileByRelativePath
10
+ favicon16: File @fileByRelativePath
7
11
  }
8
12
  type Schedule {
9
13
  allowClick: Boolean
@@ -18,6 +22,7 @@ module.exports = `
18
22
  chat: Chat
19
23
  }
20
24
  type SiteSettingsJson implements Node {
25
+ siteMetadata: SiteMetadata
21
26
  favicons: Favicons
22
27
  widgets: Widgets
23
28
  }
@@ -1,78 +1,31 @@
1
1
  import * as React from "react";
2
2
  import { withPrefix } from "gatsby";
3
3
 
4
- /**
5
- * TODO: implement using Gatsby Head API
6
- * @see https://www.gatsbyjs.com/docs/how-to/adding-common-features/adding-seo-component/#add-sitemetadata
7
- *
8
-
9
- import useSiteMetadata from "@utils/useSiteMetadata";
10
- import useSiteSettings from "@utils/useSiteSettings";
11
-
12
- const {
13
- title,
14
- description
15
- } = useSiteMetadata();
16
- const { favicons } = useSiteSettings();
17
-
18
- <title>{`${summit.name} - ${title}`}</title>
19
- <meta key="meta-description" name="description" content={description} />
20
- <meta key="meta-theme-color" name="theme-color" content="#fff" />
21
- <meta key="meta-og-type" property="og:type" content="business.business" />
22
- <meta key="meta-og-title" property="og:title" content={title} />
23
- <meta key="meta-og-url" property="og:url" content="/" />
24
- {favicons?.favicon180 &&
25
- <link
26
- rel="apple-touch-icon"
27
- sizes="180x180"
28
- href={`${withPrefix('/')}${favicons.favicon180.substring(1)}`}
29
- />
30
- }
31
- {favicons?.favicon32 &&
32
- <link
33
- rel="icon"
34
- sizes="32x32"
35
- href={`${withPrefix('/')}${favicons.favicon32.substring(1)}`}
36
- />
37
- }
38
- {favicons?.favicon16 &&
39
- <link
40
- rel="icon"
41
- type="image/png"
42
- sizes="16x16"
43
- href={`${withPrefix('/')}${favicons.favicon16.substring(1)}`}
44
- />
45
-
46
- */
47
-
48
4
  export const HtmlAttributes = {
49
5
  lang: "en"
50
6
  };
51
7
 
52
- export const Head = () => {
53
- return (
54
- <>
55
- <link
56
- key="font-awesome"
57
- rel="stylesheet"
58
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw=="
59
- crossOrigin="anonymous"
60
- referrerPolicy="no-referrer"
61
- />
62
- <link
63
- key="awesome-bootstrap-checkbox"
64
- rel="stylesheet"
65
- href="https://cdnjs.cloudflare.com/ajax/libs/awesome-bootstrap-checkbox/1.0.2/awesome-bootstrap-checkbox.min.css" integrity="sha512-zAQ4eQ+PGbYf6BknDx0m2NhTcOnHWpMdJCFaPvcv5BpMTR5edqr/ZRuluUcNave6IEpRCoT67/3hVVmm5ODpqA=="
66
- crossOrigin="anonymous"
67
- referrerPolicy="no-referrer"
68
- />
69
- <link key="fonts" rel="stylesheet" type="text/css" href={withPrefix("/fonts/fonts.css")} />
70
- </>
71
- );
72
- };
73
-
74
8
  export const HeadComponents = [
75
- <Head key="head" />
9
+ <link
10
+ key="font-awesome"
11
+ rel="stylesheet"
12
+ href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw=="
13
+ crossOrigin="anonymous"
14
+ referrerPolicy="no-referrer"
15
+ />,
16
+ <link
17
+ key="awesome-bootstrap-checkbox"
18
+ rel="stylesheet"
19
+ href="https://cdnjs.cloudflare.com/ajax/libs/awesome-bootstrap-checkbox/1.0.2/awesome-bootstrap-checkbox.min.css" integrity="sha512-zAQ4eQ+PGbYf6BknDx0m2NhTcOnHWpMdJCFaPvcv5BpMTR5edqr/ZRuluUcNave6IEpRCoT67/3hVVmm5ODpqA=="
20
+ crossOrigin="anonymous"
21
+ referrerPolicy="no-referrer"
22
+ />,
23
+ <link
24
+ key="fonts"
25
+ rel="stylesheet"
26
+ type="text/css"
27
+ href={withPrefix("/fonts/fonts.css")}
28
+ />
76
29
  ];
77
30
 
78
31
  export const PreBodyComponents = [
@@ -11,10 +11,8 @@ const TemplateWrapper = ({
11
11
  marketing
12
12
  }) => {
13
13
  const [isFocus, setIsFocus] = useState(true);
14
-
15
14
  const onFocus = () => setIsFocus(true);
16
15
  const onBlur = () => setIsFocus(false);
17
-
18
16
  useEffect(() => {
19
17
  window.addEventListener("focus", onFocus);
20
18
  window.addEventListener("blur", onBlur);
@@ -23,7 +21,6 @@ const TemplateWrapper = ({
23
21
  window.removeEventListener("blur", onBlur);
24
22
  };
25
23
  });
26
-
27
24
  return (
28
25
  <div id="container">
29
26
  <a className="sr-only skip-to-content" href="#content-wrapper">Skip to content</a>
@@ -0,0 +1,63 @@
1
+ import * as React from "react";
2
+ import useSiteMetadata from "@utils/useSiteMetadata";
3
+ import useSiteSettings from "@utils/useSiteSettings";
4
+ import { withPrefix } from "gatsby";
5
+ import { getSrc } from "gatsby-plugin-image";
6
+
7
+ const Seo = ({
8
+ title,
9
+ description,
10
+ pathname,
11
+ children
12
+ }) => {
13
+ const {
14
+ title: defaultTitle,
15
+ description: defaultDescription,
16
+ } = useSiteMetadata();
17
+ const seo = {
18
+ title: title ? `${defaultTitle} - ${title}` : defaultTitle,
19
+ description: description || defaultDescription,
20
+ url: `${withPrefix(pathname || "/")}`
21
+ }
22
+ const { favicons } = useSiteSettings();
23
+ return (
24
+ <>
25
+ <title>{seo.title}</title>
26
+ <meta name="description" content={seo.description} />
27
+ <meta name="twitter:card" content="summary" />
28
+ <meta name="twitter:title" content={seo.title} />
29
+ <meta name="twitter:url" content={seo.url} />
30
+ <meta name="twitter:description" content={seo.description} />
31
+ <meta name="description" content={seo.description} />
32
+ <meta name="theme-color" content="#fff" />
33
+ <meta property="og:type" content="business.business" />
34
+ <meta property="og:title" content={seo.title} />
35
+ <meta property="og:url" content={seo.url} />
36
+ {favicons?.favicon180 &&
37
+ <link
38
+ rel="apple-touch-icon"
39
+ sizes="180x180"
40
+ href={`${getSrc(favicons.favicon180)}`}
41
+ />
42
+ }
43
+ {favicons?.favicon32 &&
44
+ <link
45
+ rel="icon"
46
+ sizes="32x32"
47
+ href={`${getSrc(favicons.favicon32)}`}
48
+ />
49
+ }
50
+ {favicons?.favicon16 &&
51
+ <link
52
+ rel="icon"
53
+ type="image/png"
54
+ sizes="16x16"
55
+ href={`${getSrc(favicons.favicon16)}`}
56
+ />
57
+ }
58
+ {children}
59
+ </>
60
+ )
61
+ };
62
+
63
+ export default Seo;
@@ -18,10 +18,11 @@ import MyTicketsPage from "../../templates/my-tickets-page";
18
18
  import WithTicketRoute from "../../routes/WithTicketRoute";
19
19
  import withRealTimeUpdates from "../../utils/real_time_updates/withRealTimeUpdates";
20
20
  import withFeedsWorker from "../../utils/withFeedsWorker";
21
+ import Seo from "../../components/Seo";
21
22
  import Link from "../../components/Link";
23
+ import { titleFromPathname } from "../../utils/urlFormating";
22
24
 
23
25
  const App = ({ isLoggedUser, user, summit_phase, allowClick = true }) => {
24
-
25
26
  return (
26
27
  <Location>
27
28
  {({ location }) => (
@@ -72,7 +73,7 @@ const App = ({ isLoggedUser, user, summit_phase, allowClick = true }) => {
72
73
  </Router>
73
74
  )}
74
75
  </Location>
75
- )
76
+ );
76
77
  };
77
78
 
78
79
  const mapStateToProps = ({ loggedUserState, userState, clockState, settingState, summitState }) => ({
@@ -85,5 +86,13 @@ const mapStateToProps = ({ loggedUserState, userState, clockState, settingState,
85
86
  allowClick: settingState?.widgets?.schedule?.allowClick
86
87
  });
87
88
 
88
- export default connect(mapStateToProps, {
89
- })(withFeedsWorker(withRealTimeUpdates(App)));
89
+ export default connect(mapStateToProps, {})(withFeedsWorker(withRealTimeUpdates(App)));
90
+
91
+ export const Head = ({
92
+ location
93
+ }) => (
94
+ <Seo
95
+ title={titleFromPathname(location.pathname)}
96
+ pathname={location.pathname}
97
+ />
98
+ );
@@ -92,7 +92,7 @@ const SchedulePage = ({ summit, scheduleState, summitPhase, isLoggedUser, locati
92
92
  <div className={`${styles.wrapper} ${showFilters ? styles.showFilters : ""}`}>
93
93
  <div className={styles.scheduleWrapper}>
94
94
  <FullSchedule {...schedProps}
95
- key={`fullschedule_${lastDataSync}`}
95
+ key={`fullschedule_${lastDataSync}`}
96
96
  />
97
97
  </div>
98
98
  <div ref={filtersWrapperRef} className={styles.filterWrapper}>
@@ -114,4 +114,16 @@ SchedulePage.propTypes = {
114
114
  isLoggedUser: PropTypes.bool,
115
115
  };
116
116
 
117
- export default withScheduleData(SchedulePage);
117
+ export default withScheduleData(SchedulePage);
118
+
119
+ export const Head = ({
120
+ location,
121
+ pageContext
122
+ }) => {
123
+ return (
124
+ <Seo
125
+ title="Schedule"
126
+ pathname={location.pathname}
127
+ />
128
+ );
129
+ }
@@ -1,4 +1,10 @@
1
1
  export const getSponsorURL = (id, name) => {
2
2
  let formattedName = name.toLowerCase().replace(/\s/g, '-');
3
3
  return `${id}-${formattedName}`;
4
- }
4
+ }
5
+
6
+ export const titleFromPathname = (pathname) => {
7
+ const segments = pathname.split("/");
8
+ const lastSegment = segments.filter(Boolean).pop();
9
+ return lastSegment?.replace("-", " ").replace(/\b\w/g, (word) => word.toUpperCase());
10
+ }
@@ -1,12 +1,33 @@
1
- import { graphql, useStaticQuery } from "gatsby";
1
+ import {
2
+ graphql,
3
+ useStaticQuery
4
+ } from "gatsby";
2
5
 
3
6
  const siteSettingsQuery = graphql`
4
7
  query {
5
8
  siteSettingsJson {
6
9
  favicons {
7
- favicon16
8
- favicon32
9
- favicon180
10
+ favicon16 {
11
+ childImageSharp {
12
+ gatsbyImageData (
13
+ quality: 100
14
+ )
15
+ }
16
+ }
17
+ favicon32 {
18
+ childImageSharp {
19
+ gatsbyImageData (
20
+ quality: 100
21
+ )
22
+ }
23
+ }
24
+ favicon180 {
25
+ childImageSharp {
26
+ gatsbyImageData (
27
+ quality: 100
28
+ )
29
+ }
30
+ }
10
31
  }
11
32
  widgets {
12
33
  chat {