Skip to content

Commit bc221df

Browse files
committed
update with icons
1 parent ce53d3b commit bc221df

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/components/Camera/index.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
PhotoFile,
1313
useCameraDevices,
1414
} from 'react-native-vision-camera';
15+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
16+
1517
import PhotoPreview from '../PhotoPreview';
1618

1719
import * as S from './styles';
@@ -128,10 +130,22 @@ function Camera() {
128130

129131
<S.Buttons>
130132
<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+
)}
132148
</S.Button>
133-
<S.Button onPress={takePhoto} />
134-
<S.Button onPress={flipCamera} />
135149
</S.Buttons>
136150
</S.Container>
137151
);

0 commit comments

Comments
 (0)