Skip to content

Commit

Permalink
fix: aside will be covered by footer
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jul 13, 2023
1 parent df8f376 commit 4d897d0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/layout/content/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const Content: Component = ({ children }) => {
return (
<main className="relative z-[2] px-4 pt-[4.5rem] fill-content md:px-0">
<main className="relative z-[1] px-4 pt-[4.5rem] fill-content md:px-0">
{children}
</main>
)
Expand Down
15 changes: 14 additions & 1 deletion src/components/widgets/shared/ActionAsideContainer.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div
className={clsxm(
'absolute bottom-0 left-0 max-h-[300px] flex-col space-y-8 transition-opacity duration-200 ease-in-out',
'absolute bottom-0 left-0 -mb-4 max-h-[300px] flex-col space-y-8 p-4 transition-all duration-200 ease-in-out',
!isEOA ? 'opacity-20 hover:opacity-100' : '',
className,
isEndOfPage && 'bottom-[100px]',
)}
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/shared/ArticleRightAside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const ArticleRightAsideImpl: Component = ({ children }) => {
/>
</div>
{React.cloneElement(children as any, {
className: 'ml-4 translate-y-[calc(100%+24px)]',
className: 'translate-y-[calc(100%+24px)]',
})}
</aside>
)
Expand Down

1 comment on commit 4d897d0

@vercel
Copy link

@vercel vercel bot commented on 4d897d0 Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-innei.vercel.app
springtide.vercel.app
shiro-git-main-innei.vercel.app
innei.in

Please sign in to comment.