Skip to content

Commit

Permalink
#2332 - Add peptide monomers to canvas (by click)
Browse files Browse the repository at this point in the history
- added an ability  to add peptides on canvas and move by drag n drop
  • Loading branch information
rrodionov91 committed Jul 28, 2023
1 parent 1de6439 commit 8026bb7
Show file tree
Hide file tree
Showing 56 changed files with 1,636 additions and 67 deletions.
8 changes: 6 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ const App = () => {
const [errorMessage, setErrorMessage] = useState('');
const [showPolymerEditor, setShowPolymerEditor] = useState(false);

const togglePolymerEditor = (toggleValue: boolean) => {
setShowPolymerEditor(toggleValue);
window.isPolymerEditorTurnedOn = toggleValue;
};
return showPolymerEditor ? (
<>
<PolymerEditor />
<PolymerToggler toggle={setShowPolymerEditor} />
<PolymerToggler toggle={togglePolymerEditor} />
</>
) : (
<>
Expand All @@ -75,7 +79,7 @@ const App = () => {
);
}}
/>
{enablePolymerEditor && <PolymerToggler toggle={setShowPolymerEditor} />}
{enablePolymerEditor && <PolymerToggler toggle={togglePolymerEditor} />}
{hasError && (
<InfoModal
message={errorMessage}
Expand Down
1 change: 1 addition & 0 deletions example/src/typing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare global {
data?: unknown;
}
export interface Window {
isPolymerEditorTurnedOn: boolean;
postMessage(
message: IMessage,
targetOrigin: string,
Expand Down
1 change: 1 addition & 0 deletions ketcher-autotests/tests/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import { Ketcher } from 'ketcher-core';
declare global {
interface Window {
ketcher: Ketcher;
isPolymerEditorTurnedOn: boolean;
}
}
Loading

0 comments on commit 8026bb7

Please sign in to comment.