@@ -156,6 +156,17 @@ export const VirtualizedDiffViewer: React.FC<VirtualizedDiffViewerProps> = ({
156
156
[ leftView , rightView , handleExpand , searchState . term , inlineDiffOptions ] ,
157
157
) ;
158
158
159
+ const minimapProps = {
160
+ leftDiff : leftView ,
161
+ rightDiff : rightView ,
162
+ height,
163
+ miniMapWidth,
164
+ currentScrollTop : scrollTop ,
165
+ searchResults : searchState . results ,
166
+ currentMatchIndex : searchState . currentIndex ,
167
+ onScroll : ( scrollTop : number ) => listRef . current ?. scrollTo ( scrollTop ) ,
168
+ } ;
169
+
159
170
return (
160
171
< div className = { `diff-viewer-container${ className ? ` ${ className } ` : "" } ` } >
161
172
{ /* Header & Search */ }
@@ -213,29 +224,12 @@ export const VirtualizedDiffViewer: React.FC<VirtualizedDiffViewerProps> = ({
213
224
< div className = "minimap-overlay" >
214
225
< div className = "half left-map-holder" >
215
226
{ ! showSingleMinimap && (
216
- < DiffMinimap
217
- leftDiff = { leftView }
218
- rightDiff = { rightView }
219
- height = { height }
220
- miniMapWidth = { miniMapWidth }
221
- currentScrollTop = { scrollTop }
222
- searchResults = { searchState . results }
223
- currentMatchIndex = { searchState . currentIndex }
224
- onScroll = { scrollTop => listRef . current ?. scrollTo ( scrollTop ) }
225
- />
227
+ < DiffMinimap { ...minimapProps } />
228
+
226
229
) }
227
230
</ div >
228
231
< div className = "half right-map-holder" >
229
- < DiffMinimap
230
- leftDiff = { leftView }
231
- rightDiff = { rightView }
232
- height = { height }
233
- miniMapWidth = { miniMapWidth }
234
- currentScrollTop = { scrollTop }
235
- searchResults = { searchState . results }
236
- currentMatchIndex = { searchState . currentIndex }
237
- onScroll = { scrollTop => listRef . current ?. scrollTo ( scrollTop ) }
238
- />
232
+ < DiffMinimap { ...minimapProps } />
239
233
</ div >
240
234
</ div >
241
235
</ div >
0 commit comments