add component property to spinner#1840
Conversation
|
Before looking into the code changes here, I was expecting to see the change on the This pattern could then be followed on any components that need to show a loading state. Still thinking that through, but that is where my head is at. Is that making sense to others? |
|
That's definitely a good idea to add isLoading prop to EuiStat, but in this case we probably should also think about which loading component we are going to match, not sure if spinner is suitable for other cases. It's more like a product's question to me, but I think it would be useful if the loading icon could be a span 😛 |
|
Agree with @ryankeairns that because this component should always load some sort of metric it might make sense to do this with an actual prop so that we have a consistent way to convey the action across usages (rather than each app using their own implementation). We can discuss in our design review today and figure something out. @MichaelMarcialis tends to show up to those as well and can make sure it works for SIEM. |
|
I agree that I think both need to happen. a. Add a loading state to EuiStat for consistency across all usages |
|
Thank you so much for these brilliant solutions, closing this PR as the changed has been covered by #1845. |
Summary
I would like to put a
EuiLoadingSpinnerin the title ofEuiStat, but it complains about the p element from Stat shouldn't wrap div element from the spinner. Therefor I made a PR to make spinner accept component prop, so user can set it to div (default) or span. Please let me know if there's other solutions, any suggestions are welcome. Thanks a lot!Checklist