/** * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { useRef, useState, useEffect } from "react"; import "./App.scss"; import { LiveAPIProvider } from "./contexts/LiveAPIContext"; import SidePanel from "./components/side-panel/SidePanel"; import { P5Sketch } from "./components/p5/P5Sketch"; import ControlTray from "./components/control-tray/ControlTray"; import { IOSModal } from "./components/ios-modal/IOSModal"; import { isIOS } from "./lib/platform"; import cn from "classnames"; function App() { // this video reference is used for displaying the active stream, whether that is the webcam or screen capture // feel free to style as you see fit const videoRef = useRef(null); // either the screen capture, the video or null, if null we hide it const [videoStream, setVideoStream] = useState(null); const [showIOSModal, setShowIOSModal] = useState(false); useEffect(() => { // Only show the modal on iOS devices if (isIOS()) { setShowIOSModal(true); } }, []); return (
{/* APP goes here */}
setShowIOSModal(false)} />
); } export default App;