Skip to content

Commit

Permalink
Fixes double bottom border in Integration List Item (#5026)
Browse files Browse the repository at this point in the history
* Fixes double bottom border in Integration List Item

* Remove unused import
  • Loading branch information
hariombalhara authored Oct 15, 2022
1 parent 2e83c7f commit 2d30f67
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
5 changes: 1 addition & 4 deletions apps/web/pages/v2/apps/installed/[category].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import z from "zod";
import { AppSettings } from "@calcom/app-store/_components/AppSettings";
import { InstallAppButton } from "@calcom/app-store/components";
import { InstalledAppVariants } from "@calcom/app-store/utils";
import { classNames } from "@calcom/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { inferQueryOutput, trpc } from "@calcom/trpc/react";
import { App } from "@calcom/types/App";
Expand Down Expand Up @@ -118,9 +117,7 @@ const IntegrationsList = ({ data }: IntegrationsListProps) => {
/>
</div>
}>
<div className="border-t border-gray-200">
<AppSettings slug={item.slug} />
</div>
<AppSettings slug={item.slug} />
</IntegrationListItem>
))}
</List>
Expand Down
6 changes: 5 additions & 1 deletion packages/app-store/_components/AppSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { DynamicComponent } from "./DynamicComponent";

export const AppSettings = (props: { slug: string }) => {
return (
<DynamicComponent<typeof AppSettingsComponentsMap> componentMap={AppSettingsComponentsMap} {...props} />
<DynamicComponent<typeof AppSettingsComponentsMap>
wrapperClassName="border-t border-gray-200"
componentMap={AppSettingsComponentsMap}
{...props}
/>
);
};
12 changes: 10 additions & 2 deletions packages/app-store/_components/DynamicComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
export function DynamicComponent<T extends Record<string, any>>(props: { componentMap: T; slug: string }) {
export function DynamicComponent<T extends Record<string, any>>(props: {
componentMap: T;
slug: string;
wrapperClassName?: string;
}) {
const { componentMap, slug, ...rest } = props;

if (!componentMap[slug]) return null;

const Component = componentMap[slug];

return <Component {...rest} />;
return (
<div className={props.wrapperClassName || ""}>
<Component {...rest} />
</div>
);
}

0 comments on commit 2d30f67

Please sign in to comment.