1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Update organization card header and tabs to use styled-components

This commit is contained in:
Marliana Lara 2019-06-12 16:34:31 -04:00
parent a98be1443b
commit 4fe558392a
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
3 changed files with 48 additions and 27 deletions

View File

@ -203,15 +203,6 @@
text-align: right; text-align: right;
} }
.awx-orgTabs-container{
display: flex
}
.awx-orgTabs__bottom-border{
flex-grow: 1;
border-bottom: 1px solid #d2d2d2
}
// //
// AlertModal styles // AlertModal styles
// //

View File

@ -1,7 +1,35 @@
import React from 'react'; import React from 'react';
import { shape, string, number, arrayOf } from 'prop-types'; import { shape, string, number, arrayOf } from 'prop-types';
import { Tab, Tabs } from '@patternfly/react-core'; import { Tab, Tabs as PFTabs } from '@patternfly/react-core';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import styled from 'styled-components';
const Tabs = styled(PFTabs)`
--pf-c-tabs__button--PaddingLeft: 20px;
--pf-c-tabs__button--PaddingRight: 20px;
.pf-c-tabs__list {
li:first-of-type .pf-c-tabs__button {
&::before {
border-left: none;
}
&::after {
margin-left: 0;
}
}
}
&::before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: "";
border: solid var(--pf-c-tabs__item--BorderColor);
border-width: var(--pf-c-tabs__item--BorderWidth) 0 var(--pf-c-tabs__item--BorderWidth) 0;
}
`;
function RoutedTabs (props) { function RoutedTabs (props) {
const { history, tabsArray } = props; const { history, tabsArray } = props;

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { withI18n } from '@lingui/react'; import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { Switch, Route, withRouter, Redirect } from 'react-router-dom'; import { Switch, Route, withRouter, Redirect } from 'react-router-dom';
import { Card, CardHeader, PageSection } from '@patternfly/react-core'; import { Card, CardHeader as PFCardHeader, PageSection } from '@patternfly/react-core';
import CardCloseButton from '../../../../components/CardCloseButton'; import CardCloseButton from '../../../../components/CardCloseButton';
import ContentError from '../../../../components/ContentError'; import ContentError from '../../../../components/ContentError';
import OrganizationAccess from './OrganizationAccess'; import OrganizationAccess from './OrganizationAccess';
@ -12,6 +12,7 @@ import OrganizationNotifications from './OrganizationNotifications';
import OrganizationTeams from './OrganizationTeams'; import OrganizationTeams from './OrganizationTeams';
import RoutedTabs from '../../../../components/Tabs/RoutedTabs'; import RoutedTabs from '../../../../components/Tabs/RoutedTabs';
import { OrganizationsAPI } from '../../../../api'; import { OrganizationsAPI } from '../../../../api';
import styled from 'styled-components';
class Organization extends Component { class Organization extends Component {
constructor (props) { constructor (props) {
@ -130,23 +131,24 @@ 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 = ( let cardHeader = (
<CardHeader style={{ padding: 0 }}> loading ? '' : (
<React.Fragment> <CardHeader>
<div className="awx-orgTabs-container">
<RoutedTabs <RoutedTabs
match={match} match={match}
history={history} history={history}
labeltext={i18n._(t`Organization detail tabs`)}
tabsArray={tabsArray} tabsArray={tabsArray}
/> />
<CardCloseButton linkTo="/organizations" /> <CardCloseButton linkTo="/organizations" />
<div
className="awx-orgTabs__bottom-border"
/>
</div>
</React.Fragment>
</CardHeader> </CardHeader>
)
); );
if (!isInitialized) { if (!isInitialized) {