mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Simplify how we build bubbles for previewing purposes, make use of the new bubbleBackground modifier.
This commit is contained in:
committed by
Stefan Ceriu
parent
681daf50ea
commit
c97dcc18f2
@@ -137,7 +137,8 @@ struct SwipeRightAction_Previews: PreviewProvider, TestablePreview {
|
||||
NavigationStack {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
mockBubble("This is a message from somebody with a couple of lines of text.")
|
||||
Text("This is a message from somebody with a couple of lines of text.")
|
||||
.bubbleBackground()
|
||||
.swipeRightAction {
|
||||
Image(systemName: "flame")
|
||||
} shouldStartAction: {
|
||||
@@ -156,12 +157,5 @@ struct SwipeRightAction_Previews: PreviewProvider, TestablePreview {
|
||||
.presentationDetents([.medium])
|
||||
}
|
||||
}
|
||||
|
||||
func mockBubble(_ body: String) -> some View {
|
||||
Text(body)
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 4)
|
||||
.background(Color.compound._bgBubbleOutgoing, in: RoundedRectangle(cornerRadius: 12))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user