From bdf3e34ea11d96b5379ffa3aae9dc7fd74c044b9 Mon Sep 17 00:00:00 2001
From: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Date: Thu, 11 May 2023 14:20:39 +0100
Subject: [PATCH] Feat/onboarding video step connection (#8838)
* UI work - WIP scrollable area
* Add translations - refactor some components
* Add installed text
* Disable if there is no currently installed
* Extract loader
* Fix conditional
* Fix E2E
* fix typo
---
...CalendarItem.tsx => AppConnectionItem.tsx} | 12 ++--
.../components/StepConnectionLoader.tsx | 17 +++++
.../steps-views/ConnectCalendars.tsx | 24 ++-----
.../steps-views/ConnectedVideoStep.tsx | 68 +++++++++++++++++++
.../web/pages/getting-started/[[...step]].tsx | 21 +++++-
apps/web/playwright/onboarding.e2e.ts | 13 +++-
apps/web/public/static/locales/en/common.json | 2 +
packages/prisma/enums/index.ts | 4 +-
packages/ui/components/card/StepCard.tsx | 2 +-
.../components/scrollable/ScrollableArea.tsx | 43 ++++++++++++
packages/ui/index.tsx | 1 +
11 files changed, 177 insertions(+), 30 deletions(-)
rename apps/web/components/getting-started/components/{CalendarItem.tsx => AppConnectionItem.tsx} (80%)
create mode 100644 apps/web/components/getting-started/components/StepConnectionLoader.tsx
create mode 100644 apps/web/components/getting-started/steps-views/ConnectedVideoStep.tsx
create mode 100644 packages/ui/components/scrollable/ScrollableArea.tsx
diff --git a/apps/web/components/getting-started/components/CalendarItem.tsx b/apps/web/components/getting-started/components/AppConnectionItem.tsx
similarity index 80%
rename from apps/web/components/getting-started/components/CalendarItem.tsx
rename to apps/web/components/getting-started/components/AppConnectionItem.tsx
index f04c503877..48358a189c 100644
--- a/apps/web/components/getting-started/components/CalendarItem.tsx
+++ b/apps/web/components/getting-started/components/AppConnectionItem.tsx
@@ -3,15 +3,16 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { App } from "@calcom/types/App";
import { Button } from "@calcom/ui";
-interface ICalendarItem {
+interface IAppConnectionItem {
title: string;
description?: string;
logo: string;
type: App["type"];
+ installed?: boolean;
}
-const CalendarItem = (props: ICalendarItem) => {
- const { title, logo, type } = props;
+const AppConnectionItem = (props: IAppConnectionItem) => {
+ const { title, logo, type, installed } = props;
const { t } = useLocale();
return (
@@ -25,13 +26,14 @@ const CalendarItem = (props: ICalendarItem) => {
)}
/>
@@ -39,4 +41,4 @@ const CalendarItem = (props: ICalendarItem) => {
);
};
-export { CalendarItem };
+export { AppConnectionItem };
diff --git a/apps/web/components/getting-started/components/StepConnectionLoader.tsx b/apps/web/components/getting-started/components/StepConnectionLoader.tsx
new file mode 100644
index 0000000000..64dae1e62a
--- /dev/null
+++ b/apps/web/components/getting-started/components/StepConnectionLoader.tsx
@@ -0,0 +1,17 @@
+import { SkeletonAvatar, SkeletonText, SkeletonButton } from "@calcom/ui";
+
+export function StepConnectionLoader() {
+ return (
+
+ {Array.from({ length: 4 }).map((_item, index) => {
+ return (
+ -
+
+
+
+
+ );
+ })}
+
+ );
+}
diff --git a/apps/web/components/getting-started/steps-views/ConnectCalendars.tsx b/apps/web/components/getting-started/steps-views/ConnectCalendars.tsx
index d1d7196899..d2e91f7c09 100644
--- a/apps/web/components/getting-started/steps-views/ConnectCalendars.tsx
+++ b/apps/web/components/getting-started/steps-views/ConnectCalendars.tsx
@@ -3,11 +3,12 @@ import { ArrowRightIcon } from "@heroicons/react/solid";
import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
-import { SkeletonAvatar, SkeletonText, SkeletonButton, List } from "@calcom/ui";
+import { List } from "@calcom/ui";
-import { CalendarItem } from "../components/CalendarItem";
+import { AppConnectionItem } from "../components/AppConnectionItem";
import { ConnectedCalendarItem } from "../components/ConnectedCalendarItem";
import { CreateEventsOnCalendarSelect } from "../components/CreateEventsOnCalendarSelect";
+import { StepConnectionLoader } from "../components/StepConnectionLoader";
interface IConnectCalendarsProps {
nextStep: () => void;
@@ -33,7 +34,7 @@ const ConnectedCalendars = (props: IConnectCalendarsProps) => {
firstCalendar.integration.title &&
firstCalendar.integration.logo && (
<>
-
+
{
queryIntegrations.data.items.map((item) => (
{item.title && item.logo && (
- {
)}
- {queryIntegrations.isLoading && (
-
- {[0, 0, 0, 0].map((_item, index) => {
- return (
- -
-
-
-
-
- );
- })}
-
- )}
+ {queryIntegrations.isLoading && }
+