[MM-54798] Convert ./components/widgets/separator/basic-separator.tsx to function component (#24788)
* chore(channels): convert basic separator to functional components * chore: change to arrow function --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ca012fc375
Коммит
e23fe22328
@@ -9,21 +9,20 @@ type Props = {
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
export default class BasicSeparator extends React.PureComponent<Props> {
|
||||
public render() {
|
||||
const {children} = this.props;
|
||||
return (
|
||||
<div
|
||||
data-testid='basicSeparator'
|
||||
className='Separator BasicSeparator'
|
||||
>
|
||||
<hr className='separator__hr'/>
|
||||
{children && (
|
||||
<div className='separator__text'>
|
||||
{children}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
const BasicSeparator = ({children}: Props) => {
|
||||
return (
|
||||
<div
|
||||
data-testid='basicSeparator'
|
||||
className='Separator BasicSeparator'
|
||||
>
|
||||
<hr className='separator__hr'/>
|
||||
{children && (
|
||||
<div className='separator__text'>
|
||||
{children}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(BasicSeparator);
|
||||
|
||||
Ссылка в новой задаче
Block a user