From 30754398949c640f3157fb5083daa3be2a3d8691 Mon Sep 17 00:00:00 2001 From: Yijun Lin Date: Sat, 24 Jun 2023 13:36:17 -0500 Subject: [PATCH 01/39] style change for popup and asl video --- src/screens/Asl/components/AslTable/index.js | 15 +++-- .../Asl/components/AslTable/index.scss | 16 ++++- .../Watch/Components/CTPopup/CTPopup.jsx | 63 +++++++------------ .../Watch/Components/CTPopup/CTPopup.scss | 10 +-- 4 files changed, 50 insertions(+), 54 deletions(-) diff --git a/src/screens/Asl/components/AslTable/index.js b/src/screens/Asl/components/AslTable/index.js index a85b82727..debb14ecc 100644 --- a/src/screens/Asl/components/AslTable/index.js +++ b/src/screens/Asl/components/AslTable/index.js @@ -55,6 +55,7 @@ const AslTable = props => { const [onePage, setOnePage] = useState([]); const [showVideo, setShowVideo] = useState(false); const [videoUrl, setVideoUrl] = useState(''); + const [selectedTerm, setSelectedTerm] = useState(null); const [style, setStyle] = useState({ left: 100, top: 100, @@ -71,7 +72,7 @@ const AslTable = props => { }) const [isDown, setIsDown] = useState(false); const [direction, setDirection] = useState(''); - + useEffect(() => { const index = (pageNumber-1) * ONE_PAGE_NUM; setOnePage(items.filter(item => item.term.toLowerCase().includes(search.toLowerCase())).slice(index, index + ONE_PAGE_NUM)); @@ -117,7 +118,10 @@ const AslTable = props => { return 'Example' } - const handleVideo = (source, uniqueASLIdentifier) => { + const handleVideo = (term) => { + setSelectedTerm(term); + const source = term.source; + const uniqueASLIdentifier = term.uniqueASLIdentifier; const hostName = window.location.hostname; if (hostName !== '') { if (source === 'ASLCORE') { @@ -227,9 +231,10 @@ const AslTable = props => { onClick={() => setShowVideo(false)} >X - + {`${selectedTerm.term} (Source:${selectedTerm.source})`}