From 898c83d1addfa0f19ac389c71b3688f309027251 Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Mon, 5 Sep 2022 17:15:26 +0200 Subject: [PATCH] added new VerticalDivider, using it in Event-types, fixed padding in app store (#4165) * added new VerticalDivider, using it in Event-types * fixed event-type app store empty screen padding and workflows padding * centered emtpyscreen description * made empty screen button secondary on app store * fixed hide from profile on mobile * squared dropdown on event-types --- .../components/v2/eventtype/EventAppsTab.tsx | 22 ++++++++------- .../v2/eventtype/EventTypeSingleLayout.tsx | 28 +++++++++++++------ apps/web/pages/v2/event-types/index.tsx | 22 ++++++++------- apps/web/public/static/locales/en/common.json | 3 +- .../components/v2/EventWorkflowsTab.tsx | 2 +- packages/ui/v2/core/EmptyScreen.tsx | 2 +- packages/ui/v2/core/VerticalDivider.tsx | 17 +++++++++++ 7 files changed, 64 insertions(+), 32 deletions(-) create mode 100644 packages/ui/v2/core/VerticalDivider.tsx diff --git a/apps/web/components/v2/eventtype/EventAppsTab.tsx b/apps/web/components/v2/eventtype/EventAppsTab.tsx index a2ddc83461..1e22aa17ff 100644 --- a/apps/web/components/v2/eventtype/EventAppsTab.tsx +++ b/apps/web/components/v2/eventtype/EventAppsTab.tsx @@ -75,16 +75,18 @@ export const EventAppsTab = ({ if (installedApps === 0) { return ( - - {t("empty_installed_apps_button")}{" "} - - } - /> +
+ + {t("empty_installed_apps_button")}{" "} + + } + /> +
); } return ( diff --git a/apps/web/components/v2/eventtype/EventTypeSingleLayout.tsx b/apps/web/components/v2/eventtype/EventTypeSingleLayout.tsx index e24d0e22f3..ee1d1e069e 100644 --- a/apps/web/components/v2/eventtype/EventTypeSingleLayout.tsx +++ b/apps/web/components/v2/eventtype/EventTypeSingleLayout.tsx @@ -20,6 +20,7 @@ import { VerticalTabs, HorizontalTabs, Switch, + Label, } from "@calcom/ui/v2"; import { Dialog } from "@calcom/ui/v2/core/Dialog"; import Dropdown, { @@ -28,6 +29,7 @@ import Dropdown, { DropdownMenuTrigger, } from "@calcom/ui/v2/core/Dropdown"; import Shell from "@calcom/ui/v2/core/Shell"; +import VerticalDivider from "@calcom/ui/v2/core/VerticalDivider"; import { ClientSuspense } from "@components/ClientSuspense"; @@ -113,13 +115,13 @@ function EventTypeSingleLayout({ name: "apps", tabName: "apps", icon: Icon.FiGrid, - info: `${enabledAppsNumber} Active`, + info: `${enabledAppsNumber} ${t("active")}`, }, { name: "workflows", tabName: "workflows", icon: Icon.FiZap, - info: `${enabledWorkflowsNumber} Active`, + info: `${enabledWorkflowsNumber} ${t("active")}`, }, ] as VerticalTabItemProps[]; @@ -157,17 +159,22 @@ function EventTypeSingleLayout({ subtitle={eventType.description || ""} CTA={
-
-

{t("hide_from_profile")}

+
+ { formMethods.setValue("hidden", e); }} />
+ + {/* TODO: Figure out why combined isnt working - works in storybook */} -
}> }> -
+
@@ -251,8 +261,8 @@ function EventTypeSingleLayout({
{children}
diff --git a/apps/web/pages/v2/event-types/index.tsx b/apps/web/pages/v2/event-types/index.tsx index 784ae186fc..c145dabc9e 100644 --- a/apps/web/pages/v2/event-types/index.tsx +++ b/apps/web/pages/v2/event-types/index.tsx @@ -20,6 +20,7 @@ import Dropdown, { DropdownMenuTrigger, } from "@calcom/ui/v2/core/Dropdown"; import Shell from "@calcom/ui/v2/core/Shell"; +import VerticalDivider from "@calcom/ui/v2/core/VerticalDivider"; import CreateEventTypeButton from "@calcom/ui/v2/modules/event-types/CreateEventType"; import { withQuery } from "@lib/QueryCell"; @@ -291,18 +292,19 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL type.$disabled && "pointer-events-none cursor-not-allowed" )}> -
-
- { - setHiddenMutation.mutate({ id: type.id, hidden: !type.hidden }); - }} - /> -
+
+ { + setHiddenMutation.mutate({ id: type.id, hidden: !type.hidden }); + }} + />
+ + + } diff --git a/packages/ui/v2/core/VerticalDivider.tsx b/packages/ui/v2/core/VerticalDivider.tsx new file mode 100644 index 0000000000..ff34b57d86 --- /dev/null +++ b/packages/ui/v2/core/VerticalDivider.tsx @@ -0,0 +1,17 @@ +import { classNames } from "@calcom/lib"; + +export default function VerticalDivider({ className, ...props }: JSX.IntrinsicElements["svg"]) { + className = classNames(className, "mx-3"); + return ( + + + + ); +}