Skip to content

Commit 2919330

Browse files
committed
fix(pf3): remove inline styles in tabs
1 parent 7b9b809 commit 2919330

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

packages/pf3-component-mapper/src/files/tabs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import PropTypes from 'prop-types';
44
import { TabContainer, Nav, NavItem, TabContent, TabPane, Icon } from 'patternfly-react';
55
import { useFormApi } from '@data-driven-forms/react-form-renderer';
66

7+
import './tabs.scss';
8+
79
const renderTabHeader = (items, formOptions) =>
810
items.map(({ title, name, validateFields = [] }, index) => {
911
const errors = formOptions.getState().errors;
1012
const hasError = validateFields.find((name) => !!get(errors, name));
1113
return (
1214
<NavItem key={name} eventKey={index}>
13-
{hasError && <Icon style={{ marginRight: 8, color: '#CC0000' }} type="fa" name="exclamation-circle" />}
15+
{hasError && <Icon classnName="ddorg__pf3-layout-components__tabs__error" type="fa" name="exclamation-circle" />}
1416
{title}
1517
</NavItem>
1618
);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.ddorg__pf3-layout-components__tabs__error {
2+
margin-right: 8px;
3+
color: #CC0000;
4+
}

packages/pf3-component-mapper/src/tests/__snapshots__/tabs.test.js.snap

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -356,33 +356,18 @@ exports[`<FormTabs /> should render form tabs with error state 1`] = `
356356
role="tab"
357357
>
358358
<Icon
359+
classnName="ddorg__pf3-layout-components__tabs__error"
359360
name="exclamation-circle"
360-
style={
361-
Object {
362-
"color": "#CC0000",
363-
"marginRight": 8,
364-
}
365-
}
366361
type="fa"
367362
>
368363
<FontAwesome
364+
classnName="ddorg__pf3-layout-components__tabs__error"
369365
name="exclamation-circle"
370-
style={
371-
Object {
372-
"color": "#CC0000",
373-
"marginRight": 8,
374-
}
375-
}
376366
>
377367
<span
378368
aria-hidden={true}
379369
className="fa fa-exclamation-circle"
380-
style={
381-
Object {
382-
"color": "#CC0000",
383-
"marginRight": 8,
384-
}
385-
}
370+
classnName="ddorg__pf3-layout-components__tabs__error"
386371
/>
387372
</FontAwesome>
388373
</Icon>

0 commit comments

Comments
 (0)