1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-08 15:06:08 +02:00

Migrating contentBlock to functional component

This commit is contained in:
Jesús Espino 2021-03-31 12:32:52 +02:00
parent 3bf1b574bc
commit ccba85bf27

View File

@ -30,15 +30,14 @@ type Props = {
intl: IntlShape intl: IntlShape
} }
class ContentBlock extends React.PureComponent<Props> { const ContentBlock = React.memo((props: Props): JSX.Element => {
public render(): JSX.Element | null { const {intl, card, contents, block, readonly} = props
const {intl, card, contents, block, readonly} = this.props
const index = contents.indexOf(block) const index = contents.indexOf(block)
return ( return (
<div className='ContentBlock octo-block'> <div className='ContentBlock octo-block'>
<div className='octo-block-margin'> <div className='octo-block-margin'>
{!this.props.readonly && {!props.readonly &&
<MenuWrapper> <MenuWrapper>
<IconButton icon={<OptionsIcon/>}/> <IconButton icon={<OptionsIcon/>}/>
<Menu> <Menu>
@ -102,7 +101,6 @@ class ContentBlock extends React.PureComponent<Props> {
/> />
</div> </div>
) )
} })
}
export default injectIntl(ContentBlock) export default injectIntl(ContentBlock)