@@ -62,63 +62,63 @@ public struct PermissionCard: View {
6262 @ViewBuilder
6363 private var statusView : some View {
6464 switch status {
65- case . notDetermined:
66- Button {
67- isProcessing = true
68- Task {
69- await onRequest ( )
70- isProcessing = false
71- }
72- } label: {
73- HStack ( spacing: 6 ) {
74- if isProcessing {
75- ProgressView ( )
76- . scaleEffect ( 0.8 )
77- . tint ( . white)
78- } else {
79- Text ( " Permitir " )
80- . font ( . subheadline. weight ( . semibold) )
81- }
82- }
83- . padding ( . horizontal, 16 )
84- . padding ( . vertical, 8 )
85- . background ( Color . blue)
86- . foregroundStyle ( . white)
87- . clipShape ( Capsule ( ) )
65+ case . notDetermined:
66+ Button {
67+ isProcessing = true
68+ Task {
69+ await onRequest ( )
70+ isProcessing = false
8871 }
89- . buttonStyle ( . plain)
90- . disabled ( isProcessing)
91- . accessibilityLabel ( " Permitir \( title) " )
92- . accessibilityHint ( " Toque para autorizar esta permissão " )
93-
94- case . granted:
72+ } label: {
9573 HStack ( spacing: 6 ) {
96- Image ( systemName: " checkmark.circle.fill " )
97- . font ( . subheadline)
98- Text ( " Autorizado " )
99- . font ( . subheadline. weight ( . semibold) )
74+ if isProcessing {
75+ ProgressView ( )
76+ . scaleEffect ( 0.8 )
77+ . tint ( . white)
78+ } else {
79+ Text ( " Permitir " )
80+ . font ( . subheadline. weight ( . semibold) )
81+ }
10082 }
101- . foregroundStyle ( . white)
10283 . padding ( . horizontal, 16 )
10384 . padding ( . vertical, 8 )
104- . background ( Color . green)
105- . clipShape ( Capsule ( ) )
106- . accessibilityLabel ( " \( title) autorizado " )
107-
108- case . denied:
109- HStack ( spacing: 6 ) {
110- Image ( systemName: " xmark.circle.fill " )
111- . font ( . subheadline)
112- Text ( " Negado " )
113- . font ( . subheadline. weight ( . semibold) )
114- }
85+ . background ( Color . blue)
11586 . foregroundStyle ( . white)
116- . padding ( . horizontal, 16 )
117- . padding ( . vertical, 8 )
118- . background ( Color . gray)
11987 . clipShape ( Capsule ( ) )
120- . accessibilityLabel ( " \( title) negado " )
121- . accessibilityHint ( " Você pode alterar nas Configurações do dispositivo " )
88+ }
89+ . buttonStyle ( . plain)
90+ . disabled ( isProcessing)
91+ . accessibilityLabel ( " Permitir \( title) " )
92+ . accessibilityHint ( " Toque para autorizar esta permissão " )
93+
94+ case . granted:
95+ HStack ( spacing: 6 ) {
96+ Image ( systemName: " checkmark.circle.fill " )
97+ . font ( . subheadline)
98+ Text ( " Autorizado " )
99+ . font ( . subheadline. weight ( . semibold) )
100+ }
101+ . foregroundStyle ( . white)
102+ . padding ( . horizontal, 16 )
103+ . padding ( . vertical, 8 )
104+ . background ( Color . green)
105+ . clipShape ( Capsule ( ) )
106+ . accessibilityLabel ( " \( title) autorizado " )
107+
108+ case . denied:
109+ HStack ( spacing: 6 ) {
110+ Image ( systemName: " xmark.circle.fill " )
111+ . font ( . subheadline)
112+ Text ( " Negado " )
113+ . font ( . subheadline. weight ( . semibold) )
114+ }
115+ . foregroundStyle ( . white)
116+ . padding ( . horizontal, 16 )
117+ . padding ( . vertical, 8 )
118+ . background ( Color . gray)
119+ . clipShape ( Capsule ( ) )
120+ . accessibilityLabel ( " \( title) negado " )
121+ . accessibilityHint ( " Você pode alterar nas Configurações do dispositivo " )
122122 }
123123 }
124124}
0 commit comments