Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Delemangi committed Feb 11, 2024
1 parent 3deb7d8 commit b90d8ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/camera/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ const useStyles = makeStyles((theme) => ({
},
}));

export default function App() {
const CameraTab = () => {
const styles = useStyles();
const [hasCameraPermission, setHasCameraPermission] = useState(false);
const [image, setImage] = useState<string | null>(null);
const [type, setType] = useState(CameraType.back);
const cameraRef = useRef<Camera>(null);

useEffect(() => {
const func = async () => {
const requestPermissions = async () => {
MediaLibrary.requestPermissionsAsync();
const cameraStatus = await Camera.requestCameraPermissionsAsync();
setHasCameraPermission(cameraStatus.status === "granted");
};

func();
requestPermissions();
}, []);

const takePicture = async () => {
Expand Down Expand Up @@ -132,4 +132,6 @@ export default function App() {
</View>
</View>
);
}
};

export default CameraTab;

0 comments on commit b90d8ff

Please sign in to comment.