Compare commits

...

9 Commits

Author SHA1 Message Date
c1e5787120 Add validation to prevent whitespaces be inputted on NIP-05 input field 2023-03-27 10:34:39 -04:00
William Casarin
0b40cd127c Revert "Revert "Don't make previews full bleed""
This reverts commit 57006b928b.
2023-03-26 09:36:02 -06:00
William Casarin
754ee254e9 Revert "Revert "New Timeline""
This reverts commit f5ed9cd5d4.
2023-03-26 09:35:53 -06:00
William Casarin
963cb37762 Revert "Increase image size"
This reverts commit b6d5b6f45e.
2023-03-26 09:35:07 -06:00
William Casarin
159d0fa2b5 Don't render @note link if there is only one 2023-03-25 07:54:04 -06:00
William Casarin
61fddf800e Reduced padding for more information density
Changelog-Changed: Reduced padding for more information density
2023-03-25 06:51:56 -06:00
William Casarin
b6d5b6f45e Increase image size 2023-03-25 06:38:06 -06:00
William Casarin
f5ed9cd5d4 Revert "New Timeline"
This reverts commit f84d4516db.
2023-03-25 06:31:24 -06:00
William Casarin
57006b928b Revert "Don't make previews full bleed"
This reverts commit 98f0b2f2d2.
2023-03-25 06:31:18 -06:00
4 changed files with 23 additions and 2 deletions

View File

@@ -94,6 +94,14 @@ enum Block {
return nil
}
var is_note_mention: Bool {
guard case .mention(let mention) = self else {
return false
}
return mention.type == .event
}
var is_mention: Bool {
if case .mention = self {
return true

View File

@@ -6,6 +6,7 @@
//
import SwiftUI
import Combine
let PPM_SIZE: CGFloat = 80.0
let BANNER_HEIGHT: CGFloat = 150.0;
@@ -196,6 +197,9 @@ struct EditMetadataView: View {
TextField(NSLocalizedString("jb55@jb55.com", comment: "Placeholder example text for identifier used for NIP-05 verification."), text: $nip05)
.autocorrectionDisabled(true)
.textInputAutocapitalization(.never)
.onReceive(Just(nip05)) { newValue in
self.nip05 = newValue.trimmingCharacters(in: .whitespaces)
}
}, header: {
Text("NIP-05 Verification", comment: "Label for NIP-05 Verification section of user profile form.")
}, footer: {

View File

@@ -240,6 +240,7 @@ struct NoteArtifacts {
func render_note_content(ev: NostrEvent, profiles: Profiles, privkey: String?) -> NoteArtifacts {
let blocks = ev.blocks(privkey)
return render_blocks(blocks: blocks, profiles: profiles, privkey: privkey)
}
@@ -247,9 +248,17 @@ func render_blocks(blocks: [Block], profiles: Profiles, privkey: String?) -> Not
var invoices: [Invoice] = []
var img_urls: [URL] = []
var link_urls: [URL] = []
let one_note_ref = blocks
.filter({ $0.is_note_mention })
.count == 1
let txt: AttributedString = blocks.reduce("") { str, block in
switch block {
case .mention(let m):
if m.type == .event && one_note_ref {
return str
}
return str + mention_str(m, profiles: profiles)
case .text(let txt):
return str + AttributedString(stringLiteral: txt)

View File

@@ -42,10 +42,10 @@ struct InnerTimelineView: View {
nav_target = ev.inner_event ?? ev
navigating = true
}
.padding(.top, 10)
.padding(.top, 7)
Divider()
.padding([.top], 10)
.padding([.top], 7)
}
}
}