WIP
co-authored-by: conrad <conrad@zed.dev> co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
6985b70859
commit
2c4d83c9af
96 changed files with 1926 additions and 1955 deletions
|
@ -7,10 +7,10 @@ pub struct Avatar {
|
|||
shape: Shape,
|
||||
}
|
||||
|
||||
impl<V: 'static> Component<V> for Avatar {
|
||||
type Rendered = Img<V>;
|
||||
impl Component for Avatar {
|
||||
type Rendered = Img;
|
||||
|
||||
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> Self::Rendered {
|
||||
fn render(self, _: &mut WindowContext) -> Self::Rendered {
|
||||
let mut img = img();
|
||||
|
||||
if self.shape == Shape::Circle {
|
||||
|
@ -51,12 +51,12 @@ mod stories {
|
|||
|
||||
pub struct AvatarStory;
|
||||
|
||||
impl Render<Self> for AvatarStory {
|
||||
type Element = Div<Self>;
|
||||
impl Render for AvatarStory {
|
||||
type Element = Div;
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
||||
fn render(&mut self, cx: &mut WindowContext) -> Self::Element {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, Avatar>(cx))
|
||||
.child(Story::title_for::<Avatar>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
.child(Avatar::new(
|
||||
"https://avatars.githubusercontent.com/u/1714999?v=4",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue