mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-13 05:42:59 +00:00
storybook: Wire up HTTP client (#18818)
This PR wires up the HTTP client in the Storybook. Release Notes: - N/A
This commit is contained in:
parent
d1a758708d
commit
c83690ff14
3 changed files with 12 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -10998,6 +10998,7 @@ dependencies = [
|
|||
"theme",
|
||||
"title_bar",
|
||||
"ui",
|
||||
"ureq_client",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -35,6 +35,7 @@ strum = { workspace = true, features = ["derive"] }
|
|||
theme.workspace = true
|
||||
title_bar = { workspace = true, features = ["stories"] }
|
||||
ui = { workspace = true, features = ["stories"] }
|
||||
ureq_client.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
gpui = { workspace = true, features = ["test-support"] }
|
||||
|
|
|
@ -4,6 +4,8 @@ mod assets;
|
|||
mod stories;
|
||||
mod story_selector;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use clap::Parser;
|
||||
use dialoguer::FuzzySelect;
|
||||
use gpui::{
|
||||
|
@ -17,6 +19,7 @@ use simplelog::SimpleLogger;
|
|||
use strum::IntoEnumIterator;
|
||||
use theme::{ThemeRegistry, ThemeSettings};
|
||||
use ui::prelude::*;
|
||||
use ureq_client::UreqClient;
|
||||
|
||||
use crate::app_menus::app_menus;
|
||||
use crate::assets::Assets;
|
||||
|
@ -65,6 +68,13 @@ fn main() {
|
|||
gpui::App::new().with_assets(Assets).run(move |cx| {
|
||||
load_embedded_fonts(cx).unwrap();
|
||||
|
||||
let http_client = UreqClient::new(
|
||||
None,
|
||||
"zed_storybook".to_string(),
|
||||
cx.background_executor().clone(),
|
||||
);
|
||||
cx.set_http_client(Arc::new(http_client));
|
||||
|
||||
settings::init(cx);
|
||||
theme::init(theme::LoadThemes::All(Box::new(Assets)), cx);
|
||||
|
||||
|
|
Loading…
Reference in a new issue