Skip to content

Commit 88a9dd9

Browse files
committed
restor diff
1 parent 2fb333d commit 88a9dd9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ export const EditorUI = (props: EditorUIProps) => {
162162
const pendingCustomDiff = useRef({})
163163
const [, setCurrentBreakpoints] = useState({})
164164
const [isSplit, setIsSplit] = useState(true)
165-
const [isDiff, setIsDiff] = useState(props.isDiff || false)
166165
const [currentDiffFile, setCurrentDiffFile] = useState(props.currentDiffFile || '')
167166
const [decoratorListCollection, setDecoratorListCollection] = useState<Record<string, monacoTypes.editor.IEditorDecorationsCollection>>({})
168167
const [disposedWidgets, setDisposedWidgets] = useState<Record<string, Record<string, monacoTypes.IRange[]>>>({})
@@ -1473,12 +1472,13 @@ export const EditorUI = (props: EditorUIProps) => {
14731472
onMount={handleDiffEditorDidMount}
14741473
options={{ readOnly: false, renderSideBySide: isSplit }}
14751474
width='100%'
1476-
height={isDiff ? '100%' : '0%'}
1477-
className={isDiff ? "d-block" : "d-none"}
1475+
height={props.isDiff ? '100%' : '0%'}
1476+
className={props.isDiff ? "d-block" : "d-none"}
1477+
data-id="diffEditor"
14781478
/>
14791479
<Editor
14801480
width="100%"
1481-
height={isDiff ? '0%' : '100%'}
1481+
height={props.isDiff ? '0%' : '100%'}
14821482
path={props.currentFile}
14831483
language={editorModelsState[props.currentFile] ? editorModelsState[props.currentFile].language : 'text'}
14841484
onMount={handleEditorDidMount}
@@ -1494,7 +1494,7 @@ export const EditorUI = (props: EditorUIProps) => {
14941494
}
14951495
}}
14961496
defaultValue={defaultEditorValue}
1497-
className={isDiff ? "d-none" : "d-block"}
1497+
className={props.isDiff ? "d-none" : "d-block"}
14981498
/>
14991499
{editorModelsState[props.currentFile]?.readOnly && (
15001500
<span className="pl-4 h6 mb-0 w-100 alert-info position-absolute bottom-0 end-0">

0 commit comments

Comments
 (0)