Merge of Insiders features tied to 'Black Pearl' funding goal

This commit is contained in:
squidfunk
2021-03-29 18:46:57 +02:00
parent 8677190f3f
commit ca3da9e3ca
51 changed files with 867 additions and 194 deletions

View File

@@ -26,11 +26,16 @@ import {
finalize,
map,
observeOn,
switchMap,
tap
} from "rxjs/operators"
import { resetTabsState, setTabsState } from "~/actions"
import { Viewport, watchViewportAt } from "~/browser"
import {
Viewport,
watchElementSize,
watchViewportAt
} from "~/browser"
import { Component } from "../_"
import { Header } from "../header"
@@ -81,8 +86,9 @@ interface MountOptions {
export function watchTabs(
el: HTMLElement, { viewport$, header$ }: WatchOptions
): Observable<Tabs> {
return watchViewportAt(el, { header$, viewport$ })
return watchElementSize(document.body)
.pipe(
switchMap(() => watchViewportAt(el, { header$, viewport$ })),
map(({ offset: { y } }) => {
return {
hidden: y >= 10