Skip to content

Commit

Permalink
fix: don't display setup page icon for these apps (#13537)
Browse files Browse the repository at this point in the history
* fix: don't display setup page icon for these apps

* chore: make it optional

* chore: feedback

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
  • Loading branch information
Udit-takkar and keithwillcode committed Feb 6, 2024
1 parent 3e492eb commit f09153b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/app-store/_components/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function AppCard({
teamId,
disableSwitch,
switchTooltip,
hideSettingsIcon = false,
}: {
app: RouterOutputs["viewer"]["integrations"]["items"][number] & { credentialOwner?: CredentialOwner };
description?: React.ReactNode;
Expand All @@ -32,6 +33,7 @@ export default function AppCard({
LockedIcon?: React.ReactNode;
disableSwitch?: boolean;
switchTooltip?: string;
hideSettingsIcon?: boolean;
}) {
const { t } = useTranslation();
const [animationRef] = useAutoAnimate<HTMLDivElement>();
Expand Down Expand Up @@ -124,9 +126,11 @@ export default function AppCard({
{app?.isInstalled && switchChecked ? (
app.isSetupAlready === undefined || app.isSetupAlready ? (
<div className="relative p-4 pt-5 text-sm [&_input]:mb-0 [&_input]:leading-4">
<Link href={`/apps/${app.slug}/setup`} className="absolute right-4 top-4">
<Settings className="text-default h-4 w-4" aria-hidden="true" />
</Link>
{!hideSettingsIcon && (
<Link href={`/apps/${app.slug}/setup`} className="absolute right-4 top-4">
<Settings className="text-default h-4 w-4" aria-hidden="true" />
</Link>
)}
{children}
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({

return (
<AppCard
hideSettingsIcon
app={app}
switchOnClick={(e) => {
updateEnabled(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({

return (
<AppCard
hideSettingsIcon
app={app}
switchOnClick={(e) => {
updateEnabled(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({

return (
<AppCard
hideSettingsIcon
app={app}
switchOnClick={(e) => {
updateEnabled(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({

return (
<AppCard
hideSettingsIcon
app={app}
switchOnClick={(e) => {
updateEnabled(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({

return (
<AppCard
hideSettingsIcon
app={app}
switchOnClick={updateEnabled}
switchChecked={enabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({

return (
<AppCard
hideSettingsIcon
app={app}
switchOnClick={(e) => {
updateEnabled(e);
Expand Down

0 comments on commit f09153b

Please sign in to comment.