mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
caught uncaught child error and added PageAction Button to Repo Overview
This commit is contained in:
@@ -36,8 +36,21 @@ class Page extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
renderPageActions() {
|
||||
const { children } = this.props;
|
||||
|
||||
let content = null;
|
||||
React.Children.forEach(children, child => {
|
||||
if (child && child.type.name === "PageActions") {
|
||||
content = child;
|
||||
}
|
||||
});
|
||||
return content;
|
||||
}
|
||||
|
||||
renderContent() {
|
||||
const { loading, children, showContentOnError, error } = this.props;
|
||||
|
||||
if (error && !showContentOnError) {
|
||||
return null;
|
||||
}
|
||||
@@ -47,24 +60,12 @@ class Page extends React.Component<Props> {
|
||||
|
||||
let content = [];
|
||||
React.Children.forEach(children, child => {
|
||||
if (child.type.name !== "PageActions") {
|
||||
if (child && child.type.name !== "PageActions") {
|
||||
content.push(child);
|
||||
}
|
||||
});
|
||||
return content;
|
||||
}
|
||||
|
||||
renderPageActions() {
|
||||
const { children } = this.props;
|
||||
|
||||
let content = null;
|
||||
React.Children.forEach(children, child => {
|
||||
if (child.type.name === "PageActions") {
|
||||
content = child;
|
||||
}
|
||||
});
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
export default Page;
|
||||
|
||||
Reference in New Issue
Block a user