material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Avatar] Should have a consistent root node element

Open nathanmarks opened this issue 10 years ago • 5 comments

Problem description

Avatar current renders a div at the root if it contains an icon/other content, or an img if it is passed an src.

For consistency, the img variation should also render a div for the root node. This also gives users the ability to implement consistent brand style tweaks such as borders, shadows, etc.

@see https://github.com/callemall/material-ui/pull/4409#issuecomment-223280610

Versions

  • Material-UI: HEAD
  • React: 15.1.0
  • Browser: All

nathanmarks avatar Jun 02 '16 12:06 nathanmarks

Is anyone working on this? I'd like to pick it up

danep93 avatar Mar 04 '17 02:03 danep93

I'm working on this but found an interesting line in the tests https://github.com/callemall/material-ui/blob/master/src/Avatar/Avatar.spec.js#L38

Is this ok? assert.notOk with ! in the param, so basically it's an assert.ok which is a falsy test!

I'm I missing something? cc @oliviertassinari @nathanmarks @mbrookes

elazzabi avatar Mar 04 '17 20:03 elazzabi

@elazzabi contains returns a boolean, I would rather use assert.strictEqual. I don't think you miss anything. I believe it was done by mistake, double negation ☯️ .

oliviertassinari avatar Mar 04 '17 22:03 oliviertassinari

@oliviertassinari yeah I was talking about the double negation. I'll correct it :v:

elazzabi avatar Mar 04 '17 22:03 elazzabi

I'm not sure when that was fixed, but it's 😄 . We always use a div as root node.

oliviertassinari avatar Jun 07 '17 20:06 oliviertassinari