You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Linter update (#1777)
* Update eslint config * Applied linter to lib * Applied eslint config to CliClient/app * Removed prettier due to https://github.com/prettier/prettier/pull/4765 * First pass on test units * Applied linter config to test units * Applied eslint config to clipper * Applied to plugin dir * Applied to root of ElectronClient * Applied on RN root * Applied on CLI root * Applied on Clipper root * Applied config to tools * test hook * test hook * test hook * Added pre-commit hook * Applied rule no-trailing-spaces * Make sure root packages are installed when installing sub-dir * Added doc
This commit is contained in:
@ -1,19 +1,18 @@
|
||||
const React = require('react'); const Component = React.Component;
|
||||
const { View, Button, StyleSheet, TouchableOpacity } = require('react-native');
|
||||
const { globalStyle, themeStyle } = require('lib/components/global-style.js');
|
||||
const React = require('react');
|
||||
const Component = React.Component;
|
||||
const { View, TouchableOpacity } = require('react-native');
|
||||
import { RNCamera } from 'react-native-camera';
|
||||
const Icon = require('react-native-vector-icons/Ionicons').default;
|
||||
const { _ } = require('lib/locale.js');
|
||||
|
||||
class CameraView extends Component {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.state = {
|
||||
snapping: false,
|
||||
};
|
||||
|
||||
|
||||
this.back_onPress = this.back_onPress.bind(this);
|
||||
this.photo_onPress = this.photo_onPress.bind(this);
|
||||
}
|
||||
@ -30,7 +29,7 @@ class CameraView extends Component {
|
||||
const result = await this.camera.takePictureAsync({
|
||||
quality: 0.8,
|
||||
exif: true,
|
||||
fixOrientation: true
|
||||
fixOrientation: true,
|
||||
});
|
||||
|
||||
if (this.props.onPhoto) this.props.onPhoto(result);
|
||||
@ -39,14 +38,15 @@ class CameraView extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const theme = themeStyle(this.props.theme);
|
||||
const photoIcon = this.state.snapping ? 'md-checkmark' : 'md-camera';
|
||||
|
||||
return (
|
||||
<View style={this.props.style}>
|
||||
<RNCamera
|
||||
style={{flex:1}}
|
||||
ref={ref => { this.camera = ref; }}
|
||||
style={{ flex: 1 }}
|
||||
ref={ref => {
|
||||
this.camera = ref;
|
||||
}}
|
||||
type={RNCamera.Constants.Type.back}
|
||||
captureAudio={false}
|
||||
androidCameraPermissionOptions={{
|
||||
@ -56,24 +56,30 @@ class CameraView extends Component {
|
||||
buttonNegative: _('Cancel'),
|
||||
}}
|
||||
>
|
||||
<View style={{flex:1, justifyContent:'space-between', flexDirection:'column'}}>
|
||||
<View style={{flex:1, justifyContent:'flex-start'}}>
|
||||
<View style={{ flex: 1, justifyContent: 'space-between', flexDirection: 'column' }}>
|
||||
<View style={{ flex: 1, justifyContent: 'flex-start' }}>
|
||||
<TouchableOpacity onPress={this.back_onPress}>
|
||||
<View style={{ marginLeft:5, marginTop:5, borderRadius:90, width:50,height:50, display:'flex', backgroundColor:'#ffffff55', justifyContent:'center', alignItems:'center'}}>
|
||||
<Icon name={'md-arrow-back'} style={{
|
||||
fontSize: 40,
|
||||
color: 'black',
|
||||
}} />
|
||||
<View style={{ marginLeft: 5, marginTop: 5, borderRadius: 90, width: 50, height: 50, display: 'flex', backgroundColor: '#ffffff55', justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Icon
|
||||
name={'md-arrow-back'}
|
||||
style={{
|
||||
fontSize: 40,
|
||||
color: 'black',
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<View style={{flex:1, justifyContent:'center', alignItems:'flex-end', flexDirection:'row'}}>
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-end', flexDirection: 'row' }}>
|
||||
<TouchableOpacity onPress={this.photo_onPress}>
|
||||
<View style={{marginBottom:20, borderRadius:90, width:90,height:90,backgroundColor:'#ffffffaa', display:'flex', justifyContent:'center', alignItems:'center'}}>
|
||||
<Icon name={photoIcon} style={{
|
||||
fontSize: 60,
|
||||
color: 'black',
|
||||
}} />
|
||||
<View style={{ marginBottom: 20, borderRadius: 90, width: 90, height: 90, backgroundColor: '#ffffffaa', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Icon
|
||||
name={photoIcon}
|
||||
style={{
|
||||
fontSize: 60,
|
||||
color: 'black',
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
@ -82,7 +88,6 @@ class CameraView extends Component {
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = CameraView;
|
||||
module.exports = CameraView;
|
||||
|
Reference in New Issue
Block a user