Rework Avatar indicator to be more general-purpose (#4073)
This PR reworks the way we add indicators to `Avatar`s to make them more general-purpose. Previously we had logic specific to the availability indicator embedded in the `Avatar` component, which made it unwieldy to repurpose for something else. Now the `indicator` is just a slot that we can put anything into. Release Notes: - N/A
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::Avatar;
|
||||
use crate::{prelude::*, Availability, AvatarAvailabilityIndicator};
|
||||
|
||||
pub struct AvatarStory;
|
||||
|
||||
@@ -19,11 +19,11 @@ impl Render for AvatarStory {
|
||||
))
|
||||
.child(
|
||||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4")
|
||||
.availability_indicator(true),
|
||||
.indicator(AvatarAvailabilityIndicator::new(Availability::Free)),
|
||||
)
|
||||
.child(
|
||||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4")
|
||||
.availability_indicator(false),
|
||||
.indicator(AvatarAvailabilityIndicator::new(Availability::Busy)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user