Convert ./components/integrations/integration_option.tsx to functional component (#24806)
* Convert ./components/integrations/integration_option.tsx to functional component * update integration_option component * improve integration_option component
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
89eae8babe
Коммит
a2475a46a6
@@ -11,27 +11,25 @@ type Props = {
|
||||
link: string;
|
||||
}
|
||||
|
||||
export default class IntegrationOption extends React.PureComponent <Props> {
|
||||
render() {
|
||||
const {image, title, description, link} = this.props;
|
||||
const IntegrationOption = ({image, title, description, link}: Props) => {
|
||||
return (
|
||||
<Link
|
||||
to={link}
|
||||
className='integration-option'
|
||||
>
|
||||
<img
|
||||
alt={'integration image'}
|
||||
className='integration-option__image'
|
||||
src={image}
|
||||
/>
|
||||
<div className='integration-option__title'>
|
||||
{title}
|
||||
</div>
|
||||
<div className='integration-option__description'>
|
||||
{description}
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Link
|
||||
to={link}
|
||||
className='integration-option'
|
||||
>
|
||||
<img
|
||||
alt={'integration image'}
|
||||
className='integration-option__image'
|
||||
src={image}
|
||||
/>
|
||||
<div className='integration-option__title'>
|
||||
{title}
|
||||
</div>
|
||||
<div className='integration-option__description'>
|
||||
{description}
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
}
|
||||
export default React.memo(IntegrationOption);
|
||||
|
||||
Ссылка в новой задаче
Block a user