File tree Expand file tree Collapse file tree 1 file changed +24
-18
lines changed
Sources/StreamChatSwiftUI/ChatChannel/Gallery Expand file tree Collapse file tree 1 file changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -61,27 +61,25 @@ struct GalleryView: View {
61
61
. tabViewStyle ( . page( indexDisplayMode: . never) )
62
62
. background ( Color ( colors. background1) )
63
63
64
- if let image = loadedImages [ selected] {
65
- HStack {
66
- ShareButtonView ( content: [ image] )
67
- . standardPadding ( )
68
-
69
- Spacer ( )
70
-
71
- Text ( " \( selected + 1 ) of \( sources. count) " )
72
- . font ( fonts. bodyBold)
73
-
74
- Spacer ( )
75
-
76
- Button {
77
- gridShown = true
78
- } label: {
79
- Image ( systemName: " square.grid.3x3.fill " )
80
- }
64
+ HStack {
65
+ ShareButtonView ( content: sharingContent)
81
66
. standardPadding ( )
67
+
68
+ Spacer ( )
69
+
70
+ Text ( " \( selected + 1 ) of \( sources. count) " )
71
+ . font ( fonts. bodyBold)
72
+
73
+ Spacer ( )
74
+
75
+ Button {
76
+ gridShown = true
77
+ } label: {
78
+ Image ( systemName: " square.grid.3x3.fill " )
82
79
}
83
- . foregroundColor ( Color ( colors . text ) )
80
+ . standardPadding ( )
84
81
}
82
+ . foregroundColor ( Color ( colors. text) )
85
83
}
86
84
. sheet ( isPresented: $gridShown) {
87
85
GridPhotosView (
@@ -92,6 +90,14 @@ struct GalleryView: View {
92
90
}
93
91
}
94
92
93
+ private var sharingContent : [ UIImage ] {
94
+ if let image = loadedImages [ selected] {
95
+ return [ image]
96
+ } else {
97
+ return [ ]
98
+ }
99
+ }
100
+
95
101
private var sources : [ URL ] {
96
102
message. imageAttachments. map { attachment in
97
103
attachment. imageURL
You can’t perform that action at this time.
0 commit comments