feat: allows width and height to be passed through as props

This commit is contained in:
Mark Mankarious 2023-03-23 22:35:48 +00:00
parent c83452b3cb
commit f1f9c0f92b

View file

@ -12,9 +12,11 @@ import { useGlobalState } from "./hooks/useGlobalState";
interface Props { interface Props {
initialScene: SceneI; initialScene: SceneI;
width?: number | string;
height: number | string;
} }
const App = ({ initialScene }: Props) => { const App = ({ initialScene, width, height }: Props) => {
const setInitialScene = useGlobalState((state) => state.setInitialScene); const setInitialScene = useGlobalState((state) => state.setInitialScene);
useEffect(() => { useEffect(() => {
@ -26,8 +28,8 @@ const App = ({ initialScene }: Props) => {
<ModeManagerProvider> <ModeManagerProvider>
<Box <Box
sx={{ sx={{
width: "100%", width: width ?? "100%",
height: "100%", height,
position: "relative", position: "relative",
overflow: "hidden", overflow: "hidden",
}} }}