From d4ee073bfe39ea723dcf36fef4e74e7c1767eec5 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Wed, 16 Sep 2020 09:57:04 -0700 Subject: [PATCH] simplifying/clarifying youtube video code/datastructures (#10882) * simplifying/clarifying youtube video code/datastructures * adding role to clickable div --- docs/src/pages/resources.tsx | 52 +++++++++++++++--------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/docs/src/pages/resources.tsx b/docs/src/pages/resources.tsx index 7f7520956..1f71a9507 100644 --- a/docs/src/pages/resources.tsx +++ b/docs/src/pages/resources.tsx @@ -54,31 +54,20 @@ const installationLinks = [ ], ]; -const youtubeRefs = [ - 'https://www.youtube.com/embed/24XDOkGJrEY', - 'https://www.youtube.com/embed/AqousXQ7YHw', - 'https://www.youtube.com/embed/JGeIHrQYhIs', - 'https://www.youtube.com/embed/z350Gbi463I', -]; - -const youtubeIds = [ +const youtubeVideos = [ [ - 0, '24XDOkGJrEY', 'The history and anatomy of Apache Superset', ], [ - 1, 'AqousXQ7YHw', 'Apache Superset for visualization and for data science', ], [ - 2, 'JGeIHrQYhIs', 'Apache Superset- Interactive Multi Tab Multiple Dashboards Samples', ], [ - 3, 'z350Gbi463I', 'Apache Superset - Interactive Sales Dashboard (Demo 1)', ], @@ -104,7 +93,7 @@ const resourcesContainer = css` interface featureProps { title: string, - descr: Array, + links: string[][], } const LinkSection = ({ title, links }: featureProps) => (
@@ -126,11 +115,11 @@ const LinkSection = ({ title, links }: featureProps) => ( const Resources = () => { const [showModal, setModal] = useState(false); - const [url, setUrl] = useState(null); + const [videoId, setVideoId] = useState(null); const [cardTitle, setCardTitle] = useState(null); const handleClose = () => { setModal(false); - setUrl(null); + setVideoId(null); setCardTitle(null); }; return ( @@ -178,7 +167,7 @@ const Resources = () => {