Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed user menu #958

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Fixed user menu #958

merged 3 commits into from
Dec 13, 2024

Conversation

dani-moreno
Copy link
Collaborator

Description

Fixes the User menu to the bottom of the Sidebar, and adds a gradient style like the one we already have for scrolling the header.

This also requires to update Factorial to use the footer prop for the user menu in the Sidebar. I'll do it next.

Related: JIRA

Screenshots

Screen.Recording.2024-12-11.at.09.58.48.mov

Type of Change

  • New experimental component
  • Promote component from experimental to stable
  • Maintenance / Bug Fix / Other

Copy link

github-actions bot commented Dec 11, 2024

🔍 Visual review for your branch is published 🔍

Here are the links to:

@dani-moreno dani-moreno marked this pull request as ready for review December 11, 2024 09:04
@dani-moreno dani-moreno requested a review from a team as a code owner December 11, 2024 09:04
@dani-moreno dani-moreno requested a review from nlopin December 11, 2024 15:03
Comment on lines 44 to 68
useEffect(() => {
const observerOptions = { threshold: [1] }

const createObserver = (callback: (isIntersecting: boolean) => void) => {
return new IntersectionObserver(
([entry]) => callback(!entry.isIntersecting),
observerOptions
)
}

const topObserver = createObserver(setIsScrolled)
const bottomObserver = createObserver(setHasScrollBottom)

if (topScrollDetectorRef.current) {
topObserver.observe(topScrollDetectorRef.current)
}
if (bottomScrollDetectorRef.current) {
bottomObserver.observe(bottomScrollDetectorRef.current)
}

return () => {
topObserver.disconnect()
bottomObserver.disconnect()
}
}, [])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great work! But - you have this fantastic tool at your disposal useIntersectionObserver. It's in the usehooks-ts dependency 😉

https://usehooks-ts.com/react-hook/use-intersection-observer

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah right, thanks! That makes it a lot easier, haha :D

Comment on lines 131 to 137
<AnimatePresence>
{isScrolled && <ScrollShadow position="top" />}
</AnimatePresence>

<AnimatePresence>
{hasScrollBottom && <ScrollShadow position="bottom" />}
</AnimatePresence>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome work!

Copy link
Collaborator

@josepjaume josepjaume left a comment

Choose a reason for hiding this comment

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

Let's go!

@dani-moreno dani-moreno merged commit 00aa624 into main Dec 13, 2024
10 checks passed
@dani-moreno dani-moreno deleted the fixed-user-menu branch December 13, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants