From 01e88b380750a9ff647adb2d5f0ad66d0473cff7 Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Wed, 11 May 2022 19:44:08 +0530 Subject: [PATCH] Allow deletion of a disabled event (#2737) * allows deletion of disabled event * some visual fixes Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/pages/event-types/index.tsx | 88 ++++++++++++++++++---------- 1 file changed, 56 insertions(+), 32 deletions(-) diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index 69846ff3..8b1b077a 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -78,7 +78,10 @@ const Item = ({ type, group, readOnly }: any) => { return ( ( - - {types.length > 1 && ( + + {types.length > 1 && !type.$disabled && ( <> 1 && ( ({ @@ -247,28 +252,38 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL }))} /> )} - - - - - + + + + + + - - { - showToast(t("link_copied"), "success"); - navigator.clipboard.writeText( - `${process.env.NEXT_PUBLIC_WEBSITE_URL}/${group.profile.slug}/${type.slug}` - ); - }} - className="btn-icon"> - - - + + { + showToast(t("link_copied"), "success"); + navigator.clipboard.writeText( + `${process.env.NEXT_PUBLIC_WEBSITE_URL}/${group.profile.slug}/${type.slug}` + ); + }} + className={classNames("btn-icon", type.$disabled && " opacity-30")}> + + + + {" "} {t("edit")} @@ -294,7 +312,10 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL type="button" color="minimal" size="sm" - className="w-full rounded-none" + className={classNames( + "w-full rounded-none", + type.$disabled && " pointer-events-none cursor-not-allowed opacity-30" + )} data-testid={"event-type-duplicate-" + type.id} StartIcon={DuplicateIcon} onClick={() => openModal(group, type)}> @@ -304,7 +325,10 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL