From 363e083ebaf8936703b7e956e57f597f52cd51cf Mon Sep 17 00:00:00 2001 From: senicar Date: Wed, 9 Aug 2023 08:15:22 +0200 Subject: [PATCH] Add option to hide FIgma UI --- packages/mdx-embed/src/components/figma/figma.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/mdx-embed/src/components/figma/figma.tsx b/packages/mdx-embed/src/components/figma/figma.tsx index fb32420..7b77e76 100644 --- a/packages/mdx-embed/src/components/figma/figma.tsx +++ b/packages/mdx-embed/src/components/figma/figma.tsx @@ -12,9 +12,13 @@ export interface IFigmaProps { * The url to the file or frame. Make sure to include the node-id if present */ url: string; + /** + * Show Figma UI + */ + showUI: boolean; } -export const Figma: FunctionComponent = ({ title, height = 450, url }: IFigmaProps) => { +export const Figma: FunctionComponent = ({ title, height = 450, url, showUI = true }: IFigmaProps) => { const regex = /(file|proto)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/; if (!regex.test(url)) { return null; @@ -30,7 +34,7 @@ export const Figma: FunctionComponent = ({ title, height = 450, url width: '100%', }} scrolling="no" - src={`https://www.figma.com/embed?embed_host=mdx-embed&url=https://www.figma.com/${url}`} + src={`https://www.figma.com/embed?embed_host=mdx-embed&show_ui=${showUI ? 1 : 0}&url=https://www.figma.com/${url}`} frameBorder="no" allowFullScreen />