@@ -16,7 +16,7 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
16
16
17
17
var body : some View {
18
18
ZStack {
19
- VStack ( alignment: . leading, spacing: 8 ) {
19
+ VStack ( alignment: . leading, spacing: 16 ) {
20
20
if store. state. isSendDisabled {
21
21
InfoContainer ( Localizations . sendDisabledWarning)
22
22
. accessibilityIdentifier ( " DisabledSendPolicyLabel " )
@@ -25,16 +25,13 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
25
25
. accessibilityIdentifier ( " HideEmailAddressPolicyLabel " )
26
26
}
27
27
28
- switch store. state. type {
29
- case . text:
30
- textSendAttributes
31
- case . file:
32
- fileSendAttributes
33
- }
34
-
35
28
sendDetails
36
29
37
30
additionalOptions
31
+
32
+ if store. state. mode == . edit {
33
+ deleteSendButton
34
+ }
38
35
}
39
36
. scrollView ( padding: 12 )
40
37
. disabled ( store. state. isSendDisabled)
@@ -95,10 +92,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
95
92
}
96
93
}
97
94
}
98
-
99
- AsyncButton ( Localizations . delete, role: . destructive) {
100
- await store. perform ( . deletePressed)
101
- }
102
95
}
103
96
}
104
97
}
@@ -164,7 +157,16 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
164
157
)
165
158
)
166
159
}
167
- . padding ( . top, 8 )
160
+ }
161
+
162
+ /// The button to delete the send.
163
+ private var deleteSendButton : some View {
164
+ AsyncButton {
165
+ await store. perform ( . deletePressed)
166
+ } label: {
167
+ Label ( Localizations . deleteSend, image: Asset . Images. trash16. swiftUIImage, scaleImageDimension: 16 )
168
+ }
169
+ . buttonStyle ( . secondary( isDestructive: true , size: . medium) )
168
170
}
169
171
170
172
/// The deletion date field.
@@ -190,7 +192,7 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
190
192
191
193
/// The attributes for a file type send.
192
194
@ViewBuilder private var fileSendAttributes : some View {
193
- SectionView ( Localizations . file , contentSpacing : 8 ) {
195
+ VStack ( alignment : . leading , spacing : 8 ) {
194
196
switch store. state. mode {
195
197
case . add, . shareExtension:
196
198
if let fileName = store. state. fileName {
@@ -209,7 +211,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
209
211
}
210
212
. buttonStyle ( . secondary( ) )
211
213
. accessibilityIdentifier ( " SendChooseFileButton " )
212
- . padding ( . top, 4 )
213
214
}
214
215
215
216
Text ( Localizations . maxFileSize)
@@ -239,7 +240,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
239
240
}
240
241
}
241
242
}
242
- . padding ( . top, 8 )
243
243
}
244
244
245
245
/// The name field.
@@ -280,6 +280,13 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length
280
280
SectionView ( Localizations . sendDetails, contentSpacing: 8 ) {
281
281
nameField
282
282
283
+ switch store. state. type {
284
+ case . text:
285
+ textSendAttributes
286
+ case . file:
287
+ fileSendAttributes
288
+ }
289
+
283
290
if store. state. type == . text {
284
291
ContentBlock {
285
292
BitwardenToggle ( Localizations . hideTextByDefault, isOn: store. binding (
0 commit comments