-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8f9c7c
commit 53441f6
Showing
3 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/NodeSearchResults.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
|
||
|
||
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 ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters