Skip to content

Commit

Permalink
#4880 – Additional fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
svvald committed Jul 31, 2024
1 parent f7f2481 commit c2e6208
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/ketcher-macromolecules/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function Editor({ theme, togglerComponent }: EditorProps) {
);

const debouncedShowPreview = useCallback(
debounce((p) => dispatchShowPreview(p), 2000),
debounce((p) => dispatchShowPreview(p), 500),
[dispatchShowPreview],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -109,7 +114,7 @@ export const RnaPresetGroup = ({ presets, duplicatePreset, editPreset }) => {
);

const debouncedShowPreview = useCallback(
debounce((p) => dispatchShowPreview(p), 1000),
debounce((p) => dispatchShowPreview(p), 500),
[dispatchShowPreview],
);

Expand Down Expand Up @@ -145,7 +150,7 @@ export const RnaPresetGroup = ({ presets, duplicatePreset, editPreset }) => {
monomers,
name: preset.name,
idtAliases: preset.idtAliases,
position: 'library',
position: PresetPosition.Library,
},
style,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const MonomerGroup = ({
);

const debouncedShowPreview = useCallback(
debounce((p) => dispatchShowPreview(p), 2000),
debounce((p) => dispatchShowPreview(p), 500),
[dispatchShowPreview],
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { IDTAliasesContainer, IDTAliasesList, IDTTitle } from './styles';
import {
IDTAliasesContainer,
IDTAliasesList,
IDTAliasesText,
IDTTitle,
} from './styles';

interface IDTAliasesProps {
readonly idtAliasesText: string;
Expand All @@ -8,10 +13,10 @@ interface IDTAliasesProps {
const IDTAliases = ({ idtAliasesText, preset }: IDTAliasesProps) => {
return (
<IDTAliasesContainer preset={preset}>
<p>
<IDTAliasesText>
<IDTTitle>IDT: </IDTTitle>
<IDTAliasesList>{idtAliasesText}</IDTAliasesList>
</p>
</IDTAliasesText>
</IDTAliasesContainer>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`;
Expand Down

0 comments on commit c2e6208

Please sign in to comment.