Rework ListItem
and ListHeader
to use slot-based APIs (#3635)
This PR reworks the `ListItem` and `ListHeader` components to use slot-based APIs, making them less opinionated about their contents. Splitting this out of the collab UI styling PR so we can land it to avoid conflicts. Co-authored-by: Nate <nate@zed.dev> Release Notes: - N/A
This commit is contained in:
parent
5c8257585a
commit
ee509e043d
10 changed files with 267 additions and 109 deletions
|
@ -255,6 +255,9 @@ impl Render for ContextMenu {
|
|||
};
|
||||
|
||||
ListItem::new(label.clone())
|
||||
.inset(true)
|
||||
.selected(Some(ix) == self.selected_index)
|
||||
.on_click(move |_, cx| handler(cx))
|
||||
.child(
|
||||
h_stack()
|
||||
.w_full()
|
||||
|
@ -265,8 +268,6 @@ impl Render for ContextMenu {
|
|||
.map(|binding| div().ml_1().child(binding))
|
||||
})),
|
||||
)
|
||||
.selected(Some(ix) == self.selected_index)
|
||||
.on_click(move |_, cx| handler(cx))
|
||||
.into_any_element()
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue