From fda5c6fdf74e6221e13449a5669dc44392d2c5bc Mon Sep 17 00:00:00 2001 From: David Luzar <5153846+dwelle@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:32:00 +0100 Subject: [PATCH] fix: t2c settings dialog spacing for apps that use CSS resets (#7337) --- src/components/InlineIcon.tsx | 15 ++++++++++ src/components/MagicSettings.tsx | 47 +++++++++++--------------------- src/components/Paragraph.tsx | 10 +++++++ src/css/styles.scss | 4 +++ 4 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 src/components/InlineIcon.tsx create mode 100644 src/components/Paragraph.tsx diff --git a/src/components/InlineIcon.tsx b/src/components/InlineIcon.tsx new file mode 100644 index 00000000..7d967232 --- /dev/null +++ b/src/components/InlineIcon.tsx @@ -0,0 +1,15 @@ +export const InlineIcon = ({ icon }: { icon: JSX.Element }) => { + return ( + + {icon} + + ); +}; diff --git a/src/components/MagicSettings.tsx b/src/components/MagicSettings.tsx index 2f2dc9ba..190d7b24 100644 --- a/src/components/MagicSettings.tsx +++ b/src/components/MagicSettings.tsx @@ -2,28 +2,14 @@ import { useState } from "react"; import { Dialog } from "./Dialog"; import { TextField } from "./TextField"; import { MagicIcon, OpenAIIcon } from "./icons"; - -import "./MagicSettings.scss"; import { FilledButton } from "./FilledButton"; import { CheckboxItem } from "./CheckboxItem"; import { KEYS } from "../keys"; import { useUIAppState } from "../context/ui-appState"; +import { InlineIcon } from "./InlineIcon"; +import { Paragraph } from "./Paragraph"; -const InlineButton = ({ icon }: { icon: JSX.Element }) => { - return ( - - {icon} - - ); -}; +import "./MagicSettings.scss"; export const MagicSettings = (props: { openAIKey: string | null; @@ -70,18 +56,17 @@ export const MagicSettings = (props: { className="MagicSettings" autofocus={false} > -
- For the diagram-to-code feature we use{" "}
-
+
+
+
+
+
- Once API key is set, you can use the
+ {props.children} +
+ ); +}; diff --git a/src/css/styles.scss b/src/css/styles.scss index 032c9abb..341370f2 100644 --- a/src/css/styles.scss +++ b/src/css/styles.scss @@ -734,4 +734,8 @@ letter-spacing: 0.6px; font-family: "Assistant"; } + + .excalidraw__paragraph { + margin: 1rem 0; + } }