#24774 Converted ./plugins/rhs_plugin/rhs_plugin.tsx to Function Component (#24802)

* #24774 Converted ./plugins/rhs_plugin/rhs_plugin.tsx to Function Component

* Fixed the lint errors and removed explicit FC type

* Added memo to make the functional component pure.
Этот коммит содержится в:
Balaji K
2023-10-17 14:12:36 +05:30
коммит произвёл GitHub
родитель 4633d4d3b9
Коммит 2b2743d9cb

Просмотреть файл

@@ -13,26 +13,24 @@ export type Props = {
title: React.ReactNode;
}
export default class RhsPlugin extends React.PureComponent<Props> {
render() {
return (
<div
id='rhsContainer'
className='sidebar-right__body'
>
<SearchResultsHeader>
{this.props.title}
</SearchResultsHeader>
{
this.props.showPluggable &&
<>
<Pluggable
pluggableName='RightHandSidebarComponent'
pluggableId={this.props.pluggableId}
/>
</>
}
</div>
);
}
}
const RhsPlugin = ({showPluggable, pluggableId, title}: Props) => {
return (
<div
id='rhsContainer'
className='sidebar-right__body'
>
<SearchResultsHeader>
{title}
</SearchResultsHeader>
{
showPluggable &&
<Pluggable
pluggableName='RightHandSidebarComponent'
pluggableId={pluggableId}
/>
}
</div>
);
};
export default React.memo(RhsPlugin);