diff --git a/src/components/pages/doc/modal/data.js b/src/components/pages/doc/modal/data.js index f130d8c391..5a97c65f0b 100644 --- a/src/components/pages/doc/modal/data.js +++ b/src/components/pages/doc/modal/data.js @@ -1,17 +1,17 @@ // pagesToShow - array of page titles and sections where the modal should be shown // 'Neon Docs' - show modal on the introduction page const MODALS = [ - // Example modal configuration: - // { - // id: 'slack', - // pagesToShow: ['Neon Docs'], - // title: 'Manage Neon in Slack', - // description: 'Get alerts, track usage, and manage your team right from Slack', - // link: { - // title: 'Get the Neon App for Slack', - // url: '/docs/manage/slack-app', - // }, - // }, + { + id: 'branching-video', + pagesToShow: ['Neon Docs'], + embedId: 'UuHnFlg66Io', + title: 'Watch: Git for databases', + description: 'See how Neon branching works in practice.', + link: { + title: 'Watch the video', + url: '/docs/introduction/branching', + }, + }, ]; export default MODALS; diff --git a/src/components/pages/doc/modal/modal.jsx b/src/components/pages/doc/modal/modal.jsx index c285d08a48..a7659be623 100644 --- a/src/components/pages/doc/modal/modal.jsx +++ b/src/components/pages/doc/modal/modal.jsx @@ -1,6 +1,7 @@ 'use client'; import { AnimatePresence, LazyMotion, domAnimation, m } from 'framer-motion'; +import Image from 'next/image'; import { PropTypes } from 'prop-types'; import { useState, useEffect } from 'react'; @@ -9,6 +10,7 @@ import useLocalStorage from 'hooks/use-local-storage'; import CloseIcon from 'icons/close-small.inline.svg'; // import SlackIcon from 'icons/docs/modal/slack.inline.svg'; import SupportIcon from 'icons/docs/modal/support.inline.svg'; +import PlayIcon from 'icons/play.inline.svg'; import { cn } from 'utils/cn'; import sendGtagEvent from 'utils/send-gtag-event'; @@ -17,7 +19,7 @@ const icons = { // slack: SlackIcon, }; -const Modal = ({ id, title, description, link }) => { +const Modal = ({ id, title, description, link, embedId }) => { const [closedModals, setClosedModals] = useLocalStorage('closedModals', []); const [isMounted, setIsMounted] = useState(false); @@ -38,7 +40,8 @@ const Modal = ({ id, title, description, link }) => { {isMounted && !isClosed && ( { animate={{ opacity: 1, transition: { delay: 3 } }} exit={{ opacity: 0, transition: { duration: 0.1 } }} > - {Icon && } + {embedId ? ( + { + sendGtagEvent('click_docs_modal_link', { + modal: id, + link: 'thumbnail', + }); + }} + > + + + + + + + + ) : ( + Icon && + )}

{title}

@@ -93,6 +124,7 @@ Modal.propTypes = { title: PropTypes.string.isRequired, url: PropTypes.string.isRequired, }).isRequired, + embedId: PropTypes.string, }; export default Modal;