Add "Book Onboarding" action across the app (#20503)
This PR adds a small UI touch-up to the welcome page so we can introduce the "Book Onboarding" over there, as well as adding it to the user menu (both in the signed in and signed out states). The actual URL these buttons take to will still be updated to the correct destination. <img width="700" alt="Screenshot 2024-11-12 at 12 45 27" src="https://github.com/user-attachments/assets/9933bf94-f57a-43e2-8da3-bfbfd9fd24d0"> Release Notes: - N/A
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#![allow(missing_docs)]
|
||||
use crate::{
|
||||
h_flex, prelude::*, utils::WithRemSize, v_flex, Icon, IconName, KeyBinding, Label, List,
|
||||
ListItem, ListSeparator, ListSubHeader,
|
||||
h_flex, prelude::*, utils::WithRemSize, v_flex, Icon, IconName, IconSize, KeyBinding, Label,
|
||||
List, ListItem, ListSeparator, ListSubHeader,
|
||||
};
|
||||
use gpui::{
|
||||
px, Action, AnyElement, AppContext, DismissEvent, EventEmitter, FocusHandle, FocusableView,
|
||||
@@ -20,6 +20,7 @@ enum ContextMenuItem {
|
||||
toggle: Option<(IconPosition, bool)>,
|
||||
label: SharedString,
|
||||
icon: Option<IconName>,
|
||||
icon_size: IconSize,
|
||||
handler: Rc<dyn Fn(Option<&FocusHandle>, &mut WindowContext)>,
|
||||
action: Option<Box<dyn Action>>,
|
||||
disabled: bool,
|
||||
@@ -103,6 +104,7 @@ impl ContextMenu {
|
||||
label: label.into(),
|
||||
handler: Rc::new(move |_, cx| handler(cx)),
|
||||
icon: None,
|
||||
icon_size: IconSize::Small,
|
||||
action,
|
||||
disabled: false,
|
||||
});
|
||||
@@ -122,6 +124,7 @@ impl ContextMenu {
|
||||
label: label.into(),
|
||||
handler: Rc::new(move |_, cx| handler(cx)),
|
||||
icon: None,
|
||||
icon_size: IconSize::Small,
|
||||
action,
|
||||
disabled: false,
|
||||
});
|
||||
@@ -171,6 +174,7 @@ impl ContextMenu {
|
||||
cx.dispatch_action(action.boxed_clone());
|
||||
}),
|
||||
icon: None,
|
||||
icon_size: IconSize::Small,
|
||||
disabled: false,
|
||||
});
|
||||
self
|
||||
@@ -193,6 +197,7 @@ impl ContextMenu {
|
||||
cx.dispatch_action(action.boxed_clone());
|
||||
}),
|
||||
icon: None,
|
||||
icon_size: IconSize::Small,
|
||||
disabled: true,
|
||||
});
|
||||
self
|
||||
@@ -206,6 +211,7 @@ impl ContextMenu {
|
||||
action: Some(action.boxed_clone()),
|
||||
handler: Rc::new(move |_, cx| cx.dispatch_action(action.boxed_clone())),
|
||||
icon: Some(IconName::ArrowUpRight),
|
||||
icon_size: IconSize::XSmall,
|
||||
disabled: false,
|
||||
});
|
||||
self
|
||||
@@ -393,6 +399,7 @@ impl Render for ContextMenu {
|
||||
label,
|
||||
handler,
|
||||
icon,
|
||||
icon_size,
|
||||
action,
|
||||
disabled,
|
||||
} => {
|
||||
@@ -403,12 +410,12 @@ impl Render for ContextMenu {
|
||||
} else {
|
||||
Color::Default
|
||||
};
|
||||
let label_element = if let Some(icon) = icon {
|
||||
let label_element = if let Some(icon_name) = icon {
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(Label::new(label.clone()).color(color))
|
||||
.child(
|
||||
Icon::new(*icon).size(IconSize::Small).color(color),
|
||||
Icon::new(*icon_name).size(*icon_size).color(color),
|
||||
)
|
||||
.into_any_element()
|
||||
} else {
|
||||
|
||||
@@ -135,6 +135,7 @@ pub enum IconName {
|
||||
BellDot,
|
||||
BellOff,
|
||||
BellRing,
|
||||
Blocks,
|
||||
Bolt,
|
||||
Book,
|
||||
BookCopy,
|
||||
@@ -202,6 +203,7 @@ pub enum IconName {
|
||||
Indicator,
|
||||
IndicatorX,
|
||||
InlayHint,
|
||||
Keyboard,
|
||||
Library,
|
||||
LineHeight,
|
||||
Link,
|
||||
@@ -227,6 +229,7 @@ pub enum IconName {
|
||||
PocketKnife,
|
||||
Public,
|
||||
PullRequest,
|
||||
PhoneIncoming,
|
||||
Quote,
|
||||
RefreshTitle,
|
||||
Regex,
|
||||
@@ -269,6 +272,7 @@ pub enum IconName {
|
||||
SupermavenDisabled,
|
||||
SupermavenError,
|
||||
SupermavenInit,
|
||||
SwatchBook,
|
||||
Tab,
|
||||
Terminal,
|
||||
Trash,
|
||||
|
||||
Reference in New Issue
Block a user