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

fix: collapsible menu slowness #255

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Conversation

xoRmalka
Copy link
Member

Update for #254 #215

Description

The collapsible menu on the dashboard page was slow when opening and closing

@NoamGaash
Copy link
Member

image

Copy link
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

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

lets use responsive containers rather than state maintenance

const [containerWidth, setContainerWidth] = useState<number | undefined>(undefined)

const chartContainerStyle = {
maxWidth: containerWidth ? `${containerWidth - 380}px` : '100%',
Copy link
Member

Choose a reason for hiding this comment

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

@xoRmalka
Copy link
Member Author

xoRmalka commented Nov 29, 2023

After digging around the web and the documentation of Recharts 📢
I found that "ResponsiveContainer" has a "debounce" prop that can be used to control how often the resize event is handled.

@NoamGaash @shootermv

@xoRmalka xoRmalka merged commit 61e7794 into hasadna:main Nov 29, 2023
9 checks passed
@xoRmalka xoRmalka deleted the fix-collapsible-menu branch November 29, 2023 21:38
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.

Collapsible menu(at dashboard page) - make the collapse animation faster
3 participants