Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuItem Fix hoverColor muiTheme override #4957

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/List/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getStyles(props, context, state) {
const {listItem} = muiTheme;

const textColor = muiTheme.baseTheme.palette.textColor;
const hoverColor = fade(textColor, 0.1);
const hoverColor = props.hoverColor || fade(context.muiTheme.baseTheme.palette.textColor, 0.1);
Copy link
Member

@oliviertassinari oliviertassinari Aug 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keeping the textColor?

const singleAvatar = !secondaryText && (leftAvatar || rightAvatar);
const singleNoAvatar = !secondaryText && !(leftAvatar || rightAvatar);
const twoLine = secondaryText && secondaryTextLines === 1;
Expand Down Expand Up @@ -164,6 +164,10 @@ class ListItem extends Component {
* or `rightToggle` is set.
*/
disabled: PropTypes.bool,
/**
* Override hoverColor.
*/
hoverColor: PropTypes.string,
/**
* If true, the nested `ListItem`s are initially displayed.
*/
Expand Down Expand Up @@ -498,6 +502,7 @@ class ListItem extends Component {
children,
disabled,
disableKeyboardFocus,
hoverColor, // eslint-disable-line no-unused-vars
initiallyOpen, // eslint-disable-line no-unused-vars
innerDivStyle,
insetChildren, // eslint-disable-line no-unused-vars
Expand Down
1 change: 1 addition & 0 deletions src/MenuItem/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class MenuItem extends Component {
ref="listItem"
rightIcon={rightIconElement}
style={mergedRootStyles}
hoverColor={this.context.muiTheme.menuItem.hoverColor}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other properties are alphabetically sorted. Might be a coincidence for all I know.

>
{children}
{secondaryTextElement}
Expand Down