Compare commits
1 Commits
hide-hellt
...
tyiu/profi
| Author | SHA1 | Date | |
|---|---|---|---|
|
47c68a7e66
|
@@ -43,7 +43,9 @@ struct UserView: View {
|
|||||||
let profile = damus_state.profiles.lookup(id: pubkey)
|
let profile = damus_state.profiles.lookup(id: pubkey)
|
||||||
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
|
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
|
||||||
if let about = profile?.about {
|
if let about = profile?.about {
|
||||||
Text(about)
|
let blocks = parse_mentions(content: about, tags: [])
|
||||||
|
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
|
||||||
|
Text(about_string)
|
||||||
.lineLimit(3)
|
.lineLimit(3)
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ enum EventViewKind {
|
|||||||
case small
|
case small
|
||||||
case normal
|
case normal
|
||||||
case selected
|
case selected
|
||||||
|
case subheadline
|
||||||
}
|
}
|
||||||
|
|
||||||
struct EventView: View {
|
struct EventView: View {
|
||||||
@@ -106,6 +107,8 @@ func eventviewsize_to_font(_ size: EventViewKind) -> Font {
|
|||||||
return .body
|
return .body
|
||||||
case .selected:
|
case .selected:
|
||||||
return .custom("selected", size: 21.0)
|
return .custom("selected", size: 21.0)
|
||||||
|
case .subheadline:
|
||||||
|
return .subheadline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +120,8 @@ func eventviewsize_to_uifont(_ size: EventViewKind) -> UIFont {
|
|||||||
return .preferredFont(forTextStyle: .body)
|
return .preferredFont(forTextStyle: .body)
|
||||||
case .selected:
|
case .selected:
|
||||||
return .preferredFont(forTextStyle: .title2)
|
return .preferredFont(forTextStyle: .title2)
|
||||||
|
case .subheadline:
|
||||||
|
return .preferredFont(forTextStyle: .subheadline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ func eventview_pfp_size(_ size: EventViewKind) -> CGFloat {
|
|||||||
return PFP_SIZE
|
return PFP_SIZE
|
||||||
case .selected:
|
case .selected:
|
||||||
return PFP_SIZE
|
return PFP_SIZE
|
||||||
|
case .subheadline:
|
||||||
|
return PFP_SIZE * 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ struct ParticipantsView: View {
|
|||||||
let profile = damus_state.profiles.lookup(id: pubkey)
|
let profile = damus_state.profiles.lookup(id: pubkey)
|
||||||
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
|
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
|
||||||
if let about = profile?.about {
|
if let about = profile?.about {
|
||||||
Text(FollowUserView.markdown.process(about))
|
let blocks = parse_mentions(content: about, tags: [])
|
||||||
|
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
|
||||||
|
Text(about_string)
|
||||||
.lineLimit(3)
|
.lineLimit(3)
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,8 +371,14 @@ struct ProfileView: View {
|
|||||||
|
|
||||||
nameSection(profile_data: profile_data)
|
nameSection(profile_data: profile_data)
|
||||||
|
|
||||||
Text(ProfileView.markdown.process(profile_data?.about ?? ""))
|
if let about = profile_data?.about {
|
||||||
.font(.subheadline).textSelection(.enabled)
|
let blocks = parse_mentions(content: about, tags: [])
|
||||||
|
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
|
||||||
|
SelectableText(attributedString: about_string, size: .subheadline)
|
||||||
|
} else {
|
||||||
|
Text(verbatim: "")
|
||||||
|
.font(.subheadline)
|
||||||
|
}
|
||||||
|
|
||||||
if let url = profile_data?.website_url {
|
if let url = profile_data?.website_url {
|
||||||
WebsiteLink(url: url)
|
WebsiteLink(url: url)
|
||||||
|
|||||||
Reference in New Issue
Block a user