Night theme (#2137)

* feat: add themes

* fix: remove obvious issues with light theme

* chore: improve light theme a bit

* comment out theme swticher

* chore: make login dark

* add theme and widgets to seeds

* add theme and widgets to migration

---------

Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
This commit is contained in:
Alex Inkin
2023-03-04 02:31:19 +08:00
committed by Aiden McClelland
parent e867f31c31
commit 3c0a82293c
53 changed files with 598 additions and 237 deletions

View File

@@ -1,6 +1,6 @@
use async_trait::async_trait;
use emver::VersionRange;
use serde_json::json;
use serde_json::{json, Value};
use super::v0_3_0::V0_3_0_COMPAT;
use super::*;
@@ -61,6 +61,8 @@ impl VersionT for Version {
.put(db, &parsed_url)
.await?;
}
ui["theme"] = json!("Dark".to_string());
ui["widgets"] = json!([]);
Ok(())
}
async fn down<Db: DbHandle>(&self, db: &mut Db) -> Result<(), Error> {
@@ -87,6 +89,11 @@ impl VersionT for Version {
.await?;
}
if let Value::Object(ref mut obj) = *ui {
obj.remove("theme");
obj.remove("widgets");
}
ui["marketplace"]["known-hosts"][COMMUNITY_URL].take();
ui.save(db).await?;
Ok(())