Skip to content

Commit d666bc7

Browse files
committed
Pass extraPaddingLeft through Document for ReadonlyDocument
1 parent eaf6c30 commit d666bc7

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

packages/compass-components/src/components/document-list/document.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ const HadronDocument: React.FunctionComponent<{
8585
editable?: boolean;
8686
editing?: boolean;
8787
onEditStart?: () => void;
88-
}> = ({ value: document, editable = false, editing = false, onEditStart }) => {
88+
extraPaddingLeft?: number;
89+
}> = ({
90+
value: document,
91+
editable = false,
92+
editing = false,
93+
onEditStart,
94+
extraPaddingLeft,
95+
}) => {
8996
const { elements, visibleElements } = useHadronDocument(document);
9097
const [autoFocus, setAutoFocus] = useState<{
9198
id: string;
@@ -132,6 +139,7 @@ const HadronDocument: React.FunctionComponent<{
132139
value={el}
133140
editable={editable}
134141
editingEnabled={editing}
142+
extraPaddingLeft={extraPaddingLeft}
135143
onEditStart={
136144
editable
137145
? (id, type) => {

packages/compass-crud/src/components/readonly-document.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ class ReadonlyDocument extends React.Component<
131131
* @returns {Array} The elements.
132132
*/
133133
renderElements() {
134-
return <DocumentList.Document value={this.props.doc} />;
134+
return (
135+
<DocumentList.Document
136+
value={this.props.doc}
137+
extraPaddingLeft={spacing[500]}
138+
/>
139+
);
135140
}
136141

137142
renderActions() {

0 commit comments

Comments
 (0)