Skip to content

Commit

Permalink
chore: renaming isStuck to isIntersecting
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-golovanov committed Jan 29, 2025
1 parent 2e82109 commit 3c6c283
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const DismissibleTabBar = ({
disableAdd = false,
onTabAdd,
}: DismissibleTabBarProps) => {
const [isLeftStuck, setIsLeftStuck] = useState(false);
const [isRightStuck, setIsRightStuck] = useState(false);
const [isLeftIntersecting, setIsLeftIntersecting] = useState(false);
const [isRightIntersecting, setIsRightIntersecting] = useState(false);

const containerRef = useRef<HTMLDivElement | null>(null);
const sentinelLeftRef = useRef<HTMLDivElement | null>(null);
Expand All @@ -48,11 +48,11 @@ export const DismissibleTabBar = ({
(entries) => {
entries.forEach((entry) => {
if (entry.target === sentinelLeftRef.current) {
setIsLeftStuck(!entry.isIntersecting);
setIsLeftIntersecting(!entry.isIntersecting);
}

if (entry.target === sentinelRightRef.current) {
setIsRightStuck(!entry.isIntersecting);
setIsRightIntersecting(!entry.isIntersecting);
}
});
},
Expand Down Expand Up @@ -83,7 +83,7 @@ export const DismissibleTabBar = ({
);

return (
<Styled.Root $showLeftBorder={isLeftStuck}>
<Styled.Root $showLeftBorder={isLeftIntersecting}>
<ScrollArea
data-testid="t--editor-tabs"
options={SCROLL_AREA_OPTIONS}
Expand All @@ -97,7 +97,7 @@ export const DismissibleTabBar = ({
<Styled.StickySentinel ref={sentinelRightRef} />
</Styled.TabsContainer>
</ScrollArea>
<Styled.PlusButtonContainer $showLeftBorder={isRightStuck}>
<Styled.PlusButtonContainer $showLeftBorder={isRightIntersecting}>
<Styled.PlusButton
isDisabled={disableAdd}
isIconButton
Expand Down

0 comments on commit 3c6c283

Please sign in to comment.