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

@@ -32,7 +32,7 @@ class OverviewPageActions extends React.Component<Props> {
const { history, location, link } = this.props;
let directory = link.substring(0, link.indexOf("/"));
return (
<PageActions>
<>
<FilterInput
value={urls.getQueryStringFromLocation(location)}
filter={filter => {
@@ -40,7 +40,7 @@ class OverviewPageActions extends React.Component<Props> {
}}
/>
{this.renderCreateButton()}
</PageActions>
</>
);
}

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);
}
}