Redesign for the v1 stable release (#3)
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m26s

Only half done. Will continue in another PR.

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2026-02-04 01:43:21 +00:00
parent 014757cfc9
commit 32201554ec
174 changed files with 6165 additions and 8112 deletions

View File

@@ -26,6 +26,3 @@ pub const NOSTR_CONNECT_TIMEOUT: u64 = 200;
/// Default timeout (in seconds) for Nostr Connect (Bunker)
pub const BUNKER_TIMEOUT: u64 = 30;
/// Default width of the sidebar.
pub const DEFAULT_SIDEBAR_WIDTH: f32 = 240.;

View File

@@ -12,6 +12,7 @@ const SECONDS_IN_MINUTE: i64 = 60;
const MINUTES_IN_HOUR: i64 = 60;
const HOURS_IN_DAY: i64 = 24;
const DAYS_IN_MONTH: i64 = 30;
const IMAGE_RESIZER: &str = "https://wsrv.nl";
pub trait RenderedProfile {
fn avatar(&self) -> SharedString;
@@ -24,7 +25,12 @@ impl RenderedProfile for Profile {
.picture
.as_ref()
.filter(|picture| !picture.is_empty())
.map(|picture| picture.into())
.map(|picture| {
let url = format!(
"{IMAGE_RESIZER}/?url={picture}&w=100&h=100&fit=cover&mask=circle&n=-1"
);
url.into()
})
.unwrap_or_else(|| "brand/avatar.png".into())
}

View File

@@ -4,7 +4,6 @@ pub use constants::*;
pub use debounced_delay::*;
pub use display::*;
pub use event::*;
pub use nip05::*;
pub use nip96::*;
use nostr_sdk::prelude::*;
pub use paths::*;
@@ -13,7 +12,6 @@ mod constants;
mod debounced_delay;
mod display;
mod event;
mod nip05;
mod nip96;
mod paths;

View File

@@ -1,31 +0,0 @@
use anyhow::anyhow;
use nostr::prelude::*;
use reqwest::Client as ReqClient;
pub async fn nip05_verify(public_key: PublicKey, address: &str) -> Result<bool, anyhow::Error> {
let req_client = ReqClient::new();
let address = Nip05Address::parse(address)?;
// Get NIP-05 response
let res = req_client.get(address.url().to_string()).send().await?;
let json: Value = res.json().await?;
let verify = nip05::verify_from_json(&public_key, &address, &json);
Ok(verify)
}
pub async fn nip05_profile(address: &str) -> Result<Nip05Profile, anyhow::Error> {
let req_client = ReqClient::new();
let address = Nip05Address::parse(address)?;
// Get NIP-05 response
let res = req_client.get(address.url().to_string()).send().await?;
let json: Value = res.json().await?;
if let Ok(profile) = Nip05Profile::from_json(&address, &json) {
Ok(profile)
} else {
Err(anyhow!("Failed to get NIP-05 profile"))
}
}