From 0bb4678bf7cecc4da499654fbfa96c82d7257064 Mon Sep 17 00:00:00 2001 From: nicolas Date: Sun, 13 Jun 2021 13:59:40 +0200 Subject: [PATCH] Added subtitle to zoom integrations --- lib/integrations.ts | 2 +- pages/api/integrations/zoom/callback.ts | 2 +- pages/index.tsx | 9 ++++++--- pages/integrations/index.tsx | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/integrations.ts b/lib/integrations.ts index 24ae0954..3f71dd2f 100644 --- a/lib/integrations.ts +++ b/lib/integrations.ts @@ -4,7 +4,7 @@ export function getIntegrationName(name: String) { return "Google Calendar"; case "office365_calendar": return "Office 365 Calendar"; - case "zoom": + case "zoom_video": return "Zoom"; default: return "Unknown"; diff --git a/pages/api/integrations/zoom/callback.ts b/pages/api/integrations/zoom/callback.ts index 29c6c32c..8f8b0abf 100644 --- a/pages/api/integrations/zoom/callback.ts +++ b/pages/api/integrations/zoom/callback.ts @@ -27,7 +27,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) await prisma.credential.create({ data: { - type: 'zoom', + type: 'zoom_video', key: result, userId: session.user.id } diff --git a/pages/index.tsx b/pages/index.tsx index 401d2fd7..b83f93e3 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -2,8 +2,8 @@ import Head from 'next/head'; import Link from 'next/link'; import prisma from '../lib/prisma'; import Shell from '../components/Shell'; -import { signIn, useSession, getSession } from 'next-auth/client'; -import { ClockIcon, CheckIcon, InformationCircleIcon } from '@heroicons/react/outline'; +import {getSession, useSession} from 'next-auth/client'; +import {CheckIcon, ClockIcon, InformationCircleIcon} from '@heroicons/react/outline'; import DonateBanner from '../components/DonateBanner'; function classNames(...classes) { @@ -206,10 +206,13 @@ export default function Home(props) {
  • {integration.type == 'google_calendar' && Google Calendar} {integration.type == 'office365_calendar' && Office 365 / Outlook.com Calendar} + {integration.type == 'zoom_video' && Zoom}
    {integration.type == 'office365_calendar' &&

    Office 365 / Outlook.com Calendar

    } {integration.type == 'google_calendar' &&

    Google Calendar

    } -

    Calendar Integration

    + {integration.type == 'zoom_video' &&

    Zoom

    } + {integration.type.endsWith('_calendar') &&

    Calendar Integration

    } + {integration.type.endsWith('_video') &&

    Video Conferencing

    }
  • )} diff --git a/pages/integrations/index.tsx b/pages/integrations/index.tsx index 0bc98b09..3596cba1 100644 --- a/pages/integrations/index.tsx +++ b/pages/integrations/index.tsx @@ -53,6 +53,7 @@ export default function Home({ integrations }) {

    {ig.title}

    {ig.type.endsWith('_calendar') && Calendar Integration} + {ig.type.endsWith('_video') && Video Conferencing}

    @@ -221,8 +222,8 @@ export async function getServerSideProps(context) { description: "For personal and business accounts", }, { installed: !!(process.env.ZOOM_CLIENT_ID && process.env.ZOOM_CLIENT_SECRET), - type: "zoom", - credential: credentials.find( (integration) => integration.type === "zoom" ) || null, + type: "zoom_video", + credential: credentials.find( (integration) => integration.type === "zoom_video" ) || null, title: "Zoom", imageSrc: "integrations/zoom.png", description: "For personal and business accounts",