ux: Relay Detail Redesign

This patch redesigns the relay detail view. The first step needed to
further improve how relays are viewed. In addition, Fees are added to
the relay metadata to present to the user the admission, subscription,
or publication fees a relay may have.

There are various changes made, but mainly several relay details are
moved outside of the main RelayDetail view for easier tracking and
updates.

With this design we will be able to add ratings and relay previews, as
this patch is large enough I will submit that improvement in the future.

iPhone 15 Pro Max (17.3.1) Dark Mode:
https://i.nostr.build/VwVvq.png
https://i.nostr.build/KGO0v.png

iPhone SE (3rd generation) (16.4) Light Mode:
https://i.nostr.build/M5V26.png
https://i.nostr.build/gZKw3.png

Changelog-Added: Relay fees metadata
Changelog-Changed: Relay detail design
Signed-off-by: ericholguin <ericholguin@apache.org>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
ericholguin
2024-04-03 20:03:46 -06:00
committed by William Casarin
parent faec79d45d
commit 5492d9f499
10 changed files with 492 additions and 119 deletions

View File

@@ -84,6 +84,33 @@ struct Limitations: Codable {
}
}
struct Admission: Codable {
let amount: Int64
let unit: String
}
struct Subscription: Codable {
let amount: Int64
let unit: String
let period: Int
}
struct Publication: Codable {
let kinds: [Int]
let amount: Int64
let unit: String
}
struct Fees: Codable {
let admission: [Admission]?
let subscription: [Subscription]?
let publication: [Publication]?
static var empty: Fees {
Fees(admission: nil, subscription: nil, publication: nil)
}
}
struct RelayMetadata: Codable {
let name: String?
let description: String?
@@ -95,6 +122,7 @@ struct RelayMetadata: Codable {
let limitation: Limitations?
let payments_url: String?
let icon: String?
let fees: Fees?
var is_paid: Bool {
return limitation?.payment_required ?? false