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

Commit

Permalink
fix(rn_camera): improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiCalazans committed Apr 25, 2018
1 parent 45cc8f2 commit 3811d82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions docs/RNCamera.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ class App extends Component {
return (
<View style={styles.container}>
<RNCamera
ref={ref => {
this.camera = ref;
}}
style={styles.preview}
type={RNCamera.Constants.Type.back}
flashMode={RNCamera.Constants.FlashMode.on}
Expand Down
8 changes: 4 additions & 4 deletions src/RNCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ export default class Camera extends React.Component<PropsType, StateType> {
return isAuthorized ? 'READY' : isAuthorizationChecked ? 'PENDING_AUTHORIZATION' : 'NOT_AUTHORIZED';
}

// CAF = Children as Function;
hasCAF = (): * => typeof this.props.children === 'function';
// FaCC = Function as Child Component;
hasFaCC = (): * => typeof this.props.children === 'function';

renderChildren = (): * => {
if (this.hasCAF()) {
if (this.hasFaCC()) {
return this.props.children({ camera: this, status: this.getStatus() })
}
return null;
Expand All @@ -334,7 +334,7 @@ export default class Camera extends React.Component<PropsType, StateType> {
render() {
const nativeProps = this._convertNativeProps(this.props);

if (this.state.isAuthorized || this.hasCAF()) {
if (this.state.isAuthorized || this.hasFaCC()) {
return (
<RNCamera
{...nativeProps}
Expand Down

0 comments on commit 3811d82

Please sign in to comment.