diff --git a/src/components/layout/content/Content.tsx b/src/components/layout/content/Content.tsx index bf63fdf09e..57b5cce36c 100644 --- a/src/components/layout/content/Content.tsx +++ b/src/components/layout/content/Content.tsx @@ -1,6 +1,6 @@ export const Content: Component = ({ children }) => { return ( -
+
{children}
) diff --git a/src/components/widgets/shared/ActionAsideContainer.tsx b/src/components/widgets/shared/ActionAsideContainer.tsx index 50acfeb787..d79505d81c 100644 --- a/src/components/widgets/shared/ActionAsideContainer.tsx +++ b/src/components/widgets/shared/ActionAsideContainer.tsx @@ -1,17 +1,30 @@ 'use client' +import { useViewport } from '~/atoms' import { clsxm } from '~/lib/helper' +import { usePageScrollLocationSelector } from '~/providers/root/page-scroll-info-provider' import { useIsEOWrappedElement } from '~/providers/shared/WrappedElementProvider' export const ActionAsideContainer: Component = ({ className, children }) => { const isEOA = useIsEOWrappedElement() + const h = useViewport((v) => v.h) + + const isEndOfPage = usePageScrollLocationSelector( + (y) => { + const threshold = 100 + + return y + h >= document.body.scrollHeight - threshold + }, + [h], + ) return (
{children} diff --git a/src/components/widgets/shared/ArticleRightAside.tsx b/src/components/widgets/shared/ArticleRightAside.tsx index a15cea5efe..3a865acb8a 100644 --- a/src/components/widgets/shared/ArticleRightAside.tsx +++ b/src/components/widgets/shared/ArticleRightAside.tsx @@ -74,7 +74,7 @@ const ArticleRightAsideImpl: Component = ({ children }) => { />
{React.cloneElement(children as any, { - className: 'ml-4 translate-y-[calc(100%+24px)]', + className: 'translate-y-[calc(100%+24px)]', })} )