Skip to content

Commit b3ceb4e

Browse files
committed
fix: use doc.off and fix type
1 parent 9ff0abf commit b3ceb4e

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

packages/compass-components/src/components/document-list/document-edit-actions-footer.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useCallback, useEffect, useRef, useState } from 'react';
22
import type HadronDocument from 'hadron-document';
33
import { DocumentEvents, ElementEvents } from 'hadron-document';
4-
import type { Element } from 'hadron-document/src/element';
4+
import type { Element } from 'hadron-document';
55
import { Button } from '../leafygreen';
66
import { css } from '@leafygreen-ui/emotion';
77
import { palette } from '@leafygreen-ui/palette';
@@ -186,7 +186,7 @@ function useHadronDocumentStatus(
186186
doc.on(DocumentEvents.EditingFinished, onEditingFinished);
187187

188188
return () => {
189-
doc.on(ElementEvents.Added, onUpdate);
189+
doc.off(ElementEvents.Added, onUpdate);
190190
doc.off(ElementEvents.Edited, onUpdate);
191191
doc.off(ElementEvents.Removed, onUpdate);
192192
doc.off(ElementEvents.Reverted, onUpdate);
@@ -217,18 +217,6 @@ function useHadronDocumentStatus(
217217
return { status, updateStatus, error };
218218
}
219219

220-
const container = css({
221-
display: 'flex',
222-
paddingTop: spacing[200],
223-
paddingRight: spacing[200],
224-
paddingBottom: spacing[200],
225-
paddingLeft: spacing[400],
226-
alignItems: 'center',
227-
gap: spacing[200],
228-
borderBottomLeftRadius: 'inherit',
229-
borderBottomRightRadius: 'inherit',
230-
});
231-
232220
const message = css({
233221
overflow: 'scroll',
234222
});

0 commit comments

Comments
 (0)