Skip to content
This repository was archived by the owner on Jun 16, 2023. It is now read-only.

Commit 716c4e3

Browse files
committed
fix(warnings): remove inline styles
1 parent 00f4f4c commit 716c4e3

File tree

3 files changed

+6416
-44
lines changed

3 files changed

+6416
-44
lines changed

src/Camera.js

+12-22
Original file line numberDiff line numberDiff line change
@@ -135,31 +135,12 @@ export default class Camera extends Component {
135135
permissionDialogTitle: '',
136136
permissionDialogMessage: '',
137137
notAuthorizedView: (
138-
<View
139-
style={{
140-
flex: 1,
141-
alignItems: 'center',
142-
justifyContent: 'center',
143-
}}
144-
>
145-
<Text
146-
style={{
147-
textAlign: 'center',
148-
fontSize: 16,
149-
}}
150-
>
151-
Camera not authorized
152-
</Text>
138+
<View style={styles.authorizationContainer}>
139+
<Text style={styles.notAuthorizedText}>Camera not authorized</Text>
153140
</View>
154141
),
155142
pendingAuthorizationView: (
156-
<View
157-
style={{
158-
flex: 1,
159-
alignItems: 'center',
160-
justifyContent: 'center',
161-
}}
162-
>
143+
<View style={styles.authorizationContainer}>
163144
<ActivityIndicator size="small" />
164145
</View>
165146
),
@@ -403,4 +384,13 @@ const RCTCamera = requireNativeComponent('RCTCamera', Camera, {
403384

404385
const styles = StyleSheet.create({
405386
base: {},
387+
authorizationContainer: {
388+
flex: 1,
389+
alignItems: 'center',
390+
justifyContent: 'center',
391+
},
392+
notAuthorizedText: {
393+
textAlign: 'center',
394+
fontSize: 16,
395+
},
406396
});

src/RNCamera.js

+16-22
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
View,
1212
ActivityIndicator,
1313
Text,
14+
StyleSheet,
1415
} from 'react-native';
1516

1617
import type { FaceFeature } from './FaceDetector';
@@ -189,31 +190,12 @@ export default class Camera extends React.Component<PropsType, StateType> {
189190
permissionDialogTitle: '',
190191
permissionDialogMessage: '',
191192
notAuthorizedView: (
192-
<View
193-
style={{
194-
flex: 1,
195-
alignItems: 'center',
196-
justifyContent: 'center',
197-
}}
198-
>
199-
<Text
200-
style={{
201-
textAlign: 'center',
202-
fontSize: 16,
203-
}}
204-
>
205-
Camera not authorized
206-
</Text>
193+
<View style={styles.authorizationContainer}>
194+
<Text style={styles.notAuthorizedText}>Camera not authorized</Text>
207195
</View>
208196
),
209197
pendingAuthorizationView: (
210-
<View
211-
style={{
212-
flex: 1,
213-
alignItems: 'center',
214-
justifyContent: 'center',
215-
}}
216-
>
198+
<View style={styles.authorizationContainer}>
217199
<ActivityIndicator size="small" />
218200
</View>
219201
),
@@ -405,3 +387,15 @@ const RNCamera = requireNativeComponent('RNCamera', Camera, {
405387
testID: true,
406388
},
407389
});
390+
391+
const styles = StyleSheet.create({
392+
authorizationContainer: {
393+
flex: 1,
394+
alignItems: 'center',
395+
justifyContent: 'center',
396+
},
397+
notAuthorizedText: {
398+
textAlign: 'center',
399+
fontSize: 16,
400+
},
401+
});

0 commit comments

Comments
 (0)