From c4d6731401d3b6dc111a74d086df28704473070d Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sat, 17 Sep 2022 23:23:51 -0400 Subject: fix updater for new installs, fix file picker patch, fix scrolling on patch notes, fix tasks dir --- frontend/src/components/Markdown.tsx | 39 +++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'frontend/src/components/Markdown.tsx') diff --git a/frontend/src/components/Markdown.tsx b/frontend/src/components/Markdown.tsx index 7b187f14..cefced91 100644 --- a/frontend/src/components/Markdown.tsx +++ b/frontend/src/components/Markdown.tsx @@ -1,9 +1,42 @@ -import { FunctionComponent } from 'react'; +import { Focusable } from 'decky-frontend-lib'; +import { FunctionComponent, useRef } from 'react'; import ReactMarkdown, { Options as ReactMarkdownOptions } from 'react-markdown'; import remarkGfm from 'remark-gfm'; -const Markdown: FunctionComponent = (props) => { - return ; +interface MarkdownProps extends ReactMarkdownOptions { + onDismiss?: () => void; +} + +const Markdown: FunctionComponent = (props) => { + return ( + + {nodeProps.children}, + a: (nodeProps) => { + console.log(nodeProps.node, nodeProps); + const aRef = useRef(null); + return ( + // TODO fix focus ring + {}} + onOKButton={() => { + aRef?.current?.click(); + props.onDismiss?.(); + }} + > + + {nodeProps.children} + + + ); + }, + }} + {...props} + /> + + ); }; export default Markdown; -- cgit v1.2.3