[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;
|
children?: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class BasicSeparator extends React.PureComponent<Props> {
|
const BasicSeparator = ({children}: Props) => {
|
||||||
public render() {
|
return (
|
||||||
const {children} = this.props;
|
<div
|
||||||
return (
|
data-testid='basicSeparator'
|
||||||
<div
|
className='Separator BasicSeparator'
|
||||||
data-testid='basicSeparator'
|
>
|
||||||
className='Separator BasicSeparator'
|
<hr className='separator__hr'/>
|
||||||
>
|
{children && (
|
||||||
<hr className='separator__hr'/>
|
<div className='separator__text'>
|
||||||
{children && (
|
{children}
|
||||||
<div className='separator__text'>
|
</div>
|
||||||
{children}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
);
|
||||||
</div>
|
};
|
||||||
);
|
|
||||||
}
|
export default React.memo(BasicSeparator);
|
||||||
}
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user