wip: connect to github step
This commit is contained in:
39
src/screen/setup_wizard/github_step.rs
Normal file
39
src/screen/setup_wizard/github_step.rs
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user