wip: connect to github step

This commit is contained in:
2026-04-22 22:12:39 +01:00
parent 02932411fb
commit 302d0d3222
7 changed files with 118 additions and 28 deletions

View File

@@ -0,0 +1,39 @@
use gpui::{FontWeight, ParentElement, Styled, div};
use crate::{
api,
component::text::text,
query::{self, use_lazy_query},
};
pub(crate) struct GithubStepView {
create_device_code_query: query::Entity<api::auth::CreateDeviceCode>,
}
pub(crate) fn new(cx: &mut gpui::Context<GithubStepView>) -> GithubStepView {
GithubStepView {
create_device_code_query: use_lazy_query(api::auth::CreateDeviceCode, cx),
}
}
impl gpui::Render for GithubStepView {
fn render(
&mut self,
_window: &mut gpui::Window,
cx: &mut gpui::Context<Self>,
) -> impl gpui::IntoElement {
div().flex().flex_col().size_full().child(header(cx))
}
}
fn header(cx: &gpui::Context<GithubStepView>) -> impl gpui::IntoElement {
div()
.flex()
.flex_col()
.items_center()
.child(text("Connect to GitHub", cx).font_weight(FontWeight(700.)))
.child(text(
"You will be redirected to GitHub to authorize access. Copy the device code below into GitHub.",
cx
).opacity(0.8))
}