From c2e6208f93d9e199d37becb330f786fdedda7fd5 Mon Sep 17 00:00:00 2001 From: Nikita Chistousov Date: Wed, 31 Jul 2024 11:23:45 +0200 Subject: [PATCH] =?UTF-8?q?#4880=20=E2=80=93=20Additional=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ketcher-macromolecules/src/Editor.tsx | 2 +- .../monomerLibrary/RnaPresetGroup/RnaPresetGroup.tsx | 11 ++++++++--- .../monomerLibraryGroup/MonomerGroup.tsx | 2 +- .../src/components/shared/IDTAliases/index.tsx | 11 ++++++++--- .../src/components/shared/IDTAliases/styles.ts | 4 ++++ 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/ketcher-macromolecules/src/Editor.tsx b/packages/ketcher-macromolecules/src/Editor.tsx index 7c09fd46a9..dad49b8026 100644 --- a/packages/ketcher-macromolecules/src/Editor.tsx +++ b/packages/ketcher-macromolecules/src/Editor.tsx @@ -183,7 +183,7 @@ function Editor({ theme, togglerComponent }: EditorProps) { ); const debouncedShowPreview = useCallback( - debounce((p) => dispatchShowPreview(p), 2000), + debounce((p) => dispatchShowPreview(p), 500), [dispatchShowPreview], ); diff --git a/packages/ketcher-macromolecules/src/components/monomerLibrary/RnaPresetGroup/RnaPresetGroup.tsx b/packages/ketcher-macromolecules/src/components/monomerLibrary/RnaPresetGroup/RnaPresetGroup.tsx index cad3422c68..230324f61e 100644 --- a/packages/ketcher-macromolecules/src/components/monomerLibrary/RnaPresetGroup/RnaPresetGroup.tsx +++ b/packages/ketcher-macromolecules/src/components/monomerLibrary/RnaPresetGroup/RnaPresetGroup.tsx @@ -32,7 +32,12 @@ import { GroupContainerRow, ItemsContainer, } from 'components/monomerLibrary/monomerLibraryGroup/styles'; -import { selectEditor, selectShowPreview, showPreview } from 'state/common'; +import { + PresetPosition, + selectEditor, + selectShowPreview, + showPreview, +} from 'state/common'; import { RNAContextMenu } from 'components/contextMenu/RNAContextMenu'; import { CONTEXT_MENU_ID } from 'components/contextMenu/types'; import { useContextMenu } from 'react-contexify'; @@ -109,7 +114,7 @@ export const RnaPresetGroup = ({ presets, duplicatePreset, editPreset }) => { ); const debouncedShowPreview = useCallback( - debounce((p) => dispatchShowPreview(p), 1000), + debounce((p) => dispatchShowPreview(p), 500), [dispatchShowPreview], ); @@ -145,7 +150,7 @@ export const RnaPresetGroup = ({ presets, duplicatePreset, editPreset }) => { monomers, name: preset.name, idtAliases: preset.idtAliases, - position: 'library', + position: PresetPosition.Library, }, style, }); diff --git a/packages/ketcher-macromolecules/src/components/monomerLibrary/monomerLibraryGroup/MonomerGroup.tsx b/packages/ketcher-macromolecules/src/components/monomerLibrary/monomerLibraryGroup/MonomerGroup.tsx index 8ad475723a..0184c265ff 100644 --- a/packages/ketcher-macromolecules/src/components/monomerLibrary/monomerLibraryGroup/MonomerGroup.tsx +++ b/packages/ketcher-macromolecules/src/components/monomerLibrary/monomerLibraryGroup/MonomerGroup.tsx @@ -85,7 +85,7 @@ const MonomerGroup = ({ ); const debouncedShowPreview = useCallback( - debounce((p) => dispatchShowPreview(p), 2000), + debounce((p) => dispatchShowPreview(p), 500), [dispatchShowPreview], ); diff --git a/packages/ketcher-macromolecules/src/components/shared/IDTAliases/index.tsx b/packages/ketcher-macromolecules/src/components/shared/IDTAliases/index.tsx index 851c6d10ff..e74b53f7d3 100644 --- a/packages/ketcher-macromolecules/src/components/shared/IDTAliases/index.tsx +++ b/packages/ketcher-macromolecules/src/components/shared/IDTAliases/index.tsx @@ -1,4 +1,9 @@ -import { IDTAliasesContainer, IDTAliasesList, IDTTitle } from './styles'; +import { + IDTAliasesContainer, + IDTAliasesList, + IDTAliasesText, + IDTTitle, +} from './styles'; interface IDTAliasesProps { readonly idtAliasesText: string; @@ -8,10 +13,10 @@ interface IDTAliasesProps { const IDTAliases = ({ idtAliasesText, preset }: IDTAliasesProps) => { return ( -

+ IDT: {idtAliasesText} -

+
); }; diff --git a/packages/ketcher-macromolecules/src/components/shared/IDTAliases/styles.ts b/packages/ketcher-macromolecules/src/components/shared/IDTAliases/styles.ts index c9f645efda..3d1470c888 100644 --- a/packages/ketcher-macromolecules/src/components/shared/IDTAliases/styles.ts +++ b/packages/ketcher-macromolecules/src/components/shared/IDTAliases/styles.ts @@ -27,6 +27,10 @@ export const IDTAliasesContainer = styled.span<{ preset?: boolean }>` border-left: ${({ preset }) => (preset ? 'none' : '1px solid #D9DCEA')}; `; +export const IDTAliasesText = styled.p` + margin: 0; +`; + export const IDTTitle = styled.span` color: #7c7c7c; `;