Skip to content

Commit d6bdf20

Browse files
ankurpjavivelasco
authored andcommitted
Allow to change FontIcon for Tab by passing it into the factory (react-toolbox#1439)
1 parent 27caadb commit d6bdf20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/tabs/Tab.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
33
import classnames from 'classnames';
44
import { themr } from 'react-css-themr';
5-
import { FontIcon } from '../font_icon';
65
import { TABS } from '../identifiers';
76
import rippleFactory from '../ripple/Ripple';
7+
import InjectFontIcon from '../font_icon/FontIcon';
88

9-
const factory = (ripple) => {
9+
const factory = (ripple, FontIcon) => {
1010
class Tab extends Component {
1111
static propTypes = {
1212
active: PropTypes.bool,
@@ -77,7 +77,7 @@ const factory = (ripple) => {
7777
return ripple(Tab);
7878
};
7979

80-
const Tab = factory(rippleFactory({ centered: false }));
80+
const Tab = factory(rippleFactory({ centered: false }), InjectFontIcon);
8181
export default themr(TABS)(Tab);
8282
export { factory as tabFactory };
8383
export { Tab };

components/tabs/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import theme from './theme.css';
99

1010
const applyTheme = Component => themr(TABS, theme)(Component);
1111
const ThemedTabContent = applyTheme(TabContent);
12-
const ThemedTab = applyTheme(tabFactory(themedRippleFactory({ centered: false })));
12+
const ThemedTab = applyTheme(tabFactory(themedRippleFactory({ centered: false }), FontIcon));
1313
const ThemedTabs = applyTheme(tabsFactory(ThemedTab, ThemedTabContent, FontIcon));
1414

1515
export { ThemedTab as Tab };

0 commit comments

Comments
 (0)