-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Avatar] Remove style-propable mixin #3235
Conversation
} = state.muiTheme; | ||
|
||
const styles = { | ||
root: Object.assign({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a ternary vampire, sucking the life out of readability 😆 😆
root: {
color,
backgroundColor,
userSelect: 'none',
display: 'inline-block',
textAlign: 'center',
lineHeight: `${size}px`,
fontSize: size / 2 + 4,
borderRadius: '50%',
border: src ? `solid 1px ${avatar.borderColor}` : undefined,
height: src ? size - 2 : size,
width: src ? size - 2 : size,
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, thank you for your patience with me, good sir. 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries, programming is a playful job. It always tickles you to write clever code. We've all been there 😆 😆
|
All good 👍 👍 |
|
||
if (borderColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this logic back 😁?
I'm using the muiTheme like this:
avatar: {
borderColor: null,
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch, I don't know how I missed that borderColor
was part of the condition for applying those styles. Thanks!
|
@newoga Thanks! It's time to sleep 😴. |
[Avatar] Remove style-propable mixin
Haha, thanks! |
No description provided.