@openeventkit/event-site 2.0.113 → 2.0.115

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 (30) hide show
  1. package/package.json +2 -2
  2. package/src/components/AuthComponent.js +29 -24
  3. package/src/components/Container.js +9 -0
  4. package/src/components/FooterMarketing.js +1 -1
  5. package/src/components/IconButton/index.js +21 -0
  6. package/src/components/IconButton/styles.module.scss +31 -0
  7. package/src/components/MarketingHero/ImagesColumn.js +41 -0
  8. package/src/components/MarketingHero/MainColumn.js +38 -0
  9. package/src/components/MarketingHero/index.js +44 -0
  10. package/src/components/MarketingHero/styles.module.scss +73 -0
  11. package/src/components/RegistrationLiteComponent.js +27 -25
  12. package/src/components/SponsorHeader.js +10 -21
  13. package/src/content/site-settings/index.json +1 -55
  14. package/src/styles/auth-component.module.scss +37 -0
  15. package/src/styles/fonts.scss +11 -16
  16. package/src/styles/marketing.module.scss +7 -11
  17. package/src/styles/style.scss +0 -49
  18. package/src/templates/content-page/Container.js +3 -0
  19. package/src/templates/content-page/template.js +3 -2
  20. package/src/templates/marketing-page-template/Container.js +3 -0
  21. package/src/templates/marketing-page-template/MainColumn.js +69 -0
  22. package/src/templates/marketing-page-template/Masonry.js +71 -0
  23. package/src/templates/marketing-page-template/index.js +72 -0
  24. package/src/templates/marketing-page-template/styles.module.scss +11 -0
  25. package/src/utils/hooks/index.js +5 -0
  26. package/src/utils/hooks/useResize.js +19 -0
  27. package/src/components/MarketingHeroComponent.js +0 -120
  28. package/src/styles/login-button.module.scss +0 -84
  29. package/src/styles/marketing-hero.module.scss +0 -200
  30. package/src/templates/marketing-page-template.js +0 -194
@@ -188,41 +188,6 @@ h2 {
188
188
  }
189
189
  }
190
190
 
191
- #marketing-slider {
192
- .slick-track {
193
- height: inherit;
194
- }
195
- }
196
-
197
- .my-masonry-grid {
198
- display: -webkit-box;
199
- /* Not needed if autoprefixing */
200
- display: -ms-flexbox;
201
- /* Not needed if autoprefixing */
202
- display: flex;
203
- width: auto;
204
- }
205
-
206
- .my-masonry-grid_column {
207
- padding-left: 0px;
208
- /* gutter size */
209
- background-clip: padding-box;
210
-
211
- .slick-slider {
212
- margin-bottom: -5px;
213
- }
214
- }
215
-
216
- /* Style your items */
217
- .my-masonry-grid_column > div {
218
- /* change div to reference your elements you put in <Masonry> */
219
- margin-bottom: 0px;
220
-
221
- img {
222
- width: 100%;
223
- }
224
- }
225
-
226
191
  .sponsor-carousel {
227
192
  .slick-track {
228
193
  display: flex;
@@ -488,25 +453,11 @@ div.event-feedback-container {
488
453
  }
489
454
  }
490
455
 
491
- @media (max-width: 978px) {
492
- #marketing-slider {
493
- .slick-track {
494
- height: 520px;
495
- }
496
- }
497
- }
498
-
499
456
  @media (max-width: 768px) {
500
457
  div.login-form {
501
458
  width: auto;
502
459
  }
503
460
 
504
- #marketing-slider {
505
- .slick-track {
506
- height: 250px;
507
- }
508
- }
509
-
510
461
  .join-zoom-container {
511
462
  flex-direction: column;
512
463
  height: 100px;
@@ -0,0 +1,3 @@
1
+ import Container from "../../components/Container";
2
+
3
+ export default Container;
@@ -1,16 +1,17 @@
1
1
  import * as React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { MDXProvider } from "@mdx-js/react";
4
+ import Container from "./Container";
4
5
 
5
6
  import shortcodes from "./shortcodes";
6
7
 
7
8
  const ContentPageTemplate = ({ title, content }) => (
8
- <div className="content">
9
+ <Container className="content">
9
10
  <h1>{title}</h1>
10
11
  <MDXProvider components={shortcodes}>
11
12
  {content}
12
13
  </MDXProvider>
13
- </div>
14
+ </Container>
14
15
  );
15
16
 
16
17
  export default ContentPageTemplate;
@@ -0,0 +1,3 @@
1
+ import Container from "../../components/Container";
2
+
3
+ export default Container;
@@ -0,0 +1,69 @@
1
+ import * as React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { GatsbyImage, getImage } from "gatsby-plugin-image";
4
+ import Mdx from "@mdx-js/runtime";
5
+ import Container from "./Container";
6
+ import LiteScheduleComponent from "../../components/LiteScheduleComponent";
7
+ import DisqusComponent from "../../components/DisqusComponent";
8
+ import ResponsiveImage from "../../components/ResponsiveImage";
9
+ import Link from "../../components/Link";
10
+
11
+ import styles from "./styles.module.scss";
12
+
13
+ const shortcodes = {
14
+ a: Link,
15
+ img: ResponsiveImage
16
+ };
17
+
18
+ const MainColumn = ({ widgets, scheduleProps, lastDataSync, fullWidth, maxHeight }) => (
19
+ <div
20
+ className={`column pt-6 pb-5 px-6 ${!fullWidth ? "is-half" : ""} ${styles.mainColumn || ""}`}
21
+ style={{ maxHeight: !fullWidth && maxHeight ? maxHeight : "none", overflowY: "auto" }}
22
+ >
23
+ <Container>
24
+ {widgets?.content?.display && widgets?.content?.body && (
25
+ <Mdx components={shortcodes}>
26
+ {widgets.content.body}
27
+ </Mdx>
28
+ )}
29
+ {widgets?.schedule?.display && (
30
+ <>
31
+ <h2><b>{widgets.schedule.title}</b></h2>
32
+ <LiteScheduleComponent
33
+ {...scheduleProps}
34
+ lastDataSync={lastDataSync}
35
+ id={`marketing_lite_schedule_${lastDataSync}`}
36
+ page="marketing-site"
37
+ showAllEvents={true}
38
+ showSearch={false}
39
+ showNav={true}
40
+ />
41
+ </>
42
+ )}
43
+ {widgets?.disqus?.display && (
44
+ <>
45
+ <h2><b>{widgets.disqus.title}</b></h2>
46
+ <DisqusComponent page="marketing-site" />
47
+ </>
48
+ )}
49
+ {widgets?.image?.display && widgets?.image?.image.src && (
50
+ <>
51
+ <h2><b>{widgets.image.title}</b></h2>
52
+ <br />
53
+ <GatsbyImage image={getImage(widgets.image.image.src)} alt={widgets.image.image.alt ?? ""} />
54
+ </>
55
+ )}
56
+ </Container>
57
+ </div>
58
+ );
59
+
60
+ MainColumn.propTypes = {
61
+ widgets: PropTypes.object,
62
+ scheduleProps: PropTypes.object,
63
+ lastDataSync: PropTypes.number,
64
+ fullWidth: PropTypes.bool,
65
+ maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
66
+ };
67
+
68
+ export default MainColumn;
69
+
@@ -0,0 +1,71 @@
1
+ import * as React from "react";
2
+ import { GatsbyImage, getImage } from "gatsby-plugin-image";
3
+ import Masonry from "react-masonry-css";
4
+ import Slider from "react-slick";
5
+ import Link from "../../components/Link";
6
+ import { formatMasonry } from "@utils/masonry";
7
+
8
+ import styles from "./styles.module.scss";
9
+
10
+ const sliderSettings = {
11
+ autoplay: true,
12
+ autoplaySpeed: 5000,
13
+ infinite: true,
14
+ slidesToShow: 1,
15
+ slidesToScroll: 1,
16
+ dots: false
17
+ };
18
+
19
+ export default React.forwardRef(({ data }, ref) => (
20
+ <div
21
+ ref={ref}
22
+ className={`column p-0 is-half ${styles.masonry || ""}`}
23
+ >
24
+ <Masonry
25
+ className={styles.grid}
26
+ breakpointCols={2}
27
+ >
28
+ {data.items && formatMasonry(data.items).map((item, index) => {
29
+ if (item.images && item.images.length === 1) {
30
+ const image = getImage(item.images[0].src);
31
+ const alt = item.images[0].alt ?? "";
32
+ if (item.images[0].link) {
33
+ return (
34
+ <Link key={index} to={item.images[0].link}>
35
+ <GatsbyImage image={image} alt={alt} />
36
+ </Link>
37
+ );
38
+ } else {
39
+ return <GatsbyImage key={index} image={image} alt={alt} />;
40
+ };
41
+ } else if (item.images && item.images.length > 1) {
42
+ return (
43
+ <Slider
44
+ key={index}
45
+ className={styles.slider}
46
+ {...sliderSettings}
47
+ >
48
+ {item.images.map((image, indexSlide) => {
49
+ const img = getImage(image.src);
50
+ const alt = image.alt ?? "";
51
+ if (image.link) {
52
+ return (
53
+ <Link key={indexSlide} to={image.link}>
54
+ <GatsbyImage image={img} alt={alt} />
55
+ </Link>
56
+ );
57
+ } else {
58
+ return <GatsbyImage key={indexSlide} image={img} alt={alt} />;
59
+ };
60
+ })}
61
+ </Slider>
62
+ );
63
+ } else {
64
+ return (
65
+ <div key={index} />
66
+ );
67
+ }
68
+ })}
69
+ </Masonry>
70
+ </div>
71
+ ));
@@ -0,0 +1,72 @@
1
+ import React, { useRef, useState, useCallback } from "react";
2
+ import PropTypes from "prop-types";
3
+ import { navigate } from "gatsby";
4
+ import Layout from "../../components/Layout";
5
+ import AttendanceTrackerComponent from "../../components/AttendanceTrackerComponent";
6
+ import MarketingHero from "../../components/MarketingHero";
7
+ import Countdown from "../../components/Countdown";
8
+ import Link from "../../components/Link";
9
+ import MainColumn from "./MainColumn";
10
+ import Masonry from "./Masonry";
11
+ import { useResize } from "@utils/hooks";
12
+ import { PHASES } from "@utils/phasesUtils";
13
+
14
+ import styles from "./styles.module.scss";
15
+
16
+ const onEventClick = (ev) => navigate(`/a/event/${ev.id}`);
17
+
18
+ const MarketingPageTemplate = ({ data, location, summit, summitPhase, isLoggedUser, lastDataSync }) => {
19
+ const masonryRef = useRef();
20
+ const [rightColumnHeight, setRightColumnHeight] = useState();
21
+ const onResize = () => {
22
+ if (masonryRef?.current) {
23
+ setRightColumnHeight(masonryRef.current.firstChild.clientHeight);
24
+ }
25
+ };
26
+ useResize(onResize);
27
+ const {
28
+ marketingPageJson: {
29
+ hero,
30
+ countdown,
31
+ widgets,
32
+ masonry
33
+ } = {}
34
+ } = data || {};
35
+ const scheduleProps = useCallback(() => {
36
+ if (widgets?.schedule && isLoggedUser && summitPhase !== PHASES.BEFORE) {
37
+ return { onEventClick };
38
+ }
39
+ return {};
40
+ }, [widgets, isLoggedUser, summitPhase]);
41
+ const shouldRenderMasonry = masonry?.display;
42
+ return (
43
+ <Layout marketing={true} location={location}>
44
+ <AttendanceTrackerComponent />
45
+ <MarketingHero location={location} data={hero} />
46
+ {summit && countdown?.display && <Countdown summit={summit} text={countdown?.text} />}
47
+ <div className="columns is-marginless">
48
+ <MainColumn
49
+ widgets={widgets}
50
+ scheduleProps={scheduleProps}
51
+ maxHeight={rightColumnHeight}
52
+ fullWidth={!shouldRenderMasonry}
53
+ lastDataSync={lastDataSync}
54
+ />
55
+ {shouldRenderMasonry &&
56
+ <Masonry data={masonry} ref={masonryRef} />
57
+ }
58
+ </div>
59
+ </Layout>
60
+ );
61
+ };
62
+
63
+ MarketingPageTemplate.propTypes = {
64
+ location: PropTypes.object,
65
+ data: PropTypes.object,
66
+ lastDataSync: PropTypes.number,
67
+ summit: PropTypes.object,
68
+ summitPhase: PropTypes.number,
69
+ isLoggedUser: PropTypes.bool
70
+ };
71
+
72
+ export default MarketingPageTemplate;
@@ -0,0 +1,11 @@
1
+ .mainColumn {
2
+ }
3
+
4
+ .masonry {
5
+ .grid {
6
+ display: flex;
7
+ }
8
+ .slider {
9
+ margin-bottom: -5px;
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ import useResize from "./useResize";
2
+
3
+ export {
4
+ useResize
5
+ }
@@ -0,0 +1,19 @@
1
+ import { useEffect, useCallback } from "react";
2
+
3
+ const useResize = (callback, options = { passive: true }) => {
4
+ const handleResize = useCallback(() => {
5
+ if (typeof callback === "function") {
6
+ callback();
7
+ }
8
+ }, [callback]);
9
+
10
+ useEffect(() => {
11
+ handleResize();
12
+ window.addEventListener("resize", handleResize, options);
13
+ return () => {
14
+ window.removeEventListener("resize", handleResize);
15
+ };
16
+ }, [handleResize]);
17
+ };
18
+
19
+ export default useResize;
@@ -1,120 +0,0 @@
1
- import React, {
2
- useRef,
3
- useState,
4
- useEffect
5
- } from "react";
6
- import { getSrc } from "gatsby-plugin-image";
7
- import Slider from "react-slick";
8
- import AuthComponent from "./AuthComponent";
9
- import RegistrationLiteComponent from "./RegistrationLiteComponent";
10
-
11
- import styles from "../styles/marketing-hero.module.scss";
12
-
13
- const MarketingHeroComponent = ({
14
- location,
15
- data,
16
- }) => {
17
-
18
- const sliderRef = useRef(null);
19
- const [sliderHeight, setSliderHeight] = useState(424);
20
-
21
- const onResize = () => {
22
- sliderRef?.current && setSliderHeight(sliderRef.current.clientHeight);
23
- };
24
-
25
- useEffect(() => {
26
- onResize();
27
- window.addEventListener("resize", onResize, { passive: true });
28
- return () => {
29
- window.removeEventListener("resize", onResize);
30
- };
31
- }, []);
32
-
33
-
34
- const getButtons = () => {
35
- const {
36
- registerButton,
37
- loginButton
38
- } = data?.buttons || {};
39
-
40
- return <>
41
- {registerButton?.display &&
42
- <span className={styles.link}>
43
- <RegistrationLiteComponent location={location} />
44
- </span>
45
- }
46
- {loginButton?.display &&
47
- <AuthComponent location={location} />
48
- }
49
- </>;
50
- };
51
-
52
- const sliderSettings = {
53
- autoplay: true,
54
- autoplaySpeed: 5000,
55
- infinite: true,
56
- dots: false,
57
- slidesToShow: 1,
58
- slidesToScroll: 1,
59
- };
60
-
61
- let heroLeftColumnInlineStyles = {};
62
- if (data?.background?.src) {
63
- const imageSrc = getSrc(data.background.src);
64
- heroLeftColumnInlineStyles.backgroundImage = `url(${imageSrc})`;
65
- }
66
-
67
- return (
68
- <section className={styles.heroMarketing}>
69
- <div className={`${styles.heroMarketingColumns} columns is-gapless`}>
70
- <div
71
- className={`${styles.leftColumn} column is-6`}
72
- style={heroLeftColumnInlineStyles}
73
- >
74
- <div className={`${styles.heroMarketingContainer} hero-body`}>
75
- <div className="container">
76
- <h1 className="title">{data?.title}</h1>
77
- <h2 className="subtitle">{data?.subTitle}</h2>
78
- <div
79
- className={styles.date}
80
- style={{
81
- display: "inline",
82
- transform: "skew(0deg)",
83
- }}
84
- >
85
- <div style={{transform: "skew(0deg)"}}>
86
- <span>{data?.date}</span>
87
- </div>
88
- </div>
89
- <h4>{data?.time}</h4>
90
- <div className={styles.heroButtons}>
91
- {getButtons()}
92
- </div>
93
- </div>
94
- </div>
95
- </div>
96
- {data?.images?.length > 0 &&
97
- <div className={`${styles.rightColumn} column is-6 px-0`} id="marketing-slider" ref={sliderRef}>
98
- {data?.images?.length > 1 ?
99
- <Slider {...sliderSettings}>
100
- {data.images.map((image, index) => {
101
- const imageSrc = getSrc(image.src);
102
- return (
103
- <div key={index}>
104
- <div className={styles.imageSlider} aria-label={image.alt} style={{ backgroundImage: `url(${imageSrc})`, height: sliderHeight, marginBottom: -6 }} />
105
- </div>
106
- );
107
- })}
108
- </Slider>
109
- :
110
- <div className={styles.singleImage} aria-label={data.images[0].alt} style={{ backgroundImage: `url(${getSrc(data.images[0].src)})`}} >
111
- </div>
112
- }
113
- </div>
114
- }
115
- </div>
116
- </section>
117
- );
118
- }
119
-
120
- export default MarketingHeroComponent;
@@ -1,84 +0,0 @@
1
- @import "colors.scss";
2
-
3
- .login-button-wrapper {
4
- :first-of-type.button {
5
- background-color: transparent;
6
- color: #fff;
7
- height: 5rem;
8
- width: 20rem;
9
- margin: 0 10px 10px 0;
10
-
11
- i {
12
- color: #fff;
13
- height: 1em;
14
- width: 2.5em;
15
- margin-right: auto;
16
- font-size: 1.8em;
17
- }
18
-
19
- b {
20
- display: inline-block;
21
- width: 100%;
22
- text-align: center;
23
- }
24
-
25
- &:hover,
26
- &:active {
27
- border-color: #fff;
28
- text-decoration: none;
29
- }
30
-
31
- &:focus {
32
- border-color: #fff;
33
- box-shadow: none;
34
- }
35
-
36
- &.white {
37
- background-color: #fff;
38
- color: #6d6e71;
39
-
40
- b,
41
- i {
42
- color: inherit;
43
- }
44
- }
45
- }
46
-
47
- #modal {
48
- padding: 100px 0;
49
- }
50
-
51
- .modal-content {
52
- overflow: initial;
53
- }
54
-
55
- .outer-wrapper {
56
- border: 1px solid var(--color_input_border_color);
57
- background-color: var(--color_background_light);
58
- border-radius: 5px;
59
- }
60
-
61
- .inner-wrapper {
62
- padding: 10px;
63
- }
64
-
65
- .title {
66
- display: flex;
67
- justify-content: center;
68
- align-items: center;
69
- border-bottom: 1px solid var(--color_input_border_color);
70
- margin: 0px -10px;
71
- padding: 0px 15px 5px;
72
- i {
73
- cursor: pointer;
74
- margin-left: auto;
75
- }
76
- span {
77
- width: 100%;
78
- font-weight: bold;
79
- font-size: 18px;
80
- text-align: center;
81
- color: var(--color_text_dark);
82
- }
83
- }
84
- }