ContentPage.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright 2019 Red Hat, Inc. and/or its affiliates.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import * as React from "../../../common/keycloak/web_modules/react.js";
  17. import { Button, Grid, GridItem, Title, Tooltip } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
  18. import { RedoIcon } from "../../../common/keycloak/web_modules/@patternfly/react-icons.js";
  19. import { Msg } from "../widgets/Msg.js";
  20. import { ContentAlert } from "./ContentAlert.js";
  21. /**
  22. * @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc.
  23. */
  24. export class ContentPage extends React.Component {
  25. constructor(props) {
  26. super(props);
  27. }
  28. render() {
  29. return React.createElement(React.Fragment, null, React.createElement(ContentAlert, null), React.createElement("section", {
  30. id: "page-heading",
  31. className: "pf-c-page__main-section pf-m-light"
  32. }, React.createElement(Grid, null, React.createElement(GridItem, {
  33. span: 11
  34. }, React.createElement(Title, {
  35. headingLevel: "h1",
  36. size: "3xl"
  37. }, React.createElement("strong", null, React.createElement(Msg, {
  38. msgKey: this.props.title
  39. })))), this.props.onRefresh && React.createElement(GridItem, {
  40. span: 1
  41. }, React.createElement(Tooltip, {
  42. content: React.createElement(Msg, {
  43. msgKey: "refreshPage"
  44. })
  45. }, React.createElement(Button, {
  46. "aria-describedby": "refresh page",
  47. id: "refresh-page",
  48. variant: "plain",
  49. onClick: this.props.onRefresh
  50. }, React.createElement(RedoIcon, {
  51. size: "sm"
  52. })))), this.props.introMessage && React.createElement(GridItem, {
  53. span: 12
  54. }, " ", React.createElement(Msg, {
  55. msgKey: this.props.introMessage
  56. })))), React.createElement("section", {
  57. className: "pf-c-page__main-section pf-m-no-padding-mobile"
  58. }, this.props.children));
  59. }
  60. }
  61. ;
  62. //# sourceMappingURL=ContentPage.js.map