diff --git a/packages/react/package.json b/packages/react/package.json index 50d856f18..e0652e9fa 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -84,6 +84,7 @@ "@telegraph/segmented-control": "^0.2.2", "@telegraph/select": "^0.0.86", "@telegraph/tag": "^0.1.4", + "@telegraph/toggle": "0.1.1", "@telegraph/tokens": "^0.1.4", "@telegraph/tooltip": "0.1.3", "@telegraph/typography": "^0.2.1", diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx index d78633d81..fd1099b70 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx @@ -1,94 +1,159 @@ -import { useGuideContext } from "@knocklabs/react-core"; +import { useGuideContext, useStore } from "@knocklabs/react-core"; import { Box, Stack } from "@telegraph/layout"; +import { Toggle } from "@telegraph/toggle"; import { Tooltip } from "@telegraph/tooltip"; import { Text } from "@telegraph/typography"; export const GuideContextDetails = () => { const { client } = useGuideContext(); + const { debugSettings } = useStore(client.store, (state) => ({ + debugSettings: state.debug || {}, + })); return ( - - The tenant and data payload passed to the guide client that are used - for targeting -
- (via the `targetParams` prop to `KnockGuideProvider`) - - } - delayDuration={500} - > - - Target params + + + Toolbar settings -
- - - - Tenant - - -
-              {client.targetParams.tenant || "-"}
-            
-
+ + + + + Sandbox engagement + + + { + client.setDebug({ + ...debugSettings, + skipEngagementTracking: value, + }); + }} + /> + + + + + Ignore throttle + + + { + client.setDebug({ + ...debugSettings, + ignoreDisplayInterval: value, + }); + }} + /> + - + + + + The tenant and data payload passed to the guide client that are + used for targeting +
+ (via the `targetParams` prop to `KnockGuideProvider`) + + } + delayDuration={500} + > - Data - - -
-              
-                {client.targetParams.data
-                  ? JSON.stringify(client.targetParams.data, null, 2)
-                  : "-"}
-              
-            
-
+ Target params + +
+ + + + Tenant + + +
+                {client.targetParams.tenant || "-"}
+              
+
+
+ + + Data + + +
+                
+                  {client.targetParams.data
+                    ? JSON.stringify(client.targetParams.data, null, 2)
+                    : "-"}
+                
+              
+
+
diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx index 2f97e0844..ecfac67a5 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx @@ -1,4 +1,4 @@ -import { useGuideContext, useStore } from "@knocklabs/react-core"; +import { useGuideContext } from "@knocklabs/react-core"; import { Button } from "@telegraph/button"; import { Icon } from "@telegraph/icon"; import { Box, Stack } from "@telegraph/layout"; @@ -6,10 +6,8 @@ import { SegmentedControl } from "@telegraph/segmented-control"; import { Tooltip } from "@telegraph/tooltip"; import { Text } from "@telegraph/typography"; import { - Box as BoxIcon, ChevronDown, ChevronRight, - Gauge, GripVertical, LogOut, Minimize2, @@ -100,10 +98,6 @@ export const V2 = () => { const [isCollapsed, setIsCollapsed] = React.useState(false); const [isContextPanelOpen, setIsContextPanelOpen] = React.useState(false); - const { debugSettings } = useStore(client.store, (state) => ({ - debugSettings: state.debug || {}, - })); - React.useEffect(() => { const { isVisible = false, focusedGuideKeys = {} } = runConfig || {}; const isDebugging = client.store.state.debug?.debugging; @@ -287,47 +281,7 @@ export const V2 = () => { - -