|
|
|
@ -21,7 +21,6 @@ const { width, height } = Dimensions.get("screen"); |
|
|
|
|
import laptopImage from "../../assets/laptop.png"; |
|
|
|
|
|
|
|
|
|
function Scan({ theme, route }) { |
|
|
|
|
const { page } = route.params; |
|
|
|
|
const navigation = useNavigation(); |
|
|
|
|
const [hasPermission, setHasPermission] = React.useState(null); |
|
|
|
|
const [scanned, setScanned] = React.useState(false); |
|
|
|
@ -36,7 +35,7 @@ function Scan({ theme, route }) { |
|
|
|
|
const handleBarCodeScanned = React.useCallback( |
|
|
|
|
({ type, data }) => { |
|
|
|
|
setScanned(true); |
|
|
|
|
if (page === "activation") { |
|
|
|
|
if (route?.params?.page === "activation") { |
|
|
|
|
navigation.push("QRContent", { data }); |
|
|
|
|
}else{ |
|
|
|
|
navigation.push("Activation", { data }); |
|
|
|
@ -45,13 +44,6 @@ function Scan({ theme, route }) { |
|
|
|
|
[route, scanned] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (hasPermission === null) { |
|
|
|
|
return <Text>Requesting for camera permission</Text>; |
|
|
|
|
} |
|
|
|
|
if (hasPermission === false) { |
|
|
|
|
return <Text>No access to camera</Text>; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<ImageBackground |
|
|
|
|
source={laptopImage} |
|
|
|
|