From d5e9716ceb88b6eead76f20c5891a8fa4863b040 Mon Sep 17 00:00:00 2001 From: mabashian Date: Mon, 4 Nov 2019 15:27:47 -0500 Subject: [PATCH] Move CardHeader styled component(s) outside of render functions. Refactors host options calls out to it's own function. --- awx/ui_next/src/screens/Host/Host.jsx | 14 +++++++------- .../src/screens/Host/HostList/HostList.jsx | 15 ++++++++++----- awx/ui_next/src/screens/Job/Job.jsx | 14 +++++++------- .../src/screens/Organization/Organization.jsx | 14 +++++++------- awx/ui_next/src/screens/Project/Project.jsx | 14 +++++++------- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/awx/ui_next/src/screens/Host/Host.jsx b/awx/ui_next/src/screens/Host/Host.jsx index 6817e332b3..20cd4aad0c 100644 --- a/awx/ui_next/src/screens/Host/Host.jsx +++ b/awx/ui_next/src/screens/Host/Host.jsx @@ -18,6 +18,13 @@ import HostGroups from './HostGroups'; import HostCompletedJobs from './HostCompletedJobs'; import { HostsAPI } from '@api'; +const CardHeader = styled(PFCardHeader)` + --pf-c-card--first-child--PaddingTop: 0; + --pf-c-card--child--PaddingLeft: 0; + --pf-c-card--child--PaddingRight: 0; + position: relative; +`; + class Host extends Component { constructor(props) { super(props); @@ -81,13 +88,6 @@ class Host extends Component { }, ]; - const CardHeader = styled(PFCardHeader)` - --pf-c-card--first-child--PaddingTop: 0; - --pf-c-card--child--PaddingLeft: 0; - --pf-c-card--child--PaddingRight: 0; - position: relative; - `; - let cardHeader = ( diff --git a/awx/ui_next/src/screens/Organization/Organization.jsx b/awx/ui_next/src/screens/Organization/Organization.jsx index 8bbbdbc828..3e7dfaa0af 100644 --- a/awx/ui_next/src/screens/Organization/Organization.jsx +++ b/awx/ui_next/src/screens/Organization/Organization.jsx @@ -18,6 +18,13 @@ import OrganizationEdit from './OrganizationEdit'; import OrganizationTeams from './OrganizationTeams'; import { OrganizationsAPI } from '@api'; +const CardHeader = styled(PFCardHeader)` + --pf-c-card--first-child--PaddingTop: 0; + --pf-c-card--child--PaddingLeft: 0; + --pf-c-card--child--PaddingRight: 0; + position: relative; +`; + class Organization extends Component { constructor(props) { super(props); @@ -133,13 +140,6 @@ class Organization extends Component { }); } - const CardHeader = styled(PFCardHeader)` - --pf-c-card--first-child--PaddingTop: 0; - --pf-c-card--child--PaddingLeft: 0; - --pf-c-card--child--PaddingRight: 0; - position: relative; - `; - let cardHeader = (