From 47322f277a187c742f588c7ae9774807e1d0533d Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sat, 7 Jun 2025 11:22:09 +0200 Subject: [PATCH] optimizing flex layout & styling inputs --- src/Components/Input/RichTextEditor.tsx | 6 +- src/Components/Input/TextEditorMenu.tsx | 134 +++++++----------- .../PopupStartEndInput.tsx | 4 + src/Components/Profile/ProfileForm.tsx | 4 +- .../Profile/Subcomponents/ProfileTextForm.tsx | 2 +- src/Components/Profile/Templates/TabsForm.tsx | 3 + src/Components/Profile/Templates/TabsView.tsx | 4 +- src/Components/Templates/Tabs.tsx | 2 +- src/assets/css/tiptap.css | 5 +- 9 files changed, 72 insertions(+), 92 deletions(-) diff --git a/src/Components/Input/RichTextEditor.tsx b/src/Components/Input/RichTextEditor.tsx index 78f06147..2ab2fb8d 100644 --- a/src/Components/Input/RichTextEditor.tsx +++ b/src/Components/Input/RichTextEditor.tsx @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { Color } from '@tiptap/extension-color' import { Image } from '@tiptap/extension-image' import { Placeholder } from '@tiptap/extension-placeholder' @@ -29,11 +32,8 @@ export function RichTextEditor({ containerStyle, defaultValue, placeholder, - required = true, updateFormValue, }: RichTextEditorProps) { - console.log(placeholder, required) - const handleChange = () => { const newValue: string | undefined = editor?.storage.markdown.getMarkdown() if (updateFormValue && newValue) { diff --git a/src/Components/Input/TextEditorMenu.tsx b/src/Components/Input/TextEditorMenu.tsx index 67cca170..863daebe 100644 --- a/src/Components/Input/TextEditorMenu.tsx +++ b/src/Components/Input/TextEditorMenu.tsx @@ -1,5 +1,4 @@ import BoldIcon from '@heroicons/react/24/solid/BoldIcon' -import CodeBracketIcon from '@heroicons/react/24/solid/CodeBracketIcon' import H1Icon from '@heroicons/react/24/solid/H1Icon' import H2Icon from '@heroicons/react/24/solid/H2Icon' import H3Icon from '@heroicons/react/24/solid/H3Icon' @@ -7,9 +6,7 @@ import ItalicIcon from '@heroicons/react/24/solid/ItalicIcon' import ListBulletIcon from '@heroicons/react/24/solid/ListBulletIcon' import NumberedListIcon from '@heroicons/react/24/solid/NumberedListIcon' import { useEditorState } from '@tiptap/react' -import { FaQuoteLeft } from 'react-icons/fa6' import { MdUndo, MdRedo, MdHorizontalRule } from 'react-icons/md' -import { LiaTextHeightSolid } from 'react-icons/lia' import type { Editor } from '@tiptap/react' @@ -44,42 +41,16 @@ export const TextEditorMenu = ({ editor }: { editor: Editor }) => { }, }) - const addYoutubeVideo = () => { - const url = prompt('Enter YouTube URL') - - if (url) { - editor.commands.setYoutubeVideo({ - src: url, - width: Math.max(320) || 640, - height: Math.max(180) || 480, - }) - } - } - return ( <> -