From 8ee109e975ee56b58945ff1452c92c15031d4ac3 Mon Sep 17 00:00:00 2001 From: Nafees Nazik <84864519+G3root@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:32:01 +0530 Subject: [PATCH] fix: app list item ui issues in `/settings/my-account/conferencing` (#6565) * fix: border color * fix: padding and title line-height * feat: add app-list card * feat: use the AppListCard component * nit: remove unused imports --- apps/web/components/AppListCard.tsx | 35 +++++++++++++++++++ .../settings/my-account/conferencing.tsx | 28 ++++++--------- .../settings/layouts/SettingsLayout.tsx | 6 ++-- packages/ui/components/list/List.tsx | 2 +- 4 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 apps/web/components/AppListCard.tsx diff --git a/apps/web/components/AppListCard.tsx b/apps/web/components/AppListCard.tsx new file mode 100644 index 0000000000..286a95ba49 --- /dev/null +++ b/apps/web/components/AppListCard.tsx @@ -0,0 +1,35 @@ +import { ReactNode } from "react"; + +import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { Badge, ListItemText } from "@calcom/ui"; + +interface AppListCardProps { + logo?: string; + title: string; + description: string; + actions?: ReactNode; + isDefault?: boolean; +} + +export default function AppListCard(props: AppListCardProps) { + const { t } = useLocale(); + const { logo, title, description, actions, isDefault } = props; + + return ( +
+
+ {logo ? {`${title} : null} + +
+
+

{title}

+ {isDefault ? {t("default")} : null} +
+ {description} +
+ + {actions} +
+
+ ); +} diff --git a/apps/web/pages/settings/my-account/conferencing.tsx b/apps/web/pages/settings/my-account/conferencing.tsx index 02ed369f60..386d2b579d 100644 --- a/apps/web/pages/settings/my-account/conferencing.tsx +++ b/apps/web/pages/settings/my-account/conferencing.tsx @@ -17,15 +17,14 @@ import { DropdownMenuTrigger, Icon, List, - ListItem, - ListItemText, - ListItemTitle, Meta, showToast, SkeletonContainer, SkeletonText, } from "@calcom/ui"; +import AppListCard from "@components/AppListCard"; + import { ssrInit } from "@server/lib/ssr"; const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { @@ -76,18 +75,13 @@ const ConferencingLayout = () => { apps.items .map((app) => ({ ...app, title: app.title || app.name })) .map((app) => ( - -
- { - // eslint-disable-next-line @next/next/no-img-element - app.logo && {app.title} - } -
- -

{app.title}

-
- {app.description} -
+ @@ -110,8 +104,8 @@ const ConferencingLayout = () => {
- -
+ } + /> ))} diff --git a/packages/features/settings/layouts/SettingsLayout.tsx b/packages/features/settings/layouts/SettingsLayout.tsx index 18f6c3a4ce..168060d0dc 100644 --- a/packages/features/settings/layouts/SettingsLayout.tsx +++ b/packages/features/settings/layouts/SettingsLayout.tsx @@ -423,7 +423,7 @@ function ShellHeader() { const { t, isLocaleReady } = useLocale(); return (
-
+
{meta.backButton && ( @@ -431,7 +431,9 @@ function ShellHeader() { )}
{meta.title && isLocaleReady ? ( -

{t(meta.title)}

+

+ {t(meta.title)} +

) : (
)} diff --git a/packages/ui/components/list/List.tsx b/packages/ui/components/list/List.tsx index cab007727a..89ee949f5c 100644 --- a/packages/ui/components/list/List.tsx +++ b/packages/ui/components/list/List.tsx @@ -17,7 +17,7 @@ export function List(props: ListProps) { "-mx-4 rounded-sm sm:mx-0 sm:overflow-hidden ", // Add rounded top and bottome if roundContainer is true props.roundContainer && "[&>*:first-child]:rounded-t-md [&>*:last-child]:rounded-b-md ", - !props.noBorderTreatment && "divide-y divide-neutral-200 rounded-md border border-l border-r ", + !props.noBorderTreatment && "divide-y divide-gray-200 rounded-md border border-l border-r ", props.className )}> {props.children}