add workspace
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use gpui::prelude::*;
|
||||
use gpui::{
|
||||
AnyElement, App, Context, Entity, Render, SharedString, Subscription, Window, div, px,
|
||||
uniform_list,
|
||||
AnyElement, App, Context, Entity, EventEmitter, FocusHandle, Focusable, Render, SharedString,
|
||||
Subscription, Window, div, px, uniform_list,
|
||||
};
|
||||
use gpui_component::dock::{Panel, PanelEvent};
|
||||
use gpui_component::{ActiveTheme, StyledExt};
|
||||
use signed_core::Announcement;
|
||||
use signed_state::{ProfileStore, RepoListStore};
|
||||
@@ -10,6 +11,7 @@ use signed_state::{ProfileStore, RepoListStore};
|
||||
/// Browse all announced repositories (works anonymously).
|
||||
pub struct RepoListView {
|
||||
store: Entity<RepoListStore>,
|
||||
focus_handle: FocusHandle,
|
||||
_subscription: Subscription,
|
||||
}
|
||||
|
||||
@@ -20,11 +22,30 @@ impl RepoListView {
|
||||
|
||||
Self {
|
||||
store,
|
||||
focus_handle: cx.focus_handle(),
|
||||
_subscription: subscription,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Panel for RepoListView {
|
||||
fn panel_name(&self) -> &'static str {
|
||||
"repo_list"
|
||||
}
|
||||
|
||||
fn title(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
"Explore"
|
||||
}
|
||||
}
|
||||
|
||||
impl EventEmitter<PanelEvent> for RepoListView {}
|
||||
|
||||
impl Focusable for RepoListView {
|
||||
fn focus_handle(&self, _cx: &App) -> FocusHandle {
|
||||
self.focus_handle.clone()
|
||||
}
|
||||
}
|
||||
|
||||
fn render_card(announcement: &Announcement, cx: &mut App) -> AnyElement {
|
||||
let name = announcement
|
||||
.name
|
||||
|
||||
Reference in New Issue
Block a user