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

Commit

Permalink
fix(warnings): remove inline styles
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfidelis committed Apr 15, 2018
1 parent 00f4f4c commit 716c4e3
Show file tree
Hide file tree
Showing 3 changed files with 6,416 additions and 44 deletions.
34 changes: 12 additions & 22 deletions src/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,31 +135,12 @@ export default class Camera extends Component {
permissionDialogTitle: '',
permissionDialogMessage: '',
notAuthorizedView: (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text
style={{
textAlign: 'center',
fontSize: 16,
}}
>
Camera not authorized
</Text>
<View style={styles.authorizationContainer}>
<Text style={styles.notAuthorizedText}>Camera not authorized</Text>
</View>
),
pendingAuthorizationView: (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<View style={styles.authorizationContainer}>
<ActivityIndicator size="small" />
</View>
),
Expand Down Expand Up @@ -403,4 +384,13 @@ const RCTCamera = requireNativeComponent('RCTCamera', Camera, {

const styles = StyleSheet.create({
base: {},
authorizationContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
notAuthorizedText: {
textAlign: 'center',
fontSize: 16,
},
});
38 changes: 16 additions & 22 deletions src/RNCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
View,
ActivityIndicator,
Text,
StyleSheet,
} from 'react-native';

import type { FaceFeature } from './FaceDetector';
Expand Down Expand Up @@ -189,31 +190,12 @@ export default class Camera extends React.Component<PropsType, StateType> {
permissionDialogTitle: '',
permissionDialogMessage: '',
notAuthorizedView: (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text
style={{
textAlign: 'center',
fontSize: 16,
}}
>
Camera not authorized
</Text>
<View style={styles.authorizationContainer}>
<Text style={styles.notAuthorizedText}>Camera not authorized</Text>
</View>
),
pendingAuthorizationView: (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<View style={styles.authorizationContainer}>
<ActivityIndicator size="small" />
</View>
),
Expand Down Expand Up @@ -405,3 +387,15 @@ const RNCamera = requireNativeComponent('RNCamera', Camera, {
testID: true,
},
});

const styles = StyleSheet.create({
authorizationContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
notAuthorizedText: {
textAlign: 'center',
fontSize: 16,
},
});
Loading

0 comments on commit 716c4e3

Please sign in to comment.