44 <div v-if =" !historyFetched" class =" mx-auto flex items-center justify-center mt-32" >
55 <img class =" h-36" src =" ../../assets/loading.svg" >
66 </div >
7- <section v-bind:class =" {'mx-auto': true, 'mt-4': true, 'invisible': !historyFetched}" >
7+ <section v-bind:class =" {'mx-auto': true, 'mt-4': true, 'invisible': !historyFetched, 'relative': true, }" >
88 <div class =" flex items-center justify-center md:justify-start w-full mb-4" >
99 <h1
1010 class =" text-3xl sm:text-5xl my-4 inline-block text-center leading-none onboarding-sub-container-content-heading" >
1818 </div >
1919 <HistoryRecommendations
2020 v-if =" recommendationsAnalysisDone"
21+ v-bind:showCount =" showCount"
22+ v-on:reset-show-count =" resetShowCount()"
2123 v-on:filtered-count =" filteredCountSave"
2224 v-bind:title =" 'Potential matches'"
2325 v-bind:recommendationsReceived =" recommendations"
2426 v-bind:recommendationsAnalysis =" recommendationsAnalysis" ></HistoryRecommendations >
27+ <div id =" invisibleFooterHistory" class =" h-4 absolute bottom-0 w-full" ></div >
28+ <ScrollUpButton ></ScrollUpButton >
2529 </section >
2630 </div >
2731</template >
3236
3337import HistoryRecommendations from ' @/components/app/recommendations/HistoryRecommendations.vue' ;
3438import DropdownDisplayChoiceHistory from ' @/components/shared/DropdownDisplayChoiceHistory.vue' ;
39+ import ScrollUpButton from ' @/components/shared/ScrollUpButton.vue' ;
3540
3641export default {
3742 name: ' History' ,
3843 props: [' recommendationsFromSettingUp' ],
3944 components: {
4045 HistoryRecommendations,
4146 DropdownDisplayChoiceHistory,
47+ ScrollUpButton,
4248 },
4349 data : () => ({
4450 recommendations: [],
@@ -61,6 +67,7 @@ export default {
6167 filteredCount: null ,
6268 historyFetched: false ,
6369 visitUser: false ,
70+ showCount: 10 ,
6471 }),
6572 methods: {
6673 async fetchUsers (request ) {
@@ -129,6 +136,7 @@ export default {
129136 this .recommendationsAnalysisDone = false ;
130137 this .historyFetched = false ;
131138 this .visitUser = false ;
139+ this .showCount = 10 ;
132140 },
133141 async updateHistory (... args ) {
134142 const [key , value ] = args;
@@ -142,6 +150,23 @@ export default {
142150 const [count ] = args;
143151 this .filteredCount = count;
144152 },
153+ handleIntersect (entries ) {
154+ if (entries[0 ].isIntersecting ) {
155+ this .showCount += 10 ;
156+ }
157+ },
158+ resetShowCount () {
159+ this .showCount = 10 ;
160+ },
161+ },
162+ mounted () {
163+ const options = {
164+ root: null ,
165+ rootMargins: ' 0px' ,
166+ threshold: 0.5 ,
167+ };
168+ const observer = new IntersectionObserver (this .handleIntersect , options);
169+ observer .observe (document .querySelector (' #invisibleFooterHistory' ));
145170 },
146171 async beforeRouteEnter (to , from , next ) {
147172 next (async (vm ) => {
0 commit comments