-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { capitalize, get } from "lodash"; | |
import { SLUGS } from "pages/FlowEditor/data/types"; | ||
import { useStore } from "pages/FlowEditor/lib/store"; | ||
import React from "react"; | ||
import { useNavigation } from "react-navi"; | ||
import { FONT_WEIGHT_SEMI_BOLD } from "theme"; | ||
|
||
import { Headline } from "./Headline"; | ||
|
@@ -55,12 +56,12 @@ export const SearchResultCard: React.FC<{ | |
const { Icon, componentType, title, key, headline } = | ||
getDisplayDetailsForResult(result); // TODO - display portal wrapper | ||
|
||
const getURLForNode = useStore((state) => state.getURLForNode); | ||
const { navigate } = useNavigation(); | ||
Check failure on line 60 in editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard.tsx GitHub Actions / Run React TestsUnhandled error
Check failure on line 60 in editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard.tsx GitHub Actions / Run React TestsUnhandled error
Check failure on line 60 in editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard.tsx GitHub Actions / Run React Testssrc/pages/FlowEditor/components/Sidebar/Search/NodeSearchResults.test.tsx > Displays the count for a single result
Check failure on line 60 in editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard.tsx GitHub Actions / Run React Testssrc/pages/FlowEditor/components/Sidebar/Search/NodeSearchResults.test.tsx > Displays the count for multiple results
Check failure on line 60 in editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard.tsx GitHub Actions / Run React Testssrc/pages/FlowEditor/components/Sidebar/Search/NodeSearchResults.test.tsx > should not have any accessibility violations on initial load
|
||
|
||
const handleClick = () => { | ||
console.log("todo!"); | ||
console.log({ nodeId: result.item.id }); | ||
// get path for node | ||
// generate url from path | ||
// navigate to url | ||
const url = getURLForNode(result.item.id); | ||
navigate(url); | ||
}; | ||
|
||
return ( | ||
|