File tree Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -119,23 +119,15 @@ export const SMILESInput = ({
119
119
return (
120
120
< Box display = "flex" flexDirection = "column" gap = { 1 } width = { width } >
121
121
< Box height = { height } >
122
- < Sketcher smiles = { smiles } onUnmount = { ( ) => setIsASketcherOpen ( false ) } />
122
+ < Sketcher smiles = { smiles } />
123
123
</ Box >
124
124
< ButtonGroup size = "small" sx = { { alignSelf : "end" } } variant = "outlined" >
125
- < Button
126
- color = "warning"
127
- onClick = { ( ) => {
128
- onDelete && onDelete ( ) ;
129
- onClose && onClose ( ) ;
130
- } }
131
- >
132
- Delete
133
- </ Button >
134
125
< Button
135
126
color = "info"
136
127
onClick = { ( ) => {
137
128
setMode ( "smiles" ) ;
138
129
onClose && onClose ( ) ;
130
+ setIsASketcherOpen ( false ) ;
139
131
} }
140
132
>
141
133
Cancel
@@ -150,6 +142,7 @@ export const SMILESInput = ({
150
142
setMode ( "smiles" ) ;
151
143
onSave ( smi ) ;
152
144
onClose && onClose ( ) ;
145
+ setIsASketcherOpen ( false ) ;
153
146
} else {
154
147
enqueueError ( "Smiles not obtained" ) ;
155
148
}
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import "ketcher-react/dist/index.css";
11
11
12
12
export interface SketcherProps {
13
13
smiles : string ;
14
- onUnmount ?: ( ) => void ;
15
14
}
16
15
17
16
export const allButtons = {
@@ -76,21 +75,14 @@ export const allButtons = {
76
75
"enhanced-stereo" : false ,
77
76
} ;
78
77
79
- export const Sketcher = ( { smiles, onUnmount } : SketcherProps ) => {
78
+ export const Sketcher = ( { smiles } : SketcherProps ) => {
80
79
const { enqueueError } = useEnqueueError ( ) ;
81
80
82
81
// Synchronise the react state to the component
83
82
useEffect ( ( ) => {
84
83
global . ketcher ?. setMolecule ( smiles ) ;
85
84
} , [ smiles ] ) ;
86
85
87
- useEffect ( ( ) => {
88
- // do nothing on mount
89
- return ( ) => {
90
- onUnmount && onUnmount ( ) ;
91
- } ;
92
- } ) ;
93
-
94
86
return (
95
87
< Editor
96
88
buttons = { Object . fromEntries (
You can’t perform that action at this time.
0 commit comments