diff --git a/src/apps/components/AppDetailsPage/Header.tsx b/src/apps/components/AppDetailsPage/Header.tsx index b71495c30..5530443b5 100644 --- a/src/apps/components/AppDetailsPage/Header.tsx +++ b/src/apps/components/AppDetailsPage/Header.tsx @@ -19,15 +19,25 @@ const Header: React.FC = ({ onAppDeactivateOpen, onAppDeleteOpen, }) => { - /** - * App is null with first render so fallback with HTML-safe fallback - */ - const backButtonTarget = data?.id ? AppUrls.resolveAppUrl(data.id) : "#"; + const getBackButtonUrl = () => { + /** + * App is null with first render so fallback with HTML-safe fallback + */ + if (!data?.id) { + return "#"; + } + + const isAppActive = data.isActive; + + return isAppActive + ? AppUrls.resolveAppUrl(data.id) + : AppUrls.resolveAppListUrl(); + }; return ( <> {data?.name} {!data?.isActive && } diff --git a/src/apps/components/InstalledAppListRow/InstalledAppListRow.tsx b/src/apps/components/InstalledAppListRow/InstalledAppListRow.tsx index bfc9df2e2..5ffc9a23d 100644 --- a/src/apps/components/InstalledAppListRow/InstalledAppListRow.tsx +++ b/src/apps/components/InstalledAppListRow/InstalledAppListRow.tsx @@ -1,6 +1,6 @@ import { appsMessages } from "@dashboard/apps/messages"; import { InstalledApp } from "@dashboard/apps/types"; -import { AppUrls } from "@dashboard/apps/urls"; +import { AppPaths, AppUrls } from "@dashboard/apps/urls"; import { isAppInTunnel } from "@dashboard/apps/utils"; import Link from "@dashboard/components/Link"; import { Box, Chip, List, sprinkles, Text } from "@saleor/macaw-ui/next"; @@ -19,13 +19,20 @@ export const InstalledAppListRow: React.FC = props => { const location = useLocation(); + /** + * Active app will redirect to app iframe, but disabled app is likely not going to work - so iframe is blocked. + * Link will point to app "manage" screen where app can be enabled or uninstalled + */ + const appUrl = app.isActive + ? AppUrls.resolveAppUrl(app.id) + : AppPaths.resolveAppDetailsPath(app.id); + return ( = props => { default: !app.isActive ? "surfaceNeutralSubdued" : undefined, hover: "surfaceNeutralSubdued", }} - cursor={app.isActive ? "pointer" : "not-allowed"} + cursor={"pointer"} >