add basic repo browser
This commit is contained in:
+5
-27
@@ -1,30 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use gpui::*;
|
||||
use gpui_component::button::*;
|
||||
use gpui_component::*;
|
||||
use gpui_platform::application;
|
||||
|
||||
pub struct HelloWorld;
|
||||
|
||||
impl Render for HelloWorld {
|
||||
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
|
||||
div()
|
||||
.v_flex()
|
||||
.gap_2()
|
||||
.size_full()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.child("Hello, World!")
|
||||
.child(
|
||||
Button::new("ok")
|
||||
.primary()
|
||||
.label("Let's Go!")
|
||||
.on_click(|_ev, _window, _cx| println!("Clicked!")),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// Initialize logging
|
||||
tracing_subscriber::fmt::init();
|
||||
@@ -34,6 +12,10 @@ fn main() {
|
||||
.run(move |cx| {
|
||||
gpui_component::init(cx);
|
||||
|
||||
// Initialize backend and stores (connects relays, restores session)
|
||||
std::fs::create_dir_all(paths::nostr_dir()).ok();
|
||||
signed_state::init(paths::nostr_dir(), cx);
|
||||
|
||||
// Set up the window bounds
|
||||
let bounds = Bounds::centered(None, size(px(960.0), px(720.0)), cx);
|
||||
|
||||
@@ -53,11 +35,7 @@ fn main() {
|
||||
};
|
||||
|
||||
cx.spawn(async move |cx| {
|
||||
cx.open_window(opts, |window, cx| {
|
||||
let view = cx.new(|_| HelloWorld);
|
||||
cx.new(|cx| Root::new(view, window, cx))
|
||||
})
|
||||
.ok();
|
||||
let _ = cx.open_window(opts, workspace::root);
|
||||
})
|
||||
.detach();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user