From 760a112c3bb74abc1961ddff1f8730a16b15ebe2 Mon Sep 17 00:00:00 2001 From: Pico2x Date: Fri, 26 Aug 2022 12:10:14 +0100 Subject: [PATCH] Added a create-dashboard and sharable view dashboard page --- web/components/share-dashboard-modal.tsx | 46 ++++++++++ web/lib/firebase/dashboards.ts | 18 +++- web/pages/create-dashboard.tsx | 94 ++++++++++++++++++++ web/pages/dashboard/[...slugs]/index.tsx | 107 +++++++++++++++++++++++ 4 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 web/components/share-dashboard-modal.tsx create mode 100644 web/pages/create-dashboard.tsx create mode 100644 web/pages/dashboard/[...slugs]/index.tsx diff --git a/web/components/share-dashboard-modal.tsx b/web/components/share-dashboard-modal.tsx new file mode 100644 index 00000000..c52f372c --- /dev/null +++ b/web/components/share-dashboard-modal.tsx @@ -0,0 +1,46 @@ +import { LinkIcon } from '@heroicons/react/outline' +import toast from 'react-hot-toast' +import { copyToClipboard } from 'web/lib/util/copy' +import { track } from 'web/lib/service/analytics' +import { Modal } from './layout/modal' +import { Col } from './layout/col' +import { Title } from './title' +import { Button } from './button' +import { TweetButton } from './tweet-button' +import { Row } from './layout/row' + +export function ShareDashboardModal(props: { + shareUrl: string + isOpen: boolean + setOpen: (open: boolean) => void +}) { + const { isOpen, setOpen, shareUrl } = props + + const linkIcon =