Fix ButtonLink and edit request names

This commit is contained in:
Gregory Schier
2023-03-13 00:11:23 -07:00
parent 4ad91b4553
commit 7ad1bd54ac
4 changed files with 66 additions and 35 deletions

View File

@@ -96,15 +96,17 @@ export function _Editor({
readOnly && 'cm-readonly',
)}
>
<IconButton
icon="eye"
className="absolute right-3 bottom-3 z-10"
onClick={() => {
const doc = cm.current?.view.state.doc ?? '';
const insert = formatSdl(doc.toString());
cm.current?.view.dispatch({ changes: { from: 0, to: doc.length, insert } });
}}
/>
{contentType?.includes("graphql") && (
<IconButton
icon="eye"
className="absolute right-3 bottom-3 z-10"
onClick={() => {
const doc = cm.current?.view.state.doc ?? '';
const insert = formatSdl(doc.toString());
cm.current?.view.dispatch({ changes: { from: 0, to: doc.length, insert } });
}}
/>
)}
</div>
);
}