Lightning-Invoice: lnbc1pjcpaakpp5gjs4f626hf8w6slx84xz3wwhlf309z503rjutckdxv6wwg5ldavsdqqcqzpgxqrrs0fppqjaxxw43p7em4g59vedv7pzl76kt0qyjfsp5qcp9de7a7t8h6zs5mcssfaqp4exrnkehqtg2hf0ary3z5cjnasvs9qyyssq55523e4h3cazhkv7f8jqf5qp0n8spykls49crsu5t3m636u3yj4qdqjkdl2nxf6jet5t2r2pfrxmm8rjpqjd3ylrzqq89m4gqt5l6ycqf92c7h Closes: https://github.com/damus-io/damus/issues/940 Signed-off-by: Charlie Fish <contact@charlie.fish> Signed-off-by: William Casarin <jb55@jb55.com> Changelog-Added: Add NIP-42 relay auth support
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
//
|
|
// RelayAuthenticationDetail.swift
|
|
// damus
|
|
//
|
|
// Created by Charlie Fish on 12/18/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct RelayAuthenticationDetail: View {
|
|
let state: RelayAuthenticationState
|
|
|
|
var body: some View {
|
|
switch state {
|
|
case .none:
|
|
EmptyView()
|
|
case .pending:
|
|
Text(NSLocalizedString("Pending", comment: "Label to display that authentication to a server is pending."))
|
|
case .verified:
|
|
Text(NSLocalizedString("Authenticated", comment: "Label to display that authentication to a server has succeeded."))
|
|
.foregroundStyle(DamusColors.success)
|
|
case .error:
|
|
Text(NSLocalizedString("Error", comment: "Label to display that authentication to a server has failed."))
|
|
.foregroundStyle(DamusColors.danger)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct RelayAuthenticationDetail_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
RelayAuthenticationDetail(state: .none)
|
|
RelayAuthenticationDetail(state: .pending)
|
|
RelayAuthenticationDetail(state: .verified)
|
|
}
|
|
}
|