diff options
author | Shravya Ramesh <shravs1208@gmail.com> | 2021-06-25 16:58:05 -0700 |
---|---|---|
committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-06-25 16:58:05 -0700 |
commit | 448e91ed0b6c7519c02bbe1ac32a9d51989679db (patch) | |
tree | f202a19f87a6dc2de5ca948d6941c50245746865 /src | |
parent | 6f94f0bb6dbe12e23f4222a0d0e3ffb09af965d7 (diff) |
Fix lint errors
Diffstat (limited to 'src')
-rw-r--r-- | src/components/camera/buttons.tsx | 11 | ||||
-rw-r--r-- | src/screens/moments/CameraScreen.tsx | 23 | ||||
-rw-r--r-- | src/utils/camera.ts | 4 |
3 files changed, 21 insertions, 17 deletions
diff --git a/src/components/camera/buttons.tsx b/src/components/camera/buttons.tsx index 321be958..936a663d 100644 --- a/src/components/camera/buttons.tsx +++ b/src/components/camera/buttons.tsx @@ -25,15 +25,16 @@ export const GalleryIcon: React.FC<GalleryIconProps> = ({ title, mostRecentPhoto, }) => { + const navigation = useNavigation(); return ( <TouchableOpacity - onPress={() => navigateToImagePicker(screenType, title)} + onPress={() => navigateToImagePicker(navigation, screenType, title)} style={styles.saveButton}> <Image source={{uri: mostRecentPhoto}} width={40} height={40} - style={{borderWidth: 2, borderColor: 'white', borderRadius: 5}} + style={styles.galleryIcon} /> <Text style={styles.saveButtonLabel}>Gallery</Text> </TouchableOpacity> @@ -82,14 +83,14 @@ export const FlashButton: React.FC<FlashButtonProps> = ({ height={30} width={20} color={'white'} - style={{zIndex: 999}} + style={styles.flashIcon} /> ) : ( <FlashOffIcon height={30} width={20} color={'white'} - style={{zIndex: 999}} + style={styles.flashIcon} /> )} <Text style={styles.saveButtonLabel}>Flash</Text> @@ -146,4 +147,6 @@ const styles = StyleSheet.create({ alignItems: 'center', borderRadius: 30, }, + galleryIcon: {borderWidth: 2, borderColor: 'white', borderRadius: 5}, + flashIcon: {zIndex: 2}, }); diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index 4c2633a3..8a88d95e 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -103,10 +103,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { <FlashButton flashMode={flashMode} setFlashMode={setFlashMode} /> <RNCamera ref={cameraRef} - style={{ - flex: 1, - justifyContent: 'space-between', - }} + style={styles.camera} type={cameraType} flashMode={flashMode} /> @@ -123,13 +120,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { style={styles.captureButtonContainer}> <View style={styles.captureButton} /> </TouchableOpacity> - <View - style={{ - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center', - width: (SCREEN_WIDTH - 100) / 2, - }}> + <View style={styles.bottomRightContainer}> {capturedImage ? ( <TaggSquareButton onPress={handleNext} @@ -154,6 +145,10 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { }; const styles = StyleSheet.create({ + camera: { + flex: 1, + justifyContent: 'space-between', + }, container: { flex: 1, flexDirection: 'column', @@ -195,6 +190,12 @@ const styles = StyleSheet.create({ flexDirection: 'row', justifyContent: 'center', }, + bottomRightContainer: { + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + width: (SCREEN_WIDTH - 100) / 2, + }, nextButton: { zIndex: 1, width: normalize(100), diff --git a/src/utils/camera.ts b/src/utils/camera.ts index fc2471e5..1c57f85d 100644 --- a/src/utils/camera.ts +++ b/src/utils/camera.ts @@ -2,7 +2,7 @@ import CameraRoll from '@react-native-community/cameraroll'; import {useNavigation} from '@react-navigation/native'; import {Dispatch, RefObject, SetStateAction} from 'react'; import {Alert} from 'react-native'; -import {Orientation, RNCamera} from 'react-native-camera'; +import {RNCamera} from 'react-native-camera'; import ImagePicker from 'react-native-image-crop-picker'; import {ScreenType} from 'src/types'; import {ERROR_UPLOAD} from '../constants/strings'; @@ -36,10 +36,10 @@ export const downloadImage = (capturedImageURI: string) => { }; export const navigateToImagePicker = ( + navigation: any, screenType: ScreenType, title: string, ) => { - const navigation = useNavigation(); ImagePicker.openPicker({ smartAlbums: [ 'Favorites', |