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
This commit is contained in:
sean-brydon authored and GitHub committed 2023-05-11 13:20:39 +00:00
1 parent 738e0f3e50
commit bdf3e34ea1
11 files changed
+177 -30

No files matched your search

+2 -2
View File
@@ -56,8 +56,7 @@ export const EventTypeCustomInputType = {
PHONE: "PHONE",
} as const;
export type EventTypeCustomInputType =
(typeof EventTypeCustomInputType)[keyof typeof EventTypeCustomInputType];
export type EventTypeCustomInputType = (typeof EventTypeCustomInputType)[keyof typeof EventTypeCustomInputType];
export const ReminderType = {
PENDING_BOOKING_CONFIRMATION: "PENDING_BOOKING_CONFIRMATION",
@@ -78,6 +77,7 @@ export const WebhookTriggerEvents = {
BOOKING_CANCELLED: "BOOKING_CANCELLED",
FORM_SUBMITTED: "FORM_SUBMITTED",
MEETING_ENDED: "MEETING_ENDED",
RECORDING_READY: "RECORDING_READY",
} as const;
export type WebhookTriggerEvents = (typeof WebhookTriggerEvents)[keyof typeof WebhookTriggerEvents];
+1 -1
View File
@@ -1,6 +1,6 @@
const StepCard: React.FC<{ children: React.ReactNode }> = (props) => {
return (
<div className="border-subtle bg-default mt-10 rounded-md border p-4 dark:bg-black sm:p-8">
<div className="border-subtle bg-default mt-10 rounded-md border p-4 dark:bg-black sm:p-8">
{props.children}
</div>
);
@@ -0,0 +1,43 @@
import type { CSSProperties, PropsWithChildren } from "react";
import React, { useRef, useEffect, useState } from "react";
import { classNames } from "@calcom/lib";
const ScrollableArea = ({ children, className }: PropsWithChildren<{ className?: string }>) => {
const scrollableRef = useRef<HTMLDivElement>(null);
const [isOverflowingY, setIsOverflowingY] = useState(false);
useEffect(() => {
const scrollableElement = scrollableRef.current;
if (scrollableElement) {
const isElementOverflowing = scrollableElement.scrollHeight > scrollableElement.clientHeight;
console.log({ isElementOverflowing });
setIsOverflowingY(isElementOverflowing);
}
}, []);
const overflowIndicatorStyles = {
position: "absolute",
top: 0,
width: "100%",
height: "30px",
background: "linear-gradient(to bottom, transparent, gray 40px)",
zIndex: 10,
} as CSSProperties;
return (
<div
ref={scrollableRef}
className={classNames(
"scroll-bar overflow-y-scroll ",
isOverflowingY && " relative ",
className // Pass in your max-w / max-h
)}>
{children}
{isOverflowingY && <div style={overflowIndicatorStyles} />}
</div>
);
};
export { ScrollableArea };
+1
View File
@@ -131,3 +131,4 @@ export { default as ImageUploader } from "./components/image-uploader/ImageUploa
export type { ButtonColor } from "./components/button/Button";
export { CreateButton } from "./components/createButton";
export { useCalcomTheme } from "./styles/useCalcomTheme";
export { ScrollableArea } from "./components/scrollable/ScrollableArea";