/* eslint-disable react-native/no-inline-styles */ // import "react-native-reanimated"; import React, { useEffect, useRef, useState } from "react"; import { Pressable, SafeAreaView, StyleSheet, Text, TextInput, View, } from "react-native"; import SafecamCapture, { SafecamCaptureRef } from "./src"; import { Configuration, Step } from "./src/types/Configuration"; import { LogBox } from "react-native"; // const digestFetch = require("react-native-digest-fetch"); const SOP_Sample: Configuration = { steps: [ { slots: [ { key: "exterior-360-spin", action: { captureType: "Video", title: "spin-capture", sourceType: "DeviceCamera", }, title: "Closed Door Spin", postprocessingServices: [ { service_id: "image_extraction", }, { service_id: "inference", }, ], }, { action: { captureType: "Image", title: "image-capture-2", sourceType: "Ricoh", }, title: "Open Door Spin", }, ], title: "Spin", }, // { // slots: [ // // { // // refKey: "exterior-360-spin", // // action: { // // captureType: "Image", // // title: "exterior-imperfection-1", // // sourceType: "DeviceCamera", // // }, // // slotType: "IMPERFECTION", // // title: "Dent", // // }, // { // refKey: "exterior-360-spin", // action: { // captureType: "Image", // title: "exterior-imperfection-2", // sourceType: "DeviceCamera", // }, // slotType: "IMPERFECTION", // title: "Scratch on Glass", // imperfectionMetaData: { // hotspotCategoryGroup: "front_windshield", // }, // }, // ], // title: "Imperfections", // }, ], title: "sample-sop", }; LogBox.ignoreLogs(["Warning: ..."]); // Ignore log notification by message LogBox.ignoreAllLogs(); const App = () => { const [productID, setProductID] = useState(""); const [formSubmitted, setFormSubmitted] = useState(false); const [dynamicSteps, setDynamicSteps] = useState([]); const ref = useRef(null); useEffect(() => { // setTimeout(() => { // ref.current?.addDynamic([ // { // refKey: "exterior-360-spin", // postprocessingServices: [ // { // service_id: "hotspot_tracking", // }, // ], // slotItems: [ // { // title: "slot-item-1", // availableActions: [ // { // captureType: "Video", // title: "image-capture", // sourceType: "DeviceCamera", // }, // { // captureType: "Image", // title: "image-capture", // sourceType: "DeviceCamera", // }, // ], // }, // ], // slotType: "IMPERFECTION", // title: "windshield wiper broken", // }, // ]); // }, 10000); }, []); const handleFormSubmit = () => { if (productID) setFormSubmitted(true); }; return ( {productID && formSubmitted ? ( { setProductID(null); setFormSubmitted(false); }} onDataUpload={(data) => console.log(data)} onLocalCacheSave={(data) => console.log(data)} onScreenChange={(data) => console.log(data)} onSlotChange={(data) => console.log(data)} onStepChange={(data) => console.log(data)} onSlotItemChange={(data) => console.log(data)} /> ) : ( Safecam Capture Start )} ); }; const styles = StyleSheet.create({ root: { width: "100%", height: "100%", flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "red", position: "relative", }, container: { width: "100%", height: "100%", backgroundColor: "white", flex: 1, alignItems: "center", justifyContent: "center", }, formLabel: { fontSize: 20, color: "#000000", }, buttonStyle: { marginTop: 30, width: 100, height: 50, paddingHorizontal: 10, borderRadius: 10, backgroundColor: "#ff8400", alignItems: "center", justifyContent: "center", }, buttonTestStyle: { fontSize: 17, alignItems: "center", justifyContent: "center", color: "#fff", }, inputStyle: { marginTop: 30, width: 300, height: 40, paddingHorizontal: 20, borderRadius: 10, color: "#000000", backgroundColor: "#ffffff", borderColor: "black", borderWidth: 1, }, formText: { alignItems: "center", justifyContent: "center", color: "#000000", fontSize: 20, }, text: { color: "#fff", fontSize: 20, }, }); export default App;