Skip to content

[EuiAvatar] Add support for isDisabled property #4500

Closed

Description

@jportner

In implementing elastic/kibana#89344, I have found myself needing to differentiate between different Kibana spaces. We are building components that plugin owners can reuse to implement sharing for saved objects (e.g., show a list of other spaces that an object exists in, show a flyout to allow the user to change the selected spaces). However, we may have a situation where the user is using a feature that is enabled in one space and disabled in another space. In that case I'd like to be able to render those spaces differently.

If EuiAvatar had an isDisabled property that would "gray out" the entire component, that would be perfect for our needs. I'm thinking something just like EuiBadge has:

disabled-badge

I imagine this should be straightforward to implement even if the avatar is an image, but I'm not sure.

Activity

  1. snide commented on Feb 8, 2021

    @snide
    Contributor

    Just spitting out ideas for whoever picks this up. Visually this will be tough. Only thing I can think up is we grayscale the badge (which could require a css filter for the images) with a cursor: not allowed. Avatars aren't by nature clickable like badges, and get most of that functionality through common props (href/onclick).

  2. anuragxxd commented on Feb 18, 2021

    @anuragxxd
    Contributor

    I am taking this up! @snide @cchaos if anyone else is not working. :/

  3. anuragxxd commented on Feb 18, 2021

    @anuragxxd
    Contributor

    Do I need to make another section in doc for this feature. @snide @jportner @cchaos

  4. snide commented on Feb 18, 2021

    @snide
    Contributor

    Adding an example to the existing section should be enough.

  5. anuragxxd commented on Feb 18, 2021

    @anuragxxd
    Contributor

    Okay👍🏼

  6. changed the title [-][EuiAvatar] Add support for disabled property[/-] [+][EuiAvatar] Add support for isDisabled property[/+] on Feb 18, 2021
  7. jportner commented on Feb 18, 2021

    @jportner
    ContributorAuthor

    I just realized that EuiBadge's property is isDisabled, I updated the title and description of this issue to stay consistent 🤭

  8. anuragxxd commented on Feb 18, 2021

    @anuragxxd
    Contributor

    Screenshot 2021-02-19 at 12 25 44 AM

    Does this looks good to you? @jportner

  9. jportner commented on Feb 18, 2021

    @jportner
    ContributorAuthor

    That's perfect!

  10. anuragxxd commented on Feb 18, 2021

    @anuragxxd
    Contributor

    Screenshot 2021-02-19 at 1 11 19 AM
    Screenshot 2021-02-19 at 1 11 39 AM

    @jportner Maybe you can help me with this I need to use !important here like that used in badges but commit is showing this error.

  11. cchaos commented on Feb 18, 2021

    @cchaos
    Contributor

    @git-anurag-hub We have sass-lint hooked up in our repo with certain rules, no-importants being one of them to try to limit to necessary casses. If you need to commit with the !important tag you'll have to do:

    property: value !important; // sass-lint:disable-line no-important
  12. cchaos commented on Feb 18, 2021

    @cchaos
    Contributor

    And since you're most likely getting this error during the pre-commit hooks, you'll want to install a sass-lint plugin to your editor that can alert you while you're editing.

  13. anuragxxd commented on Feb 18, 2021

    @anuragxxd
    Contributor

    Okay Thanks for help.:)

  14. cchaos commented on Mar 4, 2021

    @cchaos
    Contributor

    Whoop, this was has been closed via #4549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions