From b8eff3e46b0542600583050af5ddb45f19b83927 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 24 Apr 2022 18:07:20 -0500 Subject: [PATCH] VideoModal: convert to TSX --- .../features/ui/components/video_modal.js | Bin 1608 -> 0 bytes .../features/ui/components/video_modal.tsx | 51 ++++++++++++++++++ 2 files changed, 51 insertions(+) delete mode 100644 app/soapbox/features/ui/components/video_modal.js create mode 100644 app/soapbox/features/ui/components/video_modal.tsx diff --git a/app/soapbox/features/ui/components/video_modal.js b/app/soapbox/features/ui/components/video_modal.js deleted file mode 100644 index 066aa9d796f3bbc101a22a5a93b39d17f92f6b19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1608 zcmah|!EW0y487+oIH0H#AhvgIqo6>C0mIN?=!#xb#b#=4w&h85+QQAhkCNpkPFn0D zh~yLX_(-a%(T3os(aqgUgBCVMR}eL9$K)K*zlHh9p$0RGIwcyj- z=vEQ17@t}Q|5HEQh~0()+z0OItCQ_Ws_0n`Sjn5dC@cIgvR7jGI*(`hk>}w2ec^bd;EuGH#gmCah5^71B))v!;^y;h& zT#`qmX~YIavt8O~OEx|0`fl_wm2>1FB;C2vUFC)c1I=`xF;wcCK0hva4z3?_2+E(- z?*-^nl&W?j_5_>)gJyhPNGJ?$#E4#NO6KQNv;LygzOQIf5~ zrxjBmp7{vEc7!bz(LG1uEt)PDsa*O2a6<5c)iCun04#E~1;0o?WQ8KC+#Ycul@ofo-pPVlXI6-MxN*_uMyVuT-@EZGQbO*X>4 zlaE_s=#Kly8uK}RA3Ezvi!NAWi0iEA+&T8=JkhGee8fkVG~$z^&5UYD>3U2(-HWzJ QS^L2}F#PE9(C#Mx0FFfoLjV8( diff --git a/app/soapbox/features/ui/components/video_modal.tsx b/app/soapbox/features/ui/components/video_modal.tsx new file mode 100644 index 0000000000..c703e51db4 --- /dev/null +++ b/app/soapbox/features/ui/components/video_modal.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import { FormattedMessage } from 'react-intl'; +import { useHistory } from 'react-router-dom'; + +import Video from 'soapbox/features/video'; + +import type { Status, Account, Attachment } from 'soapbox/types/entities'; + +interface IVideoModal { + media: Attachment, + status: Status, + account: Account, + time: number, + onClose: () => void, +} + +const VideoModal: React.FC = ({ status, account, media, time, onClose }) => { + const history = useHistory(); + + const handleStatusClick: React.MouseEventHandler = e => { + if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { + e.preventDefault(); + history.push(`/@${account.acct}/posts/${status.id}`); + } + }; + + const link = status && account && ( + + + + ); + + return ( +
+
+
+
+ ); +}; + +export default VideoModal;