@guardian/interactive-component-library 0.1.0-alpha.45 → 0.1.0-alpha.46
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.
|
@@ -7707,15 +7707,15 @@ function Gradient() {
|
|
|
7707
7707
|
})]
|
|
7708
7708
|
});
|
|
7709
7709
|
}
|
|
7710
|
-
const ticker = "
|
|
7711
|
-
const tickerItems = "
|
|
7712
|
-
const tickerScroll = "
|
|
7713
|
-
const tickerItem = "
|
|
7714
|
-
const controls = "
|
|
7715
|
-
const gradient = "
|
|
7716
|
-
const buttons = "
|
|
7717
|
-
const button = "
|
|
7718
|
-
const buttonInner = "
|
|
7710
|
+
const ticker = "_ticker_1jg88_9";
|
|
7711
|
+
const tickerItems = "_tickerItems_1jg88_21";
|
|
7712
|
+
const tickerScroll = "_tickerScroll_1jg88_26";
|
|
7713
|
+
const tickerItem = "_tickerItem_1jg88_21";
|
|
7714
|
+
const controls = "_controls_1jg88_48";
|
|
7715
|
+
const gradient = "_gradient_1jg88_63";
|
|
7716
|
+
const buttons = "_buttons_1jg88_75";
|
|
7717
|
+
const button = "_button_1jg88_75";
|
|
7718
|
+
const buttonInner = "_buttonInner_1jg88_101";
|
|
7719
7719
|
const styles = {
|
|
7720
7720
|
ticker,
|
|
7721
7721
|
tickerItems,
|
|
@@ -7752,12 +7752,18 @@ function Ticker({
|
|
|
7752
7752
|
setPageWidth(pageWidth2);
|
|
7753
7753
|
const numberOfPages2 = Math.ceil(tickerScrollRef.current.scrollWidth / pageWidth2);
|
|
7754
7754
|
setNumberOfPages(numberOfPages2);
|
|
7755
|
-
}, []);
|
|
7755
|
+
}, [childArray]);
|
|
7756
7756
|
useLayoutEffect(() => {
|
|
7757
7757
|
const hideButtons2 = childArray.length < 4;
|
|
7758
7758
|
setHideButtons(hideButtons2);
|
|
7759
7759
|
}, [childArray]);
|
|
7760
7760
|
function toggleExpandedState() {
|
|
7761
|
+
if (expanded) {
|
|
7762
|
+
tickerRef.current.scrollIntoView({
|
|
7763
|
+
behavior: "smooth",
|
|
7764
|
+
alignToTop: true
|
|
7765
|
+
});
|
|
7766
|
+
}
|
|
7761
7767
|
setExpanded((expanded2) => {
|
|
7762
7768
|
const newState = !expanded2;
|
|
7763
7769
|
if (onStateChange)
|