fix: show ScrollToTopButton in two-column layout (#635)
This commit is contained in:
parent
63c9713ea8
commit
b842d1eabf
1 changed files with 1 additions and 4 deletions
|
|
@ -2,7 +2,6 @@ import { Button } from '@/components/ui/button'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { useDeepBrowsing } from '@/providers/DeepBrowsingProvider'
|
import { useDeepBrowsing } from '@/providers/DeepBrowsingProvider'
|
||||||
import { useScreenSize } from '@/providers/ScreenSizeProvider'
|
import { useScreenSize } from '@/providers/ScreenSizeProvider'
|
||||||
import { useUserPreferences } from '@/providers/UserPreferencesProvider'
|
|
||||||
import { hasBackgroundAudioAtom } from '@/services/media-manager.service'
|
import { hasBackgroundAudioAtom } from '@/services/media-manager.service'
|
||||||
import { useAtomValue } from 'jotai'
|
import { useAtomValue } from 'jotai'
|
||||||
import { ChevronUp } from 'lucide-react'
|
import { ChevronUp } from 'lucide-react'
|
||||||
|
|
@ -15,7 +14,6 @@ export default function ScrollToTopButton({
|
||||||
scrollAreaRef?: React.RefObject<HTMLDivElement>
|
scrollAreaRef?: React.RefObject<HTMLDivElement>
|
||||||
className?: string
|
className?: string
|
||||||
}) {
|
}) {
|
||||||
const { enableSingleColumnLayout } = useUserPreferences()
|
|
||||||
const { deepBrowsing, lastScrollTop } = useDeepBrowsing()
|
const { deepBrowsing, lastScrollTop } = useDeepBrowsing()
|
||||||
const { isSmallScreen } = useScreenSize()
|
const { isSmallScreen } = useScreenSize()
|
||||||
const hasBackgroundAudio = useAtomValue(hasBackgroundAudioAtom)
|
const hasBackgroundAudio = useAtomValue(hasBackgroundAudioAtom)
|
||||||
|
|
@ -54,8 +52,7 @@ export default function ScrollToTopButton({
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'z-30 flex justify-end w-full pr-3 pointer-events-none transition-opacity duration-700',
|
'sticky z-30 flex justify-end w-full pr-3 pointer-events-none transition-opacity duration-700',
|
||||||
enableSingleColumnLayout ? 'sticky' : 'fixed',
|
|
||||||
visible ? '' : 'opacity-0',
|
visible ? '' : 'opacity-0',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue