diff --git a/packages/client/src/clients/guide/client.ts b/packages/client/src/clients/guide/client.ts index 742c073d..e458b3d8 100644 --- a/packages/client/src/clients/guide/client.ts +++ b/packages/client/src/clients/guide/client.ts @@ -217,6 +217,13 @@ const predicate = ( return false; } + return checkActivatable(guide, location); +}; + +export const checkActivatable = ( + guide: KnockGuide, + location: string | undefined, +) => { const url = location ? newUrl(location) : undefined; const urlRules = guide.activation_url_rules || []; diff --git a/packages/client/src/clients/guide/index.ts b/packages/client/src/clients/guide/index.ts index ddcb5e28..7d551916 100644 --- a/packages/client/src/clients/guide/index.ts +++ b/packages/client/src/clients/guide/index.ts @@ -1,4 +1,8 @@ -export { KnockGuideClient, DEBUG_QUERY_PARAMS } from "./client"; +export { + KnockGuideClient, + DEBUG_QUERY_PARAMS, + checkActivatable, +} from "./client"; export type { KnockGuide, KnockGuideStep, diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRow.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRow.tsx index c7fe52c5..bd54daf8 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRow.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRow.tsx @@ -1,9 +1,15 @@ import { Button } from "@telegraph/button"; -import { Stack } from "@telegraph/layout"; +import { Box, Stack } from "@telegraph/layout"; import { Tag } from "@telegraph/tag"; import { Tooltip } from "@telegraph/tooltip"; import { Text } from "@telegraph/typography"; -import { CheckCircle2, CircleDashed, Eye, UserCircle2 } from "lucide-react"; +import { + CheckCircle2, + CircleDashed, + Eye, + LocateFixed, + UserCircle2, +} from "lucide-react"; import * as React from "react"; import { GuideHoverCard } from "./GuideHoverCard"; @@ -39,6 +45,27 @@ export const GuideRow = ({ guide, orderIndex }: Props) => { + {guide.__typename === "Guide" && ( + + +