Skip to content

Commit

Permalink
LayoutTree: Rename distanceFromTop -> layoutTop.
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Oct 26, 2024
1 parent f7404af commit 3cd0ef0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/LayoutTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const LayoutTree = () => {
// Height of toolbar element
const [toolbarHeight, setToolbarHeight] = useState(0)
// Distance from toolbar to the first visible thought
const [distanceFromTop, setDistanceFromTop] = useState(0)
const [layoutTop, setLayoutTop] = useState(0)

// set the bullet width only during drag or when simulateDrop is true
useLayoutEffect(() => {
Expand All @@ -392,7 +392,7 @@ const LayoutTree = () => {
const toolbar = document.querySelector('#toolbar')
if (toolbar) setToolbarHeight(toolbar.getBoundingClientRect().height)

setDistanceFromTop(ref.current?.getBoundingClientRect().top ?? 0)
setLayoutTop(ref.current?.getBoundingClientRect().top ?? 0)
}
}, [dragInProgress])

Expand Down Expand Up @@ -478,7 +478,7 @@ const LayoutTree = () => {
const { footerHeight, navbarHeight } = useNavAndFooterHeight()
const navAndFooterHeight = navbarHeight + footerHeight

const maxVisibleY = viewportHeight - (distanceFromTop + navbarHeight)
const maxVisibleY = viewportHeight - (layoutTop + navbarHeight)

const { isHoveringSorted, newRank } = useSortedContext()

Expand Down

0 comments on commit 3cd0ef0

Please sign in to comment.