+
diff --git a/src/components/desktop/desktop-sub-header.vue b/src/components/desktop/desktop-sub-header.vue
new file mode 100644
index 00000000..4038a4a4
--- /dev/null
+++ b/src/components/desktop/desktop-sub-header.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/desktop/desktop-top-section.vue b/src/components/desktop/desktop-top-section.vue
new file mode 100644
index 00000000..f9f35e2c
--- /dev/null
+++ b/src/components/desktop/desktop-top-section.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/desktop/desktop.vue b/src/components/desktop/desktop.vue
index 23f6dd8b..50981b6b 100644
--- a/src/components/desktop/desktop.vue
+++ b/src/components/desktop/desktop.vue
@@ -1,6 +1,6 @@
-
+
@@ -10,14 +10,8 @@
-
-
-
@@ -62,33 +56,28 @@
import { MainScroll, Scroll } from '@empathyco/x-components/scroll';
import Main from '../main.vue';
import CustomQueryPreview from '../pre-search/custom-query-preview.vue';
- import PredictiveLayer from '../predictive-layer/predictive-layer.vue';
import ScrollToTop from '../scroll-to-top.vue';
import HasSearchedMixin from '../has-searched.mixin';
import MyHistoryAside from '../my-history/my-history-aside.vue';
import MyHistoryConfirmDisableModal from '../my-history/my-history-confirm-disable-modal.vue';
import MaxDesktopWidthItem from '../max-desktop-width-item.vue';
- import DesktopToolbar from './desktop-toolbar.vue';
- import DesktopHeaderFullPredictive from './desktop-header-full-predictive.vue';
+ import DesktopTopSection from './desktop-top-section.vue';
@Component({
components: {
+ DesktopTopSection,
MaxDesktopWidthItem,
- DesktopHeaderFullPredictive,
CustomQueryPreview,
BaseIdModal,
MyHistoryAside,
- DesktopToolbar,
LocationProvider,
Main,
MainScroll,
MyHistoryConfirmDisableModal,
- PredictiveLayer,
Scroll,
ScrollToTop,
DesktopAside: () => import('../search').then(m => m.DesktopAside),
NoResultsMessage: () => import('../search').then(m => m.NoResultsMessage),
- SelectedFilters: () => import('../search').then(m => m.SelectedFilters),
SpellcheckMessage: () => import('../search').then(m => m.SpellcheckMessage)
}
})
diff --git a/src/components/has-scroll-past-threshold.mixin.ts b/src/components/has-scroll-past-threshold.mixin.ts
new file mode 100644
index 00000000..c05e7c5d
--- /dev/null
+++ b/src/components/has-scroll-past-threshold.mixin.ts
@@ -0,0 +1,50 @@
+import { State } from '@empathyco/x-components';
+import Vue from 'vue';
+import Component from 'vue-class-component';
+import { Dictionary } from '@empathyco/x-utils';
+import { ScrollComponentState } from '@empathyco/x-components/scroll';
+import { Watch } from 'vue-property-decorator';
+@Component
+export default class IsScrollingUp extends Vue {
+ protected hasScrolledPastThresholdFlag = false;
+ protected scrollOffset = 200;
+
+ @State('scroll', 'data')
+ public scrollPositionsMap!: Dictionary;
+ protected get mainScrollPosition(): number {
+ return this.scrollPositionsMap['main-scroll']?.position;
+ }
+
+ @Watch('mainScrollPosition', { deep: true })
+ updateHasScrolledPastThreshold(): void {
+ // TODO change this implementation when the scroll module is fixed. Task EMP-1049
+ const mainScrollData = this.scrollPositionsMap['main-scroll'];
+
+ if (mainScrollData?.hasReachedStart) {
+ this.hasScrolledPastThresholdFlag = false;
+ return;
+ }
+
+ if (mainScrollData?.hasAlmostReachedEnd) {
+ this.hasScrolledPastThresholdFlag = true;
+ return;
+ }
+
+ const isScrollingUp = mainScrollData?.direction === 'UP';
+ if (isScrollingUp || this.mainScrollPosition < this.scrollOffset) {
+ this.hasScrolledPastThresholdFlag = false;
+ } else if (!isScrollingUp && this.mainScrollPosition > this.scrollOffset) {
+ this.hasScrolledPastThresholdFlag = true;
+ }
+ }
+
+ /**
+ * Checks the direction and the position of the scroll.
+ *
+ * @returns True if the user is scrolling up and has scrolled more than
+ * the defined scrollOffset.
+ */
+ protected get hasScrolledPastThreshold(): boolean {
+ return this.hasScrolledPastThresholdFlag;
+ }
+}