File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import {
12
12
PhotoFile ,
13
13
useCameraDevices ,
14
14
} from 'react-native-vision-camera' ;
15
+ import MaterialIcons from 'react-native-vector-icons/MaterialIcons' ;
16
+
15
17
import PhotoPreview from '../PhotoPreview' ;
16
18
17
19
import * as S from './styles' ;
@@ -128,10 +130,22 @@ function Camera() {
128
130
129
131
< S . Buttons >
130
132
< S . Button >
131
- < PhotoPreview photo = { `file://${ photos [ 0 ] ?. path } ` } />
133
+ { photos . length > 0 ? (
134
+ < PhotoPreview photo = { `file://${ photos [ 0 ] . path } ` } />
135
+ ) : (
136
+ < MaterialIcons name = "image-not-supported" size = { 24 } color = "black" />
137
+ ) }
138
+ </ S . Button >
139
+ < S . Button onPress = { takePhoto } >
140
+ < MaterialIcons name = "camera-alt" size = { 24 } color = "black" />
141
+ </ S . Button >
142
+ < S . Button onPress = { flipCamera } >
143
+ { frontCamera ? (
144
+ < MaterialIcons name = "camera-rear" size = { 24 } color = "black" />
145
+ ) : (
146
+ < MaterialIcons name = "camera-front" size = { 24 } color = "black" />
147
+ ) }
132
148
</ S . Button >
133
- < S . Button onPress = { takePhoto } />
134
- < S . Button onPress = { flipCamera } />
135
149
</ S . Buttons >
136
150
</ S . Container >
137
151
) ;
You can’t perform that action at this time.
0 commit comments