diff --git a/components/Settings.tsx b/components/Settings.tsx index 5a7042f9..480e0757 100644 --- a/components/Settings.tsx +++ b/components/Settings.tsx @@ -1,6 +1,6 @@ import Link from 'next/link'; import { useRouter } from "next/router"; -import { UserCircleIcon, KeyIcon } from '@heroicons/react/outline'; +import { UserCircleIcon, KeyIcon, CodeIcon } from '@heroicons/react/outline'; export default function SettingsShell(props) { const router = useRouter(); @@ -42,6 +42,15 @@ export default function SettingsShell(props) { + + + + + Embed + + + + {/* diff --git a/pages/settings/embed.tsx b/pages/settings/embed.tsx new file mode 100644 index 00000000..3a0dd092 --- /dev/null +++ b/pages/settings/embed.tsx @@ -0,0 +1,103 @@ +import Head from 'next/head'; +import Link from 'next/link'; +import { useState } from 'react'; +import { useRouter } from 'next/router'; +import prisma from '../../lib/prisma'; +import Modal from '../../components/Modal'; +import Shell from '../../components/Shell'; +import SettingsShell from '../../components/Settings'; +import Avatar from '../../components/Avatar'; +import { signIn, useSession, getSession } from 'next-auth/client'; +import TimezoneSelect from 'react-timezone-select'; + +export default function Embed(props) { + const [ session, loading ] = useSession(); + const router = useRouter(); + + if (loading) { + return Loading...; + } + + return( + + + Embed | Calendso + + + + + + Iframe Embed + + The easiest way to embed Calendso on your website. + + + + + + Standard iframe + + + '} + readOnly + /> + + + + + Responsive full screen iframe + + + Schedule a meeting'} + readOnly + /> + + + + + Calendso API + + Leverage our API for full control and customizability. + + + Browse our API documentation + + + + ); +} + +export async function getServerSideProps(context) { + const session = await getSession(context); + if (!session) { + return { redirect: { permanent: false, destination: '/auth/login' } }; + } + + const user = await prisma.user.findFirst({ + where: { + email: session.user.email, + }, + select: { + id: true, + username: true, + name: true, + email: true, + bio: true, + avatar: true, + timeZone: true, + weekStart: true, + } + }); + + return { + props: {user}, // will be passed to the page component as props + } +} \ No newline at end of file
Loading...
+ The easiest way to embed Calendso on your website. +
+ Leverage our API for full control and customizability. +