wip
This commit is contained in:
parent
ac58f634a0
commit
31592a0e17
|
@ -30,12 +30,16 @@ struct ConversationMessageRow: View {
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.gesture(
|
.gesture(
|
||||||
DragGesture(minimumDistance: 20, coordinateSpace: .local)
|
DragGesture(minimumDistance: 20, coordinateSpace: .local)
|
||||||
|
.onChanged { value in
|
||||||
|
var width = value.translation.width
|
||||||
|
width = width > 0 ? 0 : width
|
||||||
|
offset = CGSize(width: width, height: 0)
|
||||||
|
}
|
||||||
.onEnded { value in
|
.onEnded { value in
|
||||||
withAnimation(.easeOut(duration: 0.1)) {
|
withAnimation(.easeOut(duration: 0.1)) {
|
||||||
if value.translation.width < 0 {
|
if value.translation.width <= -90 {
|
||||||
offset = CGSize(width: -50, height: 0)
|
|
||||||
Vibration.success.vibrate()
|
Vibration.success.vibrate()
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
|
||||||
store.dispatch(.conversationAction(.setReplyText(message.body ?? "")))
|
store.dispatch(.conversationAction(.setReplyText(message.body ?? "")))
|
||||||
withAnimation(.easeOut(duration: 0.1)) {
|
withAnimation(.easeOut(duration: 0.1)) {
|
||||||
offset = .zero
|
offset = .zero
|
||||||
|
|
|
@ -125,9 +125,9 @@ struct ConversationScreen: View {
|
||||||
Message(id: "10", type: .chat, contentType: .text, from: acc, to: contact, body: "so test so test so test", subject: nil, thread: nil, oobUrl: nil, date: Date(), pending: false, sentError: false),
|
Message(id: "10", type: .chat, contentType: .text, from: acc, to: contact, body: "so test so test so test", subject: nil, thread: nil, oobUrl: nil, date: Date(), pending: false, sentError: false),
|
||||||
Message(id: "11", type: .chat, contentType: .text, from: contact, to: acc, body: "xD", subject: nil, thread: nil, oobUrl: nil, date: Date(), pending: false, sentError: false)
|
Message(id: "11", type: .chat, contentType: .text, from: contact, to: acc, body: "xD", subject: nil, thread: nil, oobUrl: nil, date: Date(), pending: false, sentError: false)
|
||||||
]
|
]
|
||||||
|
|
||||||
state.conversationsState.replyText = "> Some Text here! And if it a long and very long text sdfsadfsadfsafsadfsadfsadfsadfassadfsadfsafsafdsadfsafdsadfsadfas sdf sdf asdf sdfasdfsd sdfasdf sdfsdfdsasdfsdfa dsafsaf"
|
state.conversationsState.replyText = "> Some Text here! And if it a long and very long text sdfsadfsadfsafsadfsadfsadfsadfassadfsadfsafsafdsadfsafdsadfsadfas sdf sdf asdf sdfasdfsd sdfasdf sdfsdfdsasdfsdfa dsafsaf"
|
||||||
|
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue