mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-05 16:37:43 +00:00
64b4200fc3
- Dissociate the chat observer (which persists messages in a store) from chat rendering. - Do not keep the chat mounted in the DOM anymore. - Recompute the minimal amount of data when a participant renames. - Memoize most of the layout. - Drop the manual textarea row-size computation: recent React Aria already handles it. Known regressions still to solve: focus behavior on the input, scroll behavior on message updates, and edge cases around list sizing. Not sure yet whether there is a better way to memoize the virtualized list; open to feedback.
31 lines
768 B
TypeScript
31 lines
768 B
TypeScript
import React from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { Button } from '@/primitives'
|
|
import { RiSendPlane2Fill } from '@remixicon/react'
|
|
|
|
type ChatSubmitButtonProps = {
|
|
handleSubmit: () => Promise<void>
|
|
isDisabled: boolean
|
|
}
|
|
|
|
export const ChatSubmitButton = React.memo(
|
|
({ handleSubmit, isDisabled }: ChatSubmitButtonProps) => {
|
|
const { t } = useTranslation('rooms', { keyPrefix: 'controls.chat.input' })
|
|
return (
|
|
<Button
|
|
square
|
|
invisible
|
|
variant="tertiaryText"
|
|
size="sm"
|
|
onPress={handleSubmit}
|
|
isDisabled={isDisabled}
|
|
aria-label={t('button.label')}
|
|
>
|
|
<RiSendPlane2Fill />
|
|
</Button>
|
|
)
|
|
}
|
|
)
|
|
|
|
ChatSubmitButton.displayName = 'ChatSubmitButton'
|