#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; title: React.ReactNode;
} }
export default class RhsPlugin extends React.PureComponent<Props> { const RhsPlugin = ({showPluggable, pluggableId, title}: Props) => {
render() { return (
return ( <div
<div id='rhsContainer'
id='rhsContainer' className='sidebar-right__body'
className='sidebar-right__body' >
> <SearchResultsHeader>
<SearchResultsHeader> {title}
{this.props.title} </SearchResultsHeader>
</SearchResultsHeader> {
{ showPluggable &&
this.props.showPluggable && <Pluggable
<> pluggableName='RightHandSidebarComponent'
<Pluggable pluggableId={pluggableId}
pluggableName='RightHandSidebarComponent' />
pluggableId={this.props.pluggableId} }
/> </div>
</> );
} };
</div>
); export default React.memo(RhsPlugin);
}
}