diff --git a/src/Home.tsx b/src/Home.tsx index 650c86c..04824ce 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -5,12 +5,13 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faBurn } from "@fortawesome/free-solid-svg-icons/faBurn"; import { faQrcode } from "@fortawesome/free-solid-svg-icons/faQrcode"; import Logo from "./Logo"; -import CameraScanner from "./search/CameraScanner"; import Timestamp from "./components/Timestamp"; import { RuntimeContext } from "./useRuntime"; import { useLatestBlock } from "./useLatestBlock"; import { blockURL } from "./url"; +const CameraScanner = React.lazy(() => import("./search/CameraScanner")); + const Home: React.FC = () => { const { provider } = useContext(RuntimeContext); const [search, setSearch] = useState(); diff --git a/src/Title.tsx b/src/Title.tsx index e4c5f47..e132443 100644 --- a/src/Title.tsx +++ b/src/Title.tsx @@ -4,10 +4,11 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faQrcode } from "@fortawesome/free-solid-svg-icons/faQrcode"; import useKeyboardShortcut from "use-keyboard-shortcut"; import PriceBox from "./PriceBox"; -import CameraScanner from "./search/CameraScanner"; import SourcifyMenu from "./SourcifyMenu"; import { RuntimeContext } from "./useRuntime"; +const CameraScanner = React.lazy(() => import("./search/CameraScanner")); + const Title: React.FC = () => { const { provider } = useContext(RuntimeContext); const [search, setSearch] = useState();