Allow to change FontIcon for Tab by passing it into the factory (#1439)

old
Ankur Patel 2017-07-13 14:03:34 -04:00 committed by Javi Velasco
parent 27caadb182
commit d6bdf2008e
2 changed files with 4 additions and 4 deletions

View File

@ -2,11 +2,11 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { themr } from 'react-css-themr';
import { FontIcon } from '../font_icon';
import { TABS } from '../identifiers';
import rippleFactory from '../ripple/Ripple';
import InjectFontIcon from '../font_icon/FontIcon';
const factory = (ripple) => {
const factory = (ripple, FontIcon) => {
class Tab extends Component {
static propTypes = {
active: PropTypes.bool,
@ -77,7 +77,7 @@ const factory = (ripple) => {
return ripple(Tab);
};
const Tab = factory(rippleFactory({ centered: false }));
const Tab = factory(rippleFactory({ centered: false }), InjectFontIcon);
export default themr(TABS)(Tab);
export { factory as tabFactory };
export { Tab };

View File

@ -9,7 +9,7 @@ import theme from './theme.css';
const applyTheme = Component => themr(TABS, theme)(Component);
const ThemedTabContent = applyTheme(TabContent);
const ThemedTab = applyTheme(tabFactory(themedRippleFactory({ centered: false })));
const ThemedTab = applyTheme(tabFactory(themedRippleFactory({ centered: false }), FontIcon));
const ThemedTabs = applyTheme(tabsFactory(ThemedTab, ThemedTabContent, FontIcon));
export { ThemedTab as Tab };