mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
defining class attribute instead of using component name
This commit is contained in:
@@ -51,7 +51,7 @@ class Page extends React.Component<Props> {
|
|||||||
let pageActionsExists = false;
|
let pageActionsExists = false;
|
||||||
React.Children.forEach(children, child => {
|
React.Children.forEach(children, child => {
|
||||||
if (child && !error) {
|
if (child && !error) {
|
||||||
if (child.type.name === PageActions.name) {
|
if (child.displayName === PageActions.displayName) {
|
||||||
pageActions = (
|
pageActions = (
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
@@ -97,7 +97,7 @@ class Page extends React.Component<Props> {
|
|||||||
let content = [];
|
let content = [];
|
||||||
React.Children.forEach(children, child => {
|
React.Children.forEach(children, child => {
|
||||||
if (child) {
|
if (child) {
|
||||||
if (child.type.name !== PageActions.name) {
|
if (child.displayName !== PageActions.displayName) {
|
||||||
content.push(child);
|
content.push(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ type Props = {
|
|||||||
children: React.Node
|
children: React.Node
|
||||||
};
|
};
|
||||||
|
|
||||||
class PageActions extends React.Component<Props> {
|
export default class PageActions extends React.Component<Props> {
|
||||||
|
displayName: string = "PageActions";
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <>{this.renderContent()}</>;
|
return <>{this.renderContent()}</>;
|
||||||
}
|
}
|
||||||
@@ -24,5 +26,3 @@ class PageActions extends React.Component<Props> {
|
|||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PageActions;
|
|
||||||
|
|||||||
Reference in New Issue
Block a user