WIP: Work toward eliminating Component trait

This refactor enhances the overall design by promoting reusable and composable UI component structures within the Zed project codebase.
This commit is contained in:
Nathan Sobo
2023-11-18 00:03:23 -07:00
parent 2515bbf990
commit 23ffce9fbe
46 changed files with 192 additions and 90 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
use gpui::{div, Component, ParentComponent};
use gpui::{div, Component, Element, ParentComponent};
use crate::{Icon, IconElement, IconSize, TextColor};
@@ -44,7 +44,7 @@ impl From<bool> for Toggle {
}
}
pub fn disclosure_control<V: 'static>(toggle: Toggle) -> impl Component<V> {
pub fn disclosure_control<V: 'static>(toggle: Toggle) -> impl Element<V> {
match (toggle.is_toggleable(), toggle.is_toggled()) {
(false, _) => div(),
(_, true) => div().child(