From c754a52d88612ae78911f9654d0f1d439717a715 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 25 Nov 2023 00:25:22 -0600 Subject: [PATCH] Gameboy: add download button --- src/components/gameboy.tsx | 55 ++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/components/gameboy.tsx b/src/components/gameboy.tsx index bc8197fd1c..946d056e8e 100644 --- a/src/components/gameboy.tsx +++ b/src/components/gameboy.tsx @@ -5,7 +5,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import { exitFullscreen, isFullscreen, requestFullscreen } from 'soapbox/features/ui/util/fullscreen'; -import { IconButton } from './ui'; +import { HStack, IconButton } from './ui'; let gainNode: GainNode | undefined; @@ -77,6 +77,10 @@ const Gameboy: React.FC = ({ className, src, aspect = 'normal', onFocu } }; + const handleDownload = () => { + window.open(src); + }; + useEffect(() => { init(); @@ -123,27 +127,38 @@ const Gameboy: React.FC = ({ className, src, aspect = 'normal', onFocu {...rest} /> -
- - - -
+ + + + + + + + + + ); };