Add button link to extension repository (#7880)

Fixes: https://github.com/zed-industries/zed/issues/7873

<img width="1165" alt="image"
src="https://github.com/zed-industries/zed/assets/19867440/2338519c-bd48-4716-9f88-ed155b0dad67">

Release Notes:

- Added a button to link to an extension's repository
This commit is contained in:
Joseph T. Lyons 2024-02-16 11:49:05 -05:00 committed by GitHub
parent 2e0d18ee76
commit 577b244b03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -194,6 +194,8 @@ impl ExtensionsPage {
}
.color(Color::Accent);
let repository_url = extension.repository.clone();
div().w_full().child(
v_flex()
.w_full()
@ -256,7 +258,19 @@ impl ExtensionsPage {
Label::new(description.clone())
.size(LabelSize::Small)
.color(Color::Default)
})),
}))
.child(
IconButton::new(
SharedString::from(format!("repository-{}", extension.id)),
IconName::Github,
)
.icon_color(Color::Accent)
.icon_size(IconSize::Small)
.style(ButtonStyle::Filled)
.on_click(cx.listener(move |_, _, cx| {
cx.open_url(&repository_url);
})),
),
),
)
}