Added integration to UI

pull/277/head
nicolas 2021-06-11 02:29:43 +02:00
parent a9a569f876
commit 00f19bd654
1 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,6 @@ import {InformationCircleIcon} from '@heroicons/react/outline';
export default function Home({ integrations }) { export default function Home({ integrations }) {
const [session, loading] = useSession(); const [session, loading] = useSession();
const [showAddModal, setShowAddModal] = useState(false); const [showAddModal, setShowAddModal] = useState(false);
if (loading) { if (loading) {
return <p className="text-gray-400">Loading...</p>; return <p className="text-gray-400">Loading...</p>;
} }
@ -39,7 +38,7 @@ export default function Home({ integrations }) {
Add new integration Add new integration
</button> </button>
</div> </div>
<div className="bg-white shadow overflow-hidden rounded-lg"> <div className="bg-white shadow overflow-hidden rounded-lg">
{integrations.filter( (ig) => ig.credential ).length !== 0 ? <ul className="divide-y divide-gray-200"> {integrations.filter( (ig) => ig.credential ).length !== 0 ? <ul className="divide-y divide-gray-200">
{integrations.filter(ig => ig.credential).map( (ig) => (<li> {integrations.filter(ig => ig.credential).map( (ig) => (<li>
<Link href={"/integrations/" + ig.credential.id}> <Link href={"/integrations/" + ig.credential.id}>
@ -220,6 +219,13 @@ export async function getServerSideProps(context) {
title: "Office 365 / Outlook.com Calendar", title: "Office 365 / Outlook.com Calendar",
imageSrc: "integrations/office-365.png", imageSrc: "integrations/office-365.png",
description: "For personal and business accounts", 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,
title: "Zoom",
imageSrc: "integrations/zoom.png",
description: "For personal and business accounts",
} ]; } ];
return { return {