From b9ce2b2c24db5dc336273f3f889be9d29a5d49fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Fri, 28 Oct 2022 20:34:10 +0100 Subject: [PATCH] feat: new fullscreen mode --- examples/web/react/components/display/display.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/web/react/components/display/display.tsx b/examples/web/react/components/display/display.tsx index 180ec558..102a09e5 100644 --- a/examples/web/react/components/display/display.tsx +++ b/examples/web/react/components/display/display.tsx @@ -22,6 +22,7 @@ type DisplayOptions = { type DisplayProps = { options?: DisplayOptions; size?: string; + fullscreen?: boolean, style?: string[]; onDrawHandler?: (caller: DrawHandler) => void; }; @@ -37,6 +38,7 @@ type CanvasContents = { export const Display: FC<DisplayProps> = ({ options = { width: 320, height: 288, logicWidth: 160, logicHeight: 144 }, size = "small", + fullscreen = false, style = [], onDrawHandler }) => { @@ -49,7 +51,7 @@ export const Display: FC<DisplayProps> = ({ } let canvasContents: CanvasContents | null = null; - const classes = () => ["display", size, ...style].join(" "); + const classes = () => ["display", fullscreen ? "fullscreen" : null, size, ...style].join(" "); const canvasRef = useRef<HTMLCanvasElement>(null); @@ -72,7 +74,7 @@ export const Display: FC<DisplayProps> = ({ return ( <div id="display" className={classes()}> - <span id="display-close" className="magnify-button canvas-close"> + <span id="display-close" className="magnify-button display-close"> <img className="large" src={require("./minimise.svg")} -- GitLab