Skip to content

Commit

Permalink
fixing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
0XYoussefX0 committed May 21, 2024
2 parents 8c6d4c0 + 48bc1c0 commit d9e6255
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ const Navbar = () => {
};
}, []);

useEffect(() => {
const getScrollbarWidth = () => {
return window.innerWidth - document.documentElement.clientWidth;
};

const setScrollbarWidth = () => {
const scrollbarWidth = getScrollbarWidth();
document.documentElement.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`);
};

setScrollbarWidth(); // Set the scrollbar width initially

window.addEventListener('resize', setScrollbarWidth); // Update the scrollbar width when the window is resized

return () => {
window.removeEventListener('resize', setScrollbarWidth);
};
}, []);

return (
<>
<div className={styles.emptySpacePlaceholder} />
Expand Down

0 comments on commit d9e6255

Please sign in to comment.