From d7de49d74326993bd54a462ec289c0144ab57807 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Sat, 5 Aug 2023 22:15:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Migrate=20position=20prope?= =?UTF-8?q?rty=20of=20info-card=20to=20hove=20card=20property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/InfoCard/InfoCard.tsx | 45 +++++++++++++--------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/src/components/InfoCard/InfoCard.tsx b/src/components/InfoCard/InfoCard.tsx index 300414413..9727b8692 100644 --- a/src/components/InfoCard/InfoCard.tsx +++ b/src/components/InfoCard/InfoCard.tsx @@ -1,15 +1,23 @@ -import { DefaultMantineColor, HoverCard, HoverCardProps, SystemProp, useMantineTheme} from '@mantine/core'; -import { RichTextEditor, RichTextEditorProps, Link } from '@mantine/tiptap'; +import { + DefaultMantineColor, + HoverCard, + HoverCardProps, + SystemProp, + useMantineTheme, +} from '@mantine/core'; +import { Link, RichTextEditor, RichTextEditorProps } from '@mantine/tiptap'; +import { IconInfoCircle } from '@tabler/icons-react'; import { useEditor } from '@tiptap/react'; import StarterKit from '@tiptap/starter-kit'; -import { IconInfoCircle } from '@tabler/icons-react'; + +type A = HoverCardProps['position']; interface InfoCardProps { bg?: SystemProp; cardProp?: Partial; content: string; hoverProp?: Partial; - position?: "bottom" | "left" | "right" | "top" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" + position?: HoverCardProps['position']; } export const InfoCard = ({ bg, cardProp, content, hoverProp, position }: InfoCardProps) => { @@ -17,38 +25,25 @@ export const InfoCard = ({ bg, cardProp, content, hoverProp, position }: InfoCar const editor = useEditor({ content, editable: false, - editorProps: { attributes: { style: 'padding: 0;' }, }, - extensions: [ - StarterKit, - Link, - ], + editorProps: { attributes: { style: 'padding: 0;' } }, + extensions: [StarterKit, Link], }); return ( - + - - + + - ) -}; \ No newline at end of file + ); +};