Element refinement passing on ui2

This commit is contained in:
Nathan Sobo 2023-11-18 20:05:47 -07:00
parent be33f000e2
commit adc355a1e6
87 changed files with 2066 additions and 1372 deletions

View file

@ -1,19 +1,17 @@
use gpui::{Div, RenderOnce};
use crate::prelude::*;
use crate::{Avatar, Facepile, PlayerWithCallStatus};
#[derive(Component)]
#[derive(RenderOnce)]
pub struct PlayerStack {
player_with_call_status: PlayerWithCallStatus,
}
impl PlayerStack {
pub fn new(player_with_call_status: PlayerWithCallStatus) -> Self {
Self {
player_with_call_status,
}
}
impl<V: 'static> Component<V> for PlayerStack {
type Rendered = Div<V>;
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Element<V> {
fn render(self, view: &mut V, cx: &mut ViewContext<V>) -> Self::Rendered {
let player = self.player_with_call_status.get_player();
let followers = self
@ -59,3 +57,11 @@ impl PlayerStack {
)
}
}
impl PlayerStack {
pub fn new(player_with_call_status: PlayerWithCallStatus) -> Self {
Self {
player_with_call_status,
}
}
}