Skip to content

Commit

Permalink
Allow to change FontIcon for Tab by passing it into the factory (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurp authored and javivelasco committed Jul 13, 2017
1 parent 27caadb commit d6bdf20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/tabs/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 };
2 changes: 1 addition & 1 deletion components/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit d6bdf20

Please sign in to comment.