refactor: place all presentation code in a presentation folder
Some features didn't have this folder.
Bug: twpowertools:226
Change-Id: Ic9803e7ee66a15c6c9e083509e059e453a26ed0f
diff --git a/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
new file mode 100644
index 0000000..ad6e153
--- /dev/null
+++ b/src/features/infiniteScroll/presentation/nodeWatcherHandlers/ccInfiniteScrollSetUp.handler.ts
@@ -0,0 +1,17 @@
+import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import CCInfiniteScroll from '../../core/ccInfiniteScroll';
+
+export default class CCInfiniteScrollSetUpHandler extends CssSelectorNodeWatcherHandler {
+ cssSelector = 'ec-app, .scrollable-content';
+
+ constructor(private ccInfiniteScroll: CCInfiniteScroll) {
+ super();
+ }
+
+ onMutatedNode({ node }: NodeMutation) {
+ if (!(node instanceof Element)) return;
+ const isScrollableContent = node.classList.contains('scrollable-content');
+ this.ccInfiniteScroll.setUpIntersectionObserver(node, isScrollableContent);
+ }
+}