@@ -90,13 +90,7 @@ export const SpeechToTextScreen = () => {
90
90
</ View >
91
91
{ downloadProgress !== 1 ? (
92
92
< View style = { styles . transcriptionContainer } >
93
- < Text
94
- style = { {
95
- ...styles . transcriptionText ,
96
- color : 'gray' ,
97
- textAlign : 'center' ,
98
- } }
99
- >
93
+ < Text style = { [ styles . transcriptionText , styles . textGreyCenter ] } >
100
94
{ `Downloading model: ${ ( Number ( downloadProgress . toFixed ( 4 ) ) * 100 ) . toFixed ( 2 ) } %` }
101
95
</ Text >
102
96
</ View >
@@ -106,11 +100,7 @@ export const SpeechToTextScreen = () => {
106
100
style = {
107
101
sequence
108
102
? styles . transcriptionText
109
- : {
110
- ...styles . transcriptionText ,
111
- color : 'gray' ,
112
- textAlign : 'center' ,
113
- }
103
+ : [ styles . transcriptionText , styles . textGreyCenter ]
114
104
}
115
105
>
116
106
{ sequence ||
@@ -121,7 +111,7 @@ export const SpeechToTextScreen = () => {
121
111
) }
122
112
{ error && (
123
113
< Text
124
- style = { { ... styles . transcriptionText , color : 'red' } }
114
+ style = { [ styles . transcriptionText , styles . redText ] }
125
115
> { `${ error } ` } </ Text >
126
116
) }
127
117
< InputPrompt
@@ -140,18 +130,14 @@ export const SpeechToTextScreen = () => {
140
130
< View
141
131
style = { [
142
132
styles . recordingButtonWrapper ,
143
- buttonDisabled && {
144
- borderColor : 'grey' ,
145
- } ,
133
+ buttonDisabled && styles . borderGrey ,
146
134
] }
147
135
>
148
136
< TouchableOpacity
149
137
disabled = { buttonDisabled }
150
138
style = { [
151
139
styles . recordingButton ,
152
- buttonDisabled && {
153
- backgroundColor : 'grey' ,
154
- } ,
140
+ buttonDisabled && styles . backgroundGrey ,
155
141
] }
156
142
onPress = { async ( ) => {
157
143
if ( ! audioUrl ) {
@@ -162,7 +148,7 @@ export const SpeechToTextScreen = () => {
162
148
}
163
149
} }
164
150
>
165
- < Text style = { { ... styles . recordingButtonText , fontSize : 13 } } >
151
+ < Text style = { [ styles . recordingButtonText , styles . font13 ] } >
166
152
{ 'TRANSCRIBE FROM URL' }
167
153
</ Text >
168
154
</ TouchableOpacity >
@@ -172,20 +158,17 @@ export const SpeechToTextScreen = () => {
172
158
< View
173
159
style = { [
174
160
styles . recordingButtonWrapper ,
175
- recordingButtonDisabled && {
176
- borderColor : 'grey' ,
177
- } ,
178
- isRecording && { borderColor : 'rgb(240, 63, 50)' } ,
161
+ recordingButtonDisabled && styles . borderGrey ,
162
+ isRecording && styles . borderRed ,
179
163
] }
180
164
>
165
+ zRXW
181
166
< TouchableOpacity
182
167
disabled = { recordingButtonDisabled || isGenerating }
183
168
style = { [
184
169
styles . recordingButton ,
185
- recordingButtonDisabled && {
186
- backgroundColor : 'grey' ,
187
- } ,
188
- isRecording && { backgroundColor : 'rgb(240, 63, 50)' } ,
170
+ recordingButtonDisabled && styles . backgroundGrey ,
171
+ isRecording && styles . backgroundRed ,
189
172
] }
190
173
onPress = { handleRecordPress }
191
174
>
@@ -194,11 +177,7 @@ export const SpeechToTextScreen = () => {
194
177
</ Text >
195
178
{ DeviceInfo . isEmulatorSync ( ) && (
196
179
< Text
197
- style = { {
198
- ...styles . recordingButtonText ,
199
- color : 'rgb(254, 148, 141)' ,
200
- fontSize : 11 ,
201
- } }
180
+ style = { [ styles . recordingButtonText , styles . emulatorWarning ] }
202
181
>
203
182
recording does not work on emulator
204
183
</ Text >
@@ -286,4 +265,30 @@ const styles = StyleSheet.create({
286
265
color : 'white' ,
287
266
fontWeight : '600' ,
288
267
} ,
268
+ textGreyCenter : {
269
+ color : 'gray' ,
270
+ textAlign : 'center' ,
271
+ } ,
272
+ redText : {
273
+ color : 'red' ,
274
+ } ,
275
+ borderGrey : {
276
+ borderColor : 'grey' ,
277
+ } ,
278
+ backgroundGrey : {
279
+ backgroundColor : 'grey' ,
280
+ } ,
281
+ font13 : {
282
+ fontSize : 13 ,
283
+ } ,
284
+ borderRed : {
285
+ borderColor : 'rgb(240, 63, 50)' ,
286
+ } ,
287
+ backgroundRed : {
288
+ backgroundColor : 'rgb(240, 63, 50)' ,
289
+ } ,
290
+ emulatorWarning : {
291
+ color : 'rgb(254, 148, 141)' ,
292
+ fontSize : 11 ,
293
+ } ,
289
294
} ) ;
0 commit comments