File tree 1 file changed +16
-15
lines changed
Adamant/Modules/PartnerQR 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -12,25 +12,25 @@ struct PartnerQRView: View {
12
12
@ObservedObject var viewModel : PartnerQRViewModel
13
13
14
14
var body : some View {
15
- Form {
16
- infoSection ( )
17
- toggleSection ( )
18
- buttonSection ( )
19
- }
20
- . navigationBarTitleDisplayMode ( . inline)
21
- . toolbar {
22
- ToolbarItem ( placement: . principal) {
23
- toolbar ( )
15
+ GeometryReader { geometry in
16
+ Form {
17
+ infoSection ( )
18
+ toggleSection ( )
19
+ buttonSection ( )
20
+ }
21
+ . navigationBarTitleDisplayMode ( . inline)
22
+ . toolbar {
23
+ ToolbarItem ( placement: . principal) {
24
+ toolbar ( maxWidth: geometry. size. width)
25
+ }
24
26
}
25
27
}
26
28
}
27
29
}
28
30
29
31
private extension PartnerQRView {
30
- func toolbar( ) -> some View {
31
- Button ( action: {
32
- viewModel. renameContact ( )
33
- } ) {
32
+ func toolbar( maxWidth: CGFloat ) -> some View {
33
+ Button ( action: viewModel. renameContact) {
34
34
HStack {
35
35
if let uiImage = viewModel. partnerImage {
36
36
Image ( uiImage: uiImage)
@@ -42,9 +42,8 @@ private extension PartnerQRView {
42
42
. minimumScaleFactor ( 0.7 )
43
43
. lineLimit ( 1 )
44
44
}
45
- . frame ( maxWidth: UIScreen . main . bounds . width - 150 )
45
+ . frame ( maxWidth: maxWidth - toolbarSpace , alignment : . center )
46
46
}
47
- . frame ( maxWidth: UIScreen . main. bounds. width - 150 )
48
47
}
49
48
50
49
func infoSection( ) -> some View {
@@ -106,3 +105,5 @@ private extension PartnerQRView {
106
105
}
107
106
}
108
107
}
108
+
109
+ private let toolbarSpace : CGFloat = 150
You can’t perform that action at this time.
0 commit comments