set position to fixed for article container wrapper in /app routes
This commit is contained in:
@ -1,6 +1,12 @@
|
||||
import { PageMetaData, PageMetaDataProps } from '../patterns/PageMetaData'
|
||||
import { Box } from '../elements/LayoutPrimitives'
|
||||
import { ReactNode, MutableRefObject, useEffect, useContext, useState } from 'react'
|
||||
import {
|
||||
ReactNode,
|
||||
MutableRefObject,
|
||||
useEffect,
|
||||
useContext,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { PrimaryHeader } from './../patterns/PrimaryHeader'
|
||||
import { useGetViewerQuery } from '../../lib/networking/queries/useGetViewerQuery'
|
||||
import { navigationCommands } from '../../lib/keyboardShortcuts/navigationShortcuts'
|
||||
@ -11,7 +17,6 @@ import { ConfirmationModal } from '../patterns/ConfirmationModal'
|
||||
import { KeyboardShortcutListModal } from './KeyboardShortcutListModal'
|
||||
import { logoutMutation } from '../../lib/networking/mutations/logoutMutation'
|
||||
|
||||
|
||||
type PrimaryLayoutProps = {
|
||||
children: ReactNode
|
||||
pageTestId: string
|
||||
@ -25,7 +30,8 @@ export function PrimaryLayout(props: PrimaryLayoutProps): JSX.Element {
|
||||
const { viewerData } = useGetViewerQuery()
|
||||
const router = useRouter()
|
||||
const [showLogoutConfirmation, setShowLogoutConfirmation] = useState(false)
|
||||
const [showKeyboardCommandsModal, setShowKeyboardCommandsModal] = useState(false)
|
||||
const [showKeyboardCommandsModal, setShowKeyboardCommandsModal] =
|
||||
useState(false)
|
||||
|
||||
useKeyboardShortcuts(navigationCommands(router))
|
||||
|
||||
|
||||
@ -63,10 +63,12 @@ export function Article(props: ArticleProps): JSX.Element {
|
||||
|
||||
// Post message to webkit so apple app embeds get progress updates
|
||||
useEffect(() => {
|
||||
window?.webkit?.messageHandlers.readingProgressUpdate?.postMessage({
|
||||
progress: debouncedReadingProgress,
|
||||
})
|
||||
}, [debouncedReadingProgress])
|
||||
if (typeof window?.webkit != 'undefined') {
|
||||
window.webkit.messageHandlers.readingProgressUpdate?.postMessage({
|
||||
progress: debouncedReadingProgress,
|
||||
})
|
||||
}
|
||||
}, [readingProgress, debouncedReadingProgress])
|
||||
|
||||
const setScrollWatchedElement = useScrollWatcher(
|
||||
(changeset: ScrollOffsetChangeset) => {
|
||||
|
||||
@ -69,6 +69,7 @@ function AppArticleEmbedContent(
|
||||
<Box
|
||||
ref={scrollRef}
|
||||
css={{
|
||||
position: 'fixed',
|
||||
overflowY: 'auto',
|
||||
height: '100%',
|
||||
width: '100vw',
|
||||
|
||||
Reference in New Issue
Block a user