Post view improvements
Changelog-Changed: Improve look of post view Closes: #561
This commit is contained in:
committed by
William Casarin
parent
7c563cb0ae
commit
3e764e75e4
@@ -80,11 +80,22 @@ struct PostView: View {
|
|||||||
self.send_post()
|
self.send_post()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.font(.system(size: 14, weight: .bold))
|
||||||
|
.frame(width: 80, height: 30)
|
||||||
|
.foregroundColor(.white)
|
||||||
|
.background(LINEAR_GRADIENT)
|
||||||
|
.clipShape(Capsule())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding([.top, .bottom], 4)
|
.padding([.top, .bottom], 4)
|
||||||
|
|
||||||
|
HStack(alignment: .top) {
|
||||||
|
|
||||||
|
ProfilePicView(pubkey: damus_state.pubkey, size: 45.0, highlight: .none, profiles: damus_state.profiles)
|
||||||
|
|
||||||
|
VStack(alignment: .leading) {
|
||||||
ZStack(alignment: .topLeading) {
|
ZStack(alignment: .topLeading) {
|
||||||
|
|
||||||
TextEditor(text: $post)
|
TextEditor(text: $post)
|
||||||
.focused($focus)
|
.focused($focus)
|
||||||
.textInputAutocapitalization(.sentences)
|
.textInputAutocapitalization(.sentences)
|
||||||
@@ -104,6 +115,8 @@ struct PostView: View {
|
|||||||
.allowsHitTesting(false)
|
.allowsHitTesting(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This if-block observes @ for tagging
|
// This if-block observes @ for tagging
|
||||||
if let searching = get_searching_string(post) {
|
if let searching = get_searching_string(post) {
|
||||||
@@ -168,3 +181,9 @@ func get_searching_string(_ post: String) -> String? {
|
|||||||
|
|
||||||
return String(last_word.dropFirst())
|
return String(last_word.dropFirst())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct PostView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
PostView(replying_to: nil, references: [], damus_state: test_damus_state())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user