@mjhls/mjh-framework 1.0.351 → 1.0.352
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/README.md +1 -1
- package/dist/cjs/index.js +103 -258
- package/dist/esm/index.js +104 -259
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -1800,20 +1800,13 @@ var clientId = process.env.CVENT_CLIENT_ID;
|
|
|
1800
1800
|
var clientSecret = process.env.CVENT_CLIENT_SECRET;
|
|
1801
1801
|
var corsProxy = 'https://cors-anywhere.herokuapp.com/';
|
|
1802
1802
|
var currentTime = momentTimezone$1().toISOString();
|
|
1803
|
-
var itemsPerPage =
|
|
1803
|
+
var itemsPerPage = 200;
|
|
1804
1804
|
|
|
1805
1805
|
var EventsDeck = function EventsDeck(_ref) {
|
|
1806
|
-
var
|
|
1807
|
-
autoScroll = _ref$autoScroll === undefined ? true : _ref$autoScroll,
|
|
1808
|
-
rightItems = _ref.rightItems,
|
|
1809
|
-
_ref$seoPaginate = _ref.seoPaginate,
|
|
1810
|
-
seoPaginate = _ref$seoPaginate === undefined ? true : _ref$seoPaginate,
|
|
1811
|
-
pageview = _ref.pageview,
|
|
1806
|
+
var rightItems = _ref.rightItems,
|
|
1812
1807
|
_ref$filter = _ref.filter,
|
|
1813
1808
|
filter = _ref$filter === undefined ? 'start gt \'' + currentTime + '\' and status eq \'Active\'' : _ref$filter;
|
|
1814
1809
|
|
|
1815
|
-
var router = Router.useRouter();
|
|
1816
|
-
|
|
1817
1810
|
var _useState = React.useState(true),
|
|
1818
1811
|
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
1819
1812
|
isLoading = _useState2[0],
|
|
@@ -1839,16 +1832,7 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1839
1832
|
scrolling = _useState10[0],
|
|
1840
1833
|
setScrolling = _useState10[1];
|
|
1841
1834
|
|
|
1842
|
-
var
|
|
1843
|
-
_useState12 = slicedToArray._slicedToArray(_useState11, 2),
|
|
1844
|
-
currentPage = _useState12[0],
|
|
1845
|
-
setCurrentPage = _useState12[1];
|
|
1846
|
-
|
|
1847
|
-
var currentPageRef = React.useRef(currentPage);
|
|
1848
|
-
|
|
1849
|
-
var getEvents = function getEvents(params) {
|
|
1850
|
-
var url = params.url;
|
|
1851
|
-
|
|
1835
|
+
var getEvents = function getEvents(url) {
|
|
1852
1836
|
fetch(url, {
|
|
1853
1837
|
headers: {
|
|
1854
1838
|
Accept: 'application/json',
|
|
@@ -1863,43 +1847,49 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1863
1847
|
}).then(function (events) {
|
|
1864
1848
|
setIsLoading(false);
|
|
1865
1849
|
if (events.data && events.data.length > 0) {
|
|
1866
|
-
var
|
|
1867
|
-
return
|
|
1868
|
-
|
|
1869
|
-
|
|
1850
|
+
var filteredEventsByTestMode = events.data.filter(function (event) {
|
|
1851
|
+
return event.testMode === false;
|
|
1852
|
+
});
|
|
1853
|
+
var sortedEventsByStartData = filteredEventsByTestMode.sort(function (a, b) {
|
|
1854
|
+
if (momentTimezone$1(a.start).isAfter(b.start)) {
|
|
1855
|
+
return 1;
|
|
1856
|
+
} else if (momentTimezone$1(a.start).isBefore(b.start)) {
|
|
1857
|
+
return -1;
|
|
1858
|
+
}
|
|
1859
|
+
return 0;
|
|
1870
1860
|
});
|
|
1871
1861
|
setData(function (prevData) {
|
|
1872
|
-
return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(
|
|
1862
|
+
return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(sortedEventsByStartData));
|
|
1873
1863
|
});
|
|
1874
1864
|
setNextPageLink(events.paging._links.next ? events.paging._links.next.href : null);
|
|
1875
|
-
|
|
1865
|
+
setScrolling(events.paging._links.next ? true : false);
|
|
1876
1866
|
} else {
|
|
1877
1867
|
setScrolling(false);
|
|
1878
1868
|
}
|
|
1869
|
+
}).catch(function (e) {
|
|
1870
|
+
console.error(e);
|
|
1879
1871
|
});
|
|
1880
1872
|
};
|
|
1881
1873
|
|
|
1882
1874
|
React.useEffect(function () {
|
|
1883
1875
|
// load initial data
|
|
1884
|
-
if (accessToken
|
|
1876
|
+
if (accessToken) {
|
|
1885
1877
|
var initailUrl = 'https://api-platform.cvent.com/event/v1/events/filter?limit=' + itemsPerPage;
|
|
1886
|
-
getEvents(
|
|
1878
|
+
getEvents(initailUrl);
|
|
1887
1879
|
}
|
|
1888
|
-
}, [accessToken,
|
|
1880
|
+
}, [accessToken, filter]);
|
|
1889
1881
|
|
|
1890
|
-
|
|
1882
|
+
var loadMore = function loadMore() {
|
|
1891
1883
|
// load more events
|
|
1892
|
-
if (accessToken && nextPageLink
|
|
1893
|
-
getEvents(
|
|
1884
|
+
if (accessToken && nextPageLink) {
|
|
1885
|
+
getEvents(nextPageLink);
|
|
1894
1886
|
}
|
|
1895
|
-
}
|
|
1887
|
+
};
|
|
1896
1888
|
|
|
1897
1889
|
React.useEffect(function () {
|
|
1898
1890
|
// reset state when filter changes
|
|
1899
1891
|
setIsLoading(true);
|
|
1900
1892
|
setData([]);
|
|
1901
|
-
setCurrentPage(1);
|
|
1902
|
-
currentPageRef.current = 1;
|
|
1903
1893
|
}, [filter]);
|
|
1904
1894
|
|
|
1905
1895
|
React.useEffect(function () {
|
|
@@ -1929,63 +1919,7 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1929
1919
|
}
|
|
1930
1920
|
}, []);
|
|
1931
1921
|
|
|
1932
|
-
var
|
|
1933
|
-
setCurrentPage(function (prevCurrentPage) {
|
|
1934
|
-
return prevCurrentPage + 1;
|
|
1935
|
-
});
|
|
1936
|
-
}, 0);
|
|
1937
|
-
|
|
1938
|
-
var changePageNumber = function changePageNumber(pageNumber) {
|
|
1939
|
-
if (seoPaginate) {
|
|
1940
|
-
var path = router.asPath;
|
|
1941
|
-
var qrIndex = path.indexOf('?');
|
|
1942
|
-
var pathname = router.pathname;
|
|
1943
|
-
var queryString = '';
|
|
1944
|
-
if (qrIndex > 0) {
|
|
1945
|
-
path = path.substring(1, qrIndex);
|
|
1946
|
-
|
|
1947
|
-
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
1948
|
-
var partialQSArr = partialQS.split('&');
|
|
1949
|
-
|
|
1950
|
-
// exclude page=xxx from query string
|
|
1951
|
-
partialQSArr.map(function (item) {
|
|
1952
|
-
var itemArr = item.split('=');
|
|
1953
|
-
var key = itemArr[0];
|
|
1954
|
-
var val = itemArr[1];
|
|
1955
|
-
|
|
1956
|
-
if (key !== 'page') {
|
|
1957
|
-
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
1958
|
-
}
|
|
1959
|
-
});
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
if (queryString.length > 0) {
|
|
1963
|
-
path += '?' + queryString;
|
|
1964
|
-
}
|
|
1965
|
-
|
|
1966
|
-
pageNumber = parseInt(pageNumber);
|
|
1967
|
-
|
|
1968
|
-
if (pageNumber !== currentPageRef.current) {
|
|
1969
|
-
debounce.lib_3.refresh();
|
|
1970
|
-
|
|
1971
|
-
currentPageRef.current = pageNumber;
|
|
1972
|
-
if (path[0] !== '/') {
|
|
1973
|
-
path = '/' + path;
|
|
1974
|
-
}
|
|
1975
|
-
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
1976
|
-
|
|
1977
|
-
if (pageview) {
|
|
1978
|
-
pageview(newPath);
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
router.push(pathname, newPath, {
|
|
1982
|
-
shallow: true
|
|
1983
|
-
});
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
1987
|
-
|
|
1988
|
-
var renderRegisterButton = function renderRegisterButton(links, closeAfter, timezone) {
|
|
1922
|
+
var renderRegisterButton = function renderRegisterButton(links) {
|
|
1989
1923
|
return React__default.createElement(
|
|
1990
1924
|
'a',
|
|
1991
1925
|
{ href: links.summary.href || '#', target: '_blank' },
|
|
@@ -1995,33 +1929,13 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1995
1929
|
'Register Now'
|
|
1996
1930
|
)
|
|
1997
1931
|
);
|
|
1998
|
-
// const now = moment().tz(timezone)
|
|
1999
|
-
// closeAfter = moment(closeAfter).tz(timezone)
|
|
2000
|
-
// const isRegister = moment(now).isBefore(closeAfter)
|
|
2001
|
-
// if (isRegister) {
|
|
2002
|
-
// return (
|
|
2003
|
-
// <a href={links.registration.href || '#'} target='_blank'>
|
|
2004
|
-
// <Button size='sm' className='event-registration-button'>
|
|
2005
|
-
// Register Now
|
|
2006
|
-
// </Button>
|
|
2007
|
-
// </a>
|
|
2008
|
-
// )
|
|
2009
|
-
// } else {
|
|
2010
|
-
// return (
|
|
2011
|
-
// <a href={links.summary.href || '#'} target='_blank'>
|
|
2012
|
-
// <Button size='sm' className='event-registration-button'>
|
|
2013
|
-
// Learn more
|
|
2014
|
-
// </Button>
|
|
2015
|
-
// </a>
|
|
2016
|
-
// )
|
|
2017
|
-
// }
|
|
2018
1932
|
};
|
|
2019
1933
|
|
|
2020
1934
|
var cardLoader = function cardLoader() {
|
|
2021
1935
|
var numberOfItemsBeforeAd = 5;
|
|
2022
1936
|
return React__default.createElement(
|
|
2023
|
-
|
|
2024
|
-
|
|
1937
|
+
Container,
|
|
1938
|
+
{ style: { padding: 1 } },
|
|
2025
1939
|
data && data.map(function (row, index) {
|
|
2026
1940
|
var speakerInfo = [];
|
|
2027
1941
|
if (row.customFields) {
|
|
@@ -2055,105 +1969,97 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2055
1969
|
return result;
|
|
2056
1970
|
}, '') : '';
|
|
2057
1971
|
|
|
2058
|
-
var pageNumber = row.pageNumber || 1;
|
|
2059
1972
|
return React__default.createElement(
|
|
2060
1973
|
React__default.Fragment,
|
|
2061
1974
|
{ key: index },
|
|
2062
1975
|
React__default.createElement(
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
} },
|
|
2068
|
-
React__default.createElement(
|
|
2069
|
-
Card,
|
|
1976
|
+
Card,
|
|
1977
|
+
null,
|
|
1978
|
+
isRegister && _links && React__default.createElement(
|
|
1979
|
+
Row,
|
|
2070
1980
|
null,
|
|
2071
|
-
|
|
2072
|
-
|
|
1981
|
+
React__default.createElement(
|
|
1982
|
+
Col,
|
|
2073
1983
|
null,
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
1984
|
+
renderRegisterButton(_links)
|
|
1985
|
+
)
|
|
1986
|
+
),
|
|
1987
|
+
discussionTopic && React__default.createElement(
|
|
1988
|
+
Row,
|
|
1989
|
+
null,
|
|
1990
|
+
React__default.createElement(
|
|
1991
|
+
Col,
|
|
2082
1992
|
null,
|
|
2083
|
-
React__default.createElement(
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
1993
|
+
React__default.createElement('h5', { className: 'topic', style: { fontWeight: '500', marginBottom: 0 }, dangerouslySetInnerHTML: { __html: discussionTopic } })
|
|
1994
|
+
)
|
|
1995
|
+
),
|
|
1996
|
+
start && timezone && React__default.createElement(
|
|
1997
|
+
Row,
|
|
1998
|
+
null,
|
|
1999
|
+
React__default.createElement(
|
|
2000
|
+
Col,
|
|
2091
2001
|
null,
|
|
2092
2002
|
React__default.createElement(
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
'p',
|
|
2097
|
-
{ className: 'start-time', style: { padding: 0, margin: 0 } },
|
|
2098
|
-
momentTimezone$1(start).tz(timezone).format('LLL')
|
|
2099
|
-
)
|
|
2003
|
+
'p',
|
|
2004
|
+
{ className: 'start-time', style: { padding: 0, margin: 0 } },
|
|
2005
|
+
momentTimezone$1(start).tz(timezone).format('LLL')
|
|
2100
2006
|
)
|
|
2101
|
-
)
|
|
2102
|
-
|
|
2103
|
-
|
|
2007
|
+
)
|
|
2008
|
+
),
|
|
2009
|
+
eventRegion && React__default.createElement(
|
|
2010
|
+
Row,
|
|
2011
|
+
null,
|
|
2012
|
+
React__default.createElement(
|
|
2013
|
+
Col,
|
|
2104
2014
|
null,
|
|
2105
2015
|
React__default.createElement(
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
'p',
|
|
2110
|
-
{ className: 'event-region', style: { padding: 0, margin: 0 } },
|
|
2111
|
-
eventRegion
|
|
2112
|
-
)
|
|
2016
|
+
'p',
|
|
2017
|
+
{ className: 'event-region', style: { padding: 0, margin: 0 } },
|
|
2018
|
+
eventRegion
|
|
2113
2019
|
)
|
|
2114
|
-
)
|
|
2115
|
-
|
|
2116
|
-
|
|
2020
|
+
)
|
|
2021
|
+
),
|
|
2022
|
+
venues && venues.length && venues[0].name && React__default.createElement(
|
|
2023
|
+
Row,
|
|
2024
|
+
null,
|
|
2025
|
+
React__default.createElement(
|
|
2026
|
+
Col,
|
|
2117
2027
|
null,
|
|
2118
2028
|
React__default.createElement(
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
'p',
|
|
2123
|
-
{ className: 'venue', style: { padding: 0, margin: 0 } },
|
|
2124
|
-
venues[0].name
|
|
2125
|
-
)
|
|
2029
|
+
'p',
|
|
2030
|
+
{ className: 'venue', style: { padding: 0, margin: 0 } },
|
|
2031
|
+
venues[0].name
|
|
2126
2032
|
)
|
|
2127
|
-
)
|
|
2128
|
-
|
|
2129
|
-
|
|
2033
|
+
)
|
|
2034
|
+
),
|
|
2035
|
+
speakerInfo && speakerInfo.length && React__default.createElement(
|
|
2036
|
+
Row,
|
|
2037
|
+
null,
|
|
2038
|
+
React__default.createElement(
|
|
2039
|
+
Col,
|
|
2130
2040
|
null,
|
|
2131
2041
|
React__default.createElement(
|
|
2132
|
-
|
|
2133
|
-
|
|
2042
|
+
'div',
|
|
2043
|
+
{ className: 'speaker-section', style: { border: '1px solid', borderRadius: '8px', padding: '8px' } },
|
|
2134
2044
|
React__default.createElement(
|
|
2135
|
-
'
|
|
2136
|
-
{ className: 'speaker-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
})
|
|
2154
|
-
);
|
|
2155
|
-
})
|
|
2156
|
-
)
|
|
2045
|
+
'h6',
|
|
2046
|
+
{ className: 'speaker-title', style: { fontWeight: '600', marginBottom: '0', marginTop: '.25rem' } },
|
|
2047
|
+
'SPEAKER'
|
|
2048
|
+
),
|
|
2049
|
+
speakerInfo.map(function (info, index) {
|
|
2050
|
+
return React__default.createElement(
|
|
2051
|
+
'p',
|
|
2052
|
+
{ key: index, style: { marginBottom: '0' } },
|
|
2053
|
+
info.value.map(function (speaker, index) {
|
|
2054
|
+
return React__default.createElement(
|
|
2055
|
+
'b',
|
|
2056
|
+
{ key: index, className: 'kol-speaker' },
|
|
2057
|
+
speaker,
|
|
2058
|
+
info.value.length > index + 1 ? ', ' : ''
|
|
2059
|
+
);
|
|
2060
|
+
})
|
|
2061
|
+
);
|
|
2062
|
+
})
|
|
2157
2063
|
)
|
|
2158
2064
|
)
|
|
2159
2065
|
)
|
|
@@ -2182,20 +2088,6 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2182
2088
|
);
|
|
2183
2089
|
};
|
|
2184
2090
|
|
|
2185
|
-
var renderManualPagination = function renderManualPagination() {
|
|
2186
|
-
var currentPage = 1;
|
|
2187
|
-
return React__default.createElement(
|
|
2188
|
-
'div',
|
|
2189
|
-
{ className: 'd-flex justify-content-between' },
|
|
2190
|
-
currentPage > 1 ,
|
|
2191
|
-
React__default.createElement(
|
|
2192
|
-
'a',
|
|
2193
|
-
{ href: '?page=' + (currentPage + 1) },
|
|
2194
|
-
'Next >>'
|
|
2195
|
-
)
|
|
2196
|
-
);
|
|
2197
|
-
};
|
|
2198
|
-
|
|
2199
2091
|
if (isLoading) {
|
|
2200
2092
|
return React__default.createElement(
|
|
2201
2093
|
'div',
|
|
@@ -2218,57 +2110,10 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2218
2110
|
return React__default.createElement(
|
|
2219
2111
|
'div',
|
|
2220
2112
|
{ className: 'cvent-events' },
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
visibilitySensor.InfiniteScroll,
|
|
2226
|
-
{ dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
2227
|
-
React__default.createElement(
|
|
2228
|
-
Container,
|
|
2229
|
-
null,
|
|
2230
|
-
cardLoader()
|
|
2231
|
-
)
|
|
2232
|
-
),
|
|
2233
|
-
React__default.createElement(
|
|
2234
|
-
'noscript',
|
|
2235
|
-
null,
|
|
2236
|
-
renderManualPagination()
|
|
2237
|
-
)
|
|
2238
|
-
) : React__default.createElement(
|
|
2239
|
-
React__default.Fragment,
|
|
2240
|
-
null,
|
|
2241
|
-
React__default.createElement(
|
|
2242
|
-
Container,
|
|
2243
|
-
null,
|
|
2244
|
-
cardLoader()
|
|
2245
|
-
),
|
|
2246
|
-
React__default.createElement(
|
|
2247
|
-
'div',
|
|
2248
|
-
{ style: { padding: '0px 10px' } },
|
|
2249
|
-
scrolling ? React__default.createElement(
|
|
2250
|
-
'button',
|
|
2251
|
-
{
|
|
2252
|
-
style: { margin: 'auto', width: '100%' },
|
|
2253
|
-
onClick: function onClick(e) {
|
|
2254
|
-
loadMore();
|
|
2255
|
-
} },
|
|
2256
|
-
'Load More'
|
|
2257
|
-
) : React__default.createElement(
|
|
2258
|
-
'p',
|
|
2259
|
-
{ style: { textAlign: 'center' } },
|
|
2260
|
-
React__default.createElement(
|
|
2261
|
-
'b',
|
|
2262
|
-
null,
|
|
2263
|
-
'End of data'
|
|
2264
|
-
)
|
|
2265
|
-
)
|
|
2266
|
-
),
|
|
2267
|
-
React__default.createElement(
|
|
2268
|
-
'noscript',
|
|
2269
|
-
null,
|
|
2270
|
-
renderManualPagination()
|
|
2271
|
-
)
|
|
2113
|
+
React__default.createElement(
|
|
2114
|
+
visibilitySensor.InfiniteScroll,
|
|
2115
|
+
{ dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
2116
|
+
cardLoader()
|
|
2272
2117
|
)
|
|
2273
2118
|
);
|
|
2274
2119
|
} else {
|
package/dist/esm/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { m as main_39, a as main_16, b as main_38 } from './main-cb86f95d.js';
|
|
|
6
6
|
import { _ as _toConsumableArray, a as _Array$from } from './toConsumableArray-2718dc16.js';
|
|
7
7
|
import { _ as _extends$2, a as _Object$assign } from './extends-26d3b609.js';
|
|
8
8
|
import { _ as _objectSap, a as _inherits$1, b as _classCallCheck$1, c as _possibleConstructorReturn$1, d as _Object$getPrototypeOf, e as _createClass$1 } from './inherits-4b85034c.js';
|
|
9
|
-
import React__default, { useState,
|
|
9
|
+
import React__default, { useState, useEffect, useRef } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import Container from 'react-bootstrap/Container';
|
|
12
12
|
import Row from 'react-bootstrap/Row';
|
|
@@ -1797,20 +1797,13 @@ var clientId = process.env.CVENT_CLIENT_ID;
|
|
|
1797
1797
|
var clientSecret = process.env.CVENT_CLIENT_SECRET;
|
|
1798
1798
|
var corsProxy = 'https://cors-anywhere.herokuapp.com/';
|
|
1799
1799
|
var currentTime = momentTimezone$1().toISOString();
|
|
1800
|
-
var itemsPerPage =
|
|
1800
|
+
var itemsPerPage = 200;
|
|
1801
1801
|
|
|
1802
1802
|
var EventsDeck = function EventsDeck(_ref) {
|
|
1803
|
-
var
|
|
1804
|
-
autoScroll = _ref$autoScroll === undefined ? true : _ref$autoScroll,
|
|
1805
|
-
rightItems = _ref.rightItems,
|
|
1806
|
-
_ref$seoPaginate = _ref.seoPaginate,
|
|
1807
|
-
seoPaginate = _ref$seoPaginate === undefined ? true : _ref$seoPaginate,
|
|
1808
|
-
pageview = _ref.pageview,
|
|
1803
|
+
var rightItems = _ref.rightItems,
|
|
1809
1804
|
_ref$filter = _ref.filter,
|
|
1810
1805
|
filter = _ref$filter === undefined ? 'start gt \'' + currentTime + '\' and status eq \'Active\'' : _ref$filter;
|
|
1811
1806
|
|
|
1812
|
-
var router = useRouter();
|
|
1813
|
-
|
|
1814
1807
|
var _useState = useState(true),
|
|
1815
1808
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1816
1809
|
isLoading = _useState2[0],
|
|
@@ -1836,16 +1829,7 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1836
1829
|
scrolling = _useState10[0],
|
|
1837
1830
|
setScrolling = _useState10[1];
|
|
1838
1831
|
|
|
1839
|
-
var
|
|
1840
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
1841
|
-
currentPage = _useState12[0],
|
|
1842
|
-
setCurrentPage = _useState12[1];
|
|
1843
|
-
|
|
1844
|
-
var currentPageRef = useRef(currentPage);
|
|
1845
|
-
|
|
1846
|
-
var getEvents = function getEvents(params) {
|
|
1847
|
-
var url = params.url;
|
|
1848
|
-
|
|
1832
|
+
var getEvents = function getEvents(url) {
|
|
1849
1833
|
fetch(url, {
|
|
1850
1834
|
headers: {
|
|
1851
1835
|
Accept: 'application/json',
|
|
@@ -1860,43 +1844,49 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1860
1844
|
}).then(function (events) {
|
|
1861
1845
|
setIsLoading(false);
|
|
1862
1846
|
if (events.data && events.data.length > 0) {
|
|
1863
|
-
var
|
|
1864
|
-
return
|
|
1865
|
-
|
|
1866
|
-
|
|
1847
|
+
var filteredEventsByTestMode = events.data.filter(function (event) {
|
|
1848
|
+
return event.testMode === false;
|
|
1849
|
+
});
|
|
1850
|
+
var sortedEventsByStartData = filteredEventsByTestMode.sort(function (a, b) {
|
|
1851
|
+
if (momentTimezone$1(a.start).isAfter(b.start)) {
|
|
1852
|
+
return 1;
|
|
1853
|
+
} else if (momentTimezone$1(a.start).isBefore(b.start)) {
|
|
1854
|
+
return -1;
|
|
1855
|
+
}
|
|
1856
|
+
return 0;
|
|
1867
1857
|
});
|
|
1868
1858
|
setData(function (prevData) {
|
|
1869
|
-
return [].concat(_toConsumableArray(prevData), _toConsumableArray(
|
|
1859
|
+
return [].concat(_toConsumableArray(prevData), _toConsumableArray(sortedEventsByStartData));
|
|
1870
1860
|
});
|
|
1871
1861
|
setNextPageLink(events.paging._links.next ? events.paging._links.next.href : null);
|
|
1872
|
-
|
|
1862
|
+
setScrolling(events.paging._links.next ? true : false);
|
|
1873
1863
|
} else {
|
|
1874
1864
|
setScrolling(false);
|
|
1875
1865
|
}
|
|
1866
|
+
}).catch(function (e) {
|
|
1867
|
+
console.error(e);
|
|
1876
1868
|
});
|
|
1877
1869
|
};
|
|
1878
1870
|
|
|
1879
1871
|
useEffect(function () {
|
|
1880
1872
|
// load initial data
|
|
1881
|
-
if (accessToken
|
|
1873
|
+
if (accessToken) {
|
|
1882
1874
|
var initailUrl = 'https://api-platform.cvent.com/event/v1/events/filter?limit=' + itemsPerPage;
|
|
1883
|
-
getEvents(
|
|
1875
|
+
getEvents(initailUrl);
|
|
1884
1876
|
}
|
|
1885
|
-
}, [accessToken,
|
|
1877
|
+
}, [accessToken, filter]);
|
|
1886
1878
|
|
|
1887
|
-
|
|
1879
|
+
var loadMore = function loadMore() {
|
|
1888
1880
|
// load more events
|
|
1889
|
-
if (accessToken && nextPageLink
|
|
1890
|
-
getEvents(
|
|
1881
|
+
if (accessToken && nextPageLink) {
|
|
1882
|
+
getEvents(nextPageLink);
|
|
1891
1883
|
}
|
|
1892
|
-
}
|
|
1884
|
+
};
|
|
1893
1885
|
|
|
1894
1886
|
useEffect(function () {
|
|
1895
1887
|
// reset state when filter changes
|
|
1896
1888
|
setIsLoading(true);
|
|
1897
1889
|
setData([]);
|
|
1898
|
-
setCurrentPage(1);
|
|
1899
|
-
currentPageRef.current = 1;
|
|
1900
1890
|
}, [filter]);
|
|
1901
1891
|
|
|
1902
1892
|
useEffect(function () {
|
|
@@ -1926,63 +1916,7 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1926
1916
|
}
|
|
1927
1917
|
}, []);
|
|
1928
1918
|
|
|
1929
|
-
var
|
|
1930
|
-
setCurrentPage(function (prevCurrentPage) {
|
|
1931
|
-
return prevCurrentPage + 1;
|
|
1932
|
-
});
|
|
1933
|
-
}, 0);
|
|
1934
|
-
|
|
1935
|
-
var changePageNumber = function changePageNumber(pageNumber) {
|
|
1936
|
-
if (seoPaginate) {
|
|
1937
|
-
var path = router.asPath;
|
|
1938
|
-
var qrIndex = path.indexOf('?');
|
|
1939
|
-
var pathname = router.pathname;
|
|
1940
|
-
var queryString = '';
|
|
1941
|
-
if (qrIndex > 0) {
|
|
1942
|
-
path = path.substring(1, qrIndex);
|
|
1943
|
-
|
|
1944
|
-
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
1945
|
-
var partialQSArr = partialQS.split('&');
|
|
1946
|
-
|
|
1947
|
-
// exclude page=xxx from query string
|
|
1948
|
-
partialQSArr.map(function (item) {
|
|
1949
|
-
var itemArr = item.split('=');
|
|
1950
|
-
var key = itemArr[0];
|
|
1951
|
-
var val = itemArr[1];
|
|
1952
|
-
|
|
1953
|
-
if (key !== 'page') {
|
|
1954
|
-
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
1955
|
-
}
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
if (queryString.length > 0) {
|
|
1960
|
-
path += '?' + queryString;
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
pageNumber = parseInt(pageNumber);
|
|
1964
|
-
|
|
1965
|
-
if (pageNumber !== currentPageRef.current) {
|
|
1966
|
-
lib_3.refresh();
|
|
1967
|
-
|
|
1968
|
-
currentPageRef.current = pageNumber;
|
|
1969
|
-
if (path[0] !== '/') {
|
|
1970
|
-
path = '/' + path;
|
|
1971
|
-
}
|
|
1972
|
-
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
1973
|
-
|
|
1974
|
-
if (pageview) {
|
|
1975
|
-
pageview(newPath);
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
|
-
router.push(pathname, newPath, {
|
|
1979
|
-
shallow: true
|
|
1980
|
-
});
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
};
|
|
1984
|
-
|
|
1985
|
-
var renderRegisterButton = function renderRegisterButton(links, closeAfter, timezone) {
|
|
1919
|
+
var renderRegisterButton = function renderRegisterButton(links) {
|
|
1986
1920
|
return React__default.createElement(
|
|
1987
1921
|
'a',
|
|
1988
1922
|
{ href: links.summary.href || '#', target: '_blank' },
|
|
@@ -1992,33 +1926,13 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
1992
1926
|
'Register Now'
|
|
1993
1927
|
)
|
|
1994
1928
|
);
|
|
1995
|
-
// const now = moment().tz(timezone)
|
|
1996
|
-
// closeAfter = moment(closeAfter).tz(timezone)
|
|
1997
|
-
// const isRegister = moment(now).isBefore(closeAfter)
|
|
1998
|
-
// if (isRegister) {
|
|
1999
|
-
// return (
|
|
2000
|
-
// <a href={links.registration.href || '#'} target='_blank'>
|
|
2001
|
-
// <Button size='sm' className='event-registration-button'>
|
|
2002
|
-
// Register Now
|
|
2003
|
-
// </Button>
|
|
2004
|
-
// </a>
|
|
2005
|
-
// )
|
|
2006
|
-
// } else {
|
|
2007
|
-
// return (
|
|
2008
|
-
// <a href={links.summary.href || '#'} target='_blank'>
|
|
2009
|
-
// <Button size='sm' className='event-registration-button'>
|
|
2010
|
-
// Learn more
|
|
2011
|
-
// </Button>
|
|
2012
|
-
// </a>
|
|
2013
|
-
// )
|
|
2014
|
-
// }
|
|
2015
1929
|
};
|
|
2016
1930
|
|
|
2017
1931
|
var cardLoader = function cardLoader() {
|
|
2018
1932
|
var numberOfItemsBeforeAd = 5;
|
|
2019
1933
|
return React__default.createElement(
|
|
2020
|
-
|
|
2021
|
-
|
|
1934
|
+
Container,
|
|
1935
|
+
{ style: { padding: 1 } },
|
|
2022
1936
|
data && data.map(function (row, index) {
|
|
2023
1937
|
var speakerInfo = [];
|
|
2024
1938
|
if (row.customFields) {
|
|
@@ -2052,105 +1966,97 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2052
1966
|
return result;
|
|
2053
1967
|
}, '') : '';
|
|
2054
1968
|
|
|
2055
|
-
var pageNumber = row.pageNumber || 1;
|
|
2056
1969
|
return React__default.createElement(
|
|
2057
1970
|
React__default.Fragment,
|
|
2058
1971
|
{ key: index },
|
|
2059
1972
|
React__default.createElement(
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
} },
|
|
2065
|
-
React__default.createElement(
|
|
2066
|
-
Card,
|
|
1973
|
+
Card,
|
|
1974
|
+
null,
|
|
1975
|
+
isRegister && _links && React__default.createElement(
|
|
1976
|
+
Row,
|
|
2067
1977
|
null,
|
|
2068
|
-
|
|
2069
|
-
|
|
1978
|
+
React__default.createElement(
|
|
1979
|
+
Col,
|
|
2070
1980
|
null,
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
1981
|
+
renderRegisterButton(_links)
|
|
1982
|
+
)
|
|
1983
|
+
),
|
|
1984
|
+
discussionTopic && React__default.createElement(
|
|
1985
|
+
Row,
|
|
1986
|
+
null,
|
|
1987
|
+
React__default.createElement(
|
|
1988
|
+
Col,
|
|
2079
1989
|
null,
|
|
2080
|
-
React__default.createElement(
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
1990
|
+
React__default.createElement('h5', { className: 'topic', style: { fontWeight: '500', marginBottom: 0 }, dangerouslySetInnerHTML: { __html: discussionTopic } })
|
|
1991
|
+
)
|
|
1992
|
+
),
|
|
1993
|
+
start && timezone && React__default.createElement(
|
|
1994
|
+
Row,
|
|
1995
|
+
null,
|
|
1996
|
+
React__default.createElement(
|
|
1997
|
+
Col,
|
|
2088
1998
|
null,
|
|
2089
1999
|
React__default.createElement(
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
'p',
|
|
2094
|
-
{ className: 'start-time', style: { padding: 0, margin: 0 } },
|
|
2095
|
-
momentTimezone$1(start).tz(timezone).format('LLL')
|
|
2096
|
-
)
|
|
2000
|
+
'p',
|
|
2001
|
+
{ className: 'start-time', style: { padding: 0, margin: 0 } },
|
|
2002
|
+
momentTimezone$1(start).tz(timezone).format('LLL')
|
|
2097
2003
|
)
|
|
2098
|
-
)
|
|
2099
|
-
|
|
2100
|
-
|
|
2004
|
+
)
|
|
2005
|
+
),
|
|
2006
|
+
eventRegion && React__default.createElement(
|
|
2007
|
+
Row,
|
|
2008
|
+
null,
|
|
2009
|
+
React__default.createElement(
|
|
2010
|
+
Col,
|
|
2101
2011
|
null,
|
|
2102
2012
|
React__default.createElement(
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
'p',
|
|
2107
|
-
{ className: 'event-region', style: { padding: 0, margin: 0 } },
|
|
2108
|
-
eventRegion
|
|
2109
|
-
)
|
|
2013
|
+
'p',
|
|
2014
|
+
{ className: 'event-region', style: { padding: 0, margin: 0 } },
|
|
2015
|
+
eventRegion
|
|
2110
2016
|
)
|
|
2111
|
-
)
|
|
2112
|
-
|
|
2113
|
-
|
|
2017
|
+
)
|
|
2018
|
+
),
|
|
2019
|
+
venues && venues.length && venues[0].name && React__default.createElement(
|
|
2020
|
+
Row,
|
|
2021
|
+
null,
|
|
2022
|
+
React__default.createElement(
|
|
2023
|
+
Col,
|
|
2114
2024
|
null,
|
|
2115
2025
|
React__default.createElement(
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
'p',
|
|
2120
|
-
{ className: 'venue', style: { padding: 0, margin: 0 } },
|
|
2121
|
-
venues[0].name
|
|
2122
|
-
)
|
|
2026
|
+
'p',
|
|
2027
|
+
{ className: 'venue', style: { padding: 0, margin: 0 } },
|
|
2028
|
+
venues[0].name
|
|
2123
2029
|
)
|
|
2124
|
-
)
|
|
2125
|
-
|
|
2126
|
-
|
|
2030
|
+
)
|
|
2031
|
+
),
|
|
2032
|
+
speakerInfo && speakerInfo.length && React__default.createElement(
|
|
2033
|
+
Row,
|
|
2034
|
+
null,
|
|
2035
|
+
React__default.createElement(
|
|
2036
|
+
Col,
|
|
2127
2037
|
null,
|
|
2128
2038
|
React__default.createElement(
|
|
2129
|
-
|
|
2130
|
-
|
|
2039
|
+
'div',
|
|
2040
|
+
{ className: 'speaker-section', style: { border: '1px solid', borderRadius: '8px', padding: '8px' } },
|
|
2131
2041
|
React__default.createElement(
|
|
2132
|
-
'
|
|
2133
|
-
{ className: 'speaker-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
})
|
|
2151
|
-
);
|
|
2152
|
-
})
|
|
2153
|
-
)
|
|
2042
|
+
'h6',
|
|
2043
|
+
{ className: 'speaker-title', style: { fontWeight: '600', marginBottom: '0', marginTop: '.25rem' } },
|
|
2044
|
+
'SPEAKER'
|
|
2045
|
+
),
|
|
2046
|
+
speakerInfo.map(function (info, index) {
|
|
2047
|
+
return React__default.createElement(
|
|
2048
|
+
'p',
|
|
2049
|
+
{ key: index, style: { marginBottom: '0' } },
|
|
2050
|
+
info.value.map(function (speaker, index) {
|
|
2051
|
+
return React__default.createElement(
|
|
2052
|
+
'b',
|
|
2053
|
+
{ key: index, className: 'kol-speaker' },
|
|
2054
|
+
speaker,
|
|
2055
|
+
info.value.length > index + 1 ? ', ' : ''
|
|
2056
|
+
);
|
|
2057
|
+
})
|
|
2058
|
+
);
|
|
2059
|
+
})
|
|
2154
2060
|
)
|
|
2155
2061
|
)
|
|
2156
2062
|
)
|
|
@@ -2179,20 +2085,6 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2179
2085
|
);
|
|
2180
2086
|
};
|
|
2181
2087
|
|
|
2182
|
-
var renderManualPagination = function renderManualPagination() {
|
|
2183
|
-
var currentPage = 1;
|
|
2184
|
-
return React__default.createElement(
|
|
2185
|
-
'div',
|
|
2186
|
-
{ className: 'd-flex justify-content-between' },
|
|
2187
|
-
currentPage > 1 ,
|
|
2188
|
-
React__default.createElement(
|
|
2189
|
-
'a',
|
|
2190
|
-
{ href: '?page=' + (currentPage + 1) },
|
|
2191
|
-
'Next >>'
|
|
2192
|
-
)
|
|
2193
|
-
);
|
|
2194
|
-
};
|
|
2195
|
-
|
|
2196
2088
|
if (isLoading) {
|
|
2197
2089
|
return React__default.createElement(
|
|
2198
2090
|
'div',
|
|
@@ -2215,57 +2107,10 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2215
2107
|
return React__default.createElement(
|
|
2216
2108
|
'div',
|
|
2217
2109
|
{ className: 'cvent-events' },
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
InfiniteScroll,
|
|
2223
|
-
{ dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
2224
|
-
React__default.createElement(
|
|
2225
|
-
Container,
|
|
2226
|
-
null,
|
|
2227
|
-
cardLoader()
|
|
2228
|
-
)
|
|
2229
|
-
),
|
|
2230
|
-
React__default.createElement(
|
|
2231
|
-
'noscript',
|
|
2232
|
-
null,
|
|
2233
|
-
renderManualPagination()
|
|
2234
|
-
)
|
|
2235
|
-
) : React__default.createElement(
|
|
2236
|
-
React__default.Fragment,
|
|
2237
|
-
null,
|
|
2238
|
-
React__default.createElement(
|
|
2239
|
-
Container,
|
|
2240
|
-
null,
|
|
2241
|
-
cardLoader()
|
|
2242
|
-
),
|
|
2243
|
-
React__default.createElement(
|
|
2244
|
-
'div',
|
|
2245
|
-
{ style: { padding: '0px 10px' } },
|
|
2246
|
-
scrolling ? React__default.createElement(
|
|
2247
|
-
'button',
|
|
2248
|
-
{
|
|
2249
|
-
style: { margin: 'auto', width: '100%' },
|
|
2250
|
-
onClick: function onClick(e) {
|
|
2251
|
-
loadMore();
|
|
2252
|
-
} },
|
|
2253
|
-
'Load More'
|
|
2254
|
-
) : React__default.createElement(
|
|
2255
|
-
'p',
|
|
2256
|
-
{ style: { textAlign: 'center' } },
|
|
2257
|
-
React__default.createElement(
|
|
2258
|
-
'b',
|
|
2259
|
-
null,
|
|
2260
|
-
'End of data'
|
|
2261
|
-
)
|
|
2262
|
-
)
|
|
2263
|
-
),
|
|
2264
|
-
React__default.createElement(
|
|
2265
|
-
'noscript',
|
|
2266
|
-
null,
|
|
2267
|
-
renderManualPagination()
|
|
2268
|
-
)
|
|
2110
|
+
React__default.createElement(
|
|
2111
|
+
InfiniteScroll,
|
|
2112
|
+
{ dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
2113
|
+
cardLoader()
|
|
2269
2114
|
)
|
|
2270
2115
|
);
|
|
2271
2116
|
} else {
|