@@ -7,6 +7,7 @@ import { getTranslations } from "./translations";
77import { useEditorStore } from "./editorStore" ;
88import { Node } from "@xyflow/react" ;
99import { NodeData } from "./types" ;
10+ import { useJsonStore } from "./useJsonStore" ;
1011
1112interface EditorToolbarProps {
1213 defaultLanguage ?: string ;
@@ -32,9 +33,10 @@ export const EditorToolbar: React.FC<EditorToolbarProps> = ({
3233 const addNode = useEditorStore ( state => state . addNode ) ;
3334 const setSettingsDrawerOpen = useEditorStore ( state => state . setSettingsDrawerOpen ) ;
3435 const getRoadmapData = useEditorStore ( state => state . getRoadmapData ) ;
35- const setShareDialogOpen = useEditorStore ( state => state . setShareDialogOpen ) ;
3636 const reset = useEditorStore ( state => state . reset ) ;
3737
38+ const [ _ , postToJsonStore ] = useJsonStore ( ) ; ;
39+
3840 const language = settings ?. language || defaultLanguage ;
3941 const t = getTranslations ( language ) ;
4042
@@ -93,8 +95,6 @@ export const EditorToolbar: React.FC<EditorToolbarProps> = ({
9395 input . click ( ) ;
9496 } ;
9597
96- const onShare = ( ) => setShareDialogOpen ( true ) ;
97-
9898 const onReset = ( ) => {
9999 if ( confirm ( t . resetMapWarning ) ) {
100100 reset ( ) ;
@@ -134,7 +134,7 @@ export const EditorToolbar: React.FC<EditorToolbarProps> = ({
134134 < MenuItem onClick = { onDownload } >
135135 < Download size = { 16 } /> < span > { t . download } </ span >
136136 </ MenuItem >
137- < MenuItem onClick = { onShare } >
137+ < MenuItem onClick = { postToJsonStore } >
138138 < Share2 size = { 16 } /> < span > { t . share } </ span >
139139 </ MenuItem >
140140 < MenuDivider />
0 commit comments