pulled out PageActions from OverviewPageActions because otherwise you can not check for name of OverviewPageActions because the component exported injectSheet -> jss

simplified CreateUser/GroupButton by not being used as external component
This commit is contained in:
Florian Scholdei
2019-04-24 09:46:22 +02:00
parent d56dc22efc
commit 7450c9bea2
7 changed files with 43 additions and 72 deletions

View File

@@ -7,7 +7,6 @@ import ErrorNotification from "./../ErrorNotification";
import Title from "./Title";
import Subtitle from "./Subtitle";
import PageActions from "./PageActions";
import OverviewPageActions from "../OverviewPageActions";
import ErrorBoundary from "../ErrorBoundary";
type Props = {
@@ -52,10 +51,7 @@ class Page extends React.Component<Props> {
let pageActionsExists = false;
React.Children.forEach(children, child => {
if (child && !error) {
if (
child.type.name === PageActions.name ||
child.type.name === OverviewPageActions.name
)
if (child.type.name === PageActions.name)
pageActions = (
<div
className={classNames(
@@ -100,10 +96,7 @@ class Page extends React.Component<Props> {
let content = [];
React.Children.forEach(children, child => {
if (child) {
if (
child.type.name !== PageActions.name &&
child.type.name !== OverviewPageActions.name
) {
if (child.type.name !== PageActions.name) {
content.push(child);
}
}