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

[EuiAvatar] Add support for isDisabled property #4500

Closed
jportner opened this issue Feb 8, 2021 · 13 comments
Closed

[EuiAvatar] Add support for isDisabled property #4500

jportner opened this issue Feb 8, 2021 · 13 comments

Comments

@jportner
Copy link
Contributor

jportner commented Feb 8, 2021

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.

@snide
Copy link
Contributor

snide commented Feb 8, 2021

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).

@anuragxxd
Copy link
Contributor

anuragxxd commented Feb 18, 2021

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

@anuragxxd
Copy link
Contributor

anuragxxd commented Feb 18, 2021

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

@snide
Copy link
Contributor

snide commented Feb 18, 2021

Adding an example to the existing section should be enough.

@anuragxxd
Copy link
Contributor

Okay👍🏼

@jportner jportner changed the title [EuiAvatar] Add support for disabled property [EuiAvatar] Add support for isDisabled property Feb 18, 2021
@jportner
Copy link
Contributor Author

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

@anuragxxd
Copy link
Contributor

Screenshot 2021-02-19 at 12 25 44 AM

Does this looks good to you? @jportner

@jportner
Copy link
Contributor Author

That's perfect!

@anuragxxd
Copy link
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.

@cchaos
Copy link
Contributor

cchaos commented Feb 18, 2021

@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

@cchaos
Copy link
Contributor

cchaos commented Feb 18, 2021

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.

@anuragxxd
Copy link
Contributor

Okay Thanks for help.:)

@cchaos
Copy link
Contributor

cchaos commented Mar 4, 2021

Whoop, this was has been closed via #4549

@cchaos cchaos closed this as completed Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants