️(frontend) memoize the EffectsButton

Memoize the EffectsButton so it does not re-render on unrelated
parent updates when its props have not changed.
This commit is contained in:
lebaudantoine
2026-07-23 21:36:18 +02:00
committed by aleb_the_flash
parent 73aa162dc8
commit a663b4dc76
@@ -1,9 +1,10 @@
import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel' import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
import { Button } from '@/primitives' import { Button } from '@/primitives'
import { RiImageCircleAiFill } from '@remixicon/react' import { RiImageCircleAiFill } from '@remixicon/react'
export const EffectsButton = () => { export const EffectsButton = React.memo(() => {
const { t } = useTranslation('rooms', { keyPrefix: 'participantTileFocus' }) const { t } = useTranslation('rooms', { keyPrefix: 'participantTileFocus' })
const { isEffectsOpen, toggleEffects } = useSidePanel() const { isEffectsOpen, toggleEffects } = useSidePanel()
return ( return (
@@ -17,4 +18,6 @@ export const EffectsButton = () => {
<RiImageCircleAiFill /> <RiImageCircleAiFill />
</Button> </Button>
) )
} })
EffectsButton.displayName = 'EffectsButton'