@@ -7,7 +7,6 @@ import { GIT_TRACKED_FILES } from "../../../../actionStore";
7
7
import { ContextProvider } from "../../../../context" ;
8
8
import "../../../../prism.css" ;
9
9
import { globalAPIEndpoint } from "../../../../util/env_config" ;
10
- import "../../../styles/GitDiffView.css" ;
11
10
import "prismjs/components/prism-markdown" ;
12
11
13
12
export default function GitDiffViewComponent ( ) {
@@ -99,17 +98,28 @@ export default function GitDiffViewComponent() {
99
98
let fileName = splitEntry [ splitEntry . length - 1 ] ;
100
99
101
100
return (
102
- < div className = "git-diff--files--list" title = { fileEntry } >
103
- < div className = "bg-gray-100 p-1 rounded" >
104
- < div className = "git-diff--files--label" > Directory:</ div >
105
- < div className = "git-diff--files--directory" > { dirSplit } </ div >
101
+ < div
102
+ className = "my-2 block cursor-pointer border border-dashed border-blue-800"
103
+ title = { fileEntry }
104
+ >
105
+ < div className = "bg-gray-50 p-1 rounded" >
106
+ < div className = "font-sans font-semibold text-blue-400" >
107
+ Directory:
108
+ </ div >
109
+ < div className = "text-gray-500 truncate font-light" >
110
+ { dirSplit }
111
+ </ div >
112
+ </ div >
113
+ < div className = "mx-1 my-2 text-sm font-sans text-blue-800" >
114
+ { fileName }
106
115
</ div >
107
- < div className = "git-diff--files--filename_sm" > { fileName } </ div >
108
116
</ div >
109
117
) ;
110
118
} else {
111
119
return (
112
- < span className = "git-diff--files--filename_lg" > { fileEntry } </ span >
120
+ < span className = "text-lg p-2 border-b-2 border-gray-200 w-full" >
121
+ { fileEntry }
122
+ </ span >
113
123
) ;
114
124
}
115
125
} ;
@@ -263,10 +273,10 @@ export default function GitDiffViewComponent() {
263
273
if ( line [ 0 ] && line [ 0 ] === "+" ) {
264
274
return (
265
275
< div
266
- className = "git-diff--codeview--change bg-green-100"
276
+ className = "w-full flex items-center gap-1 bg-green-100 w-screen "
267
277
key = { `${ line } -${ uuidv4 ( ) } ` }
268
278
>
269
- < div className = "git-diff--codeview--linenumber border-green-400 text-green-500" >
279
+ < div className = "font-sans text-center w-16 mx-2 border-r border-green-400 text-green-500" >
270
280
{ ++ lineCounter }
271
281
</ div >
272
282
< pre className = "w-5/6 mx-2" >
@@ -285,10 +295,10 @@ export default function GitDiffViewComponent() {
285
295
} else if ( line [ 0 ] && line [ 0 ] === "-" ) {
286
296
return (
287
297
< div
288
- className = "git-diff--codeview--change bg-red-100"
298
+ className = "w-full flex items-center gap-1 bg-red-100 w-screen "
289
299
key = { `${ line } -${ uuidv4 ( ) } ` }
290
300
>
291
- < div className = "git-diff--codeview--linenumber border-red-400 text-red-400" >
301
+ < div className = "font-sans text-center w-16 mx-2 border-r border-red-400 text-red-400" >
292
302
-
293
303
</ div >
294
304
< pre className = "w-5/6 mx-2" >
@@ -308,13 +318,13 @@ export default function GitDiffViewComponent() {
308
318
if ( line [ 0 ] ) {
309
319
return (
310
320
< div
311
- className = "git-diff--codeview--change bg-white-200 "
321
+ className = "w-full flex items-center gap-1 bg-white-200 w-screen "
312
322
key = { `${ line } -${ uuidv4 ( ) } ` }
313
323
>
314
- < div className = "git-diff--codeview--linenumber " >
324
+ < div className = "font-sans text-gray-300 text-center w-16 mx-2 border-r border-gray-200 " >
315
325
{ ++ lineCounter }
316
326
</ div >
317
- < pre className = "w-5/6" >
327
+ < pre className = "w-5/6 mx-2 " >
318
328
< code
319
329
dangerouslySetInnerHTML = { {
320
330
__html : Prism . highlight (
@@ -345,33 +355,38 @@ export default function GitDiffViewComponent() {
345
355
< >
346
356
{ changedFiles && changedFiles . length > 0 ? (
347
357
< >
348
- < div className = "git-diff--wrapper" >
349
- < div className = "git-diff--files" style = { { height : "880px" } } >
358
+ < div className = "w-full flex justify-center mx-auto" >
359
+ < div
360
+ className = "overflow-auto break-words p-3 bg-white border-2 border-dashed border-gray-300 w-1/4 rounded-lg shadow-md"
361
+ style = { { height : "880px" } }
362
+ >
350
363
{ getDiffFiles ( ) }
351
364
</ div >
352
365
353
366
{ ! activeFileName ? (
354
- < div className = "git-diff--msg " >
355
- Click on a file to see difference information
367
+ < div className = "mt-4 p-4 mb-auto bg-gray-200 rounded shadow w-1/2 font-sans font-semibold mx-auto flex justify-center text-center " >
368
+ Click on a file to see difference
356
369
</ div >
357
370
) : (
358
371
""
359
372
) }
360
373
361
374
{ warnStatus ? (
362
- < div className = "git-diff--warn" > { warnStatus } </ div >
375
+ < div className = "mx-auto my-auto block bg-yellow-200 text-yellow-700 p-5 text-xl font-semibold rounded-lg shadow border border-b-2 border-dashed border-yellow-300" >
376
+ { warnStatus }
377
+ </ div >
363
378
) : null }
364
379
365
380
{ diffStatState &&
366
381
diffStatState !== "Click on a file item to see the difference" &&
367
382
! warnStatus ? (
368
- < div className = "git-diff--codeview " >
383
+ < div className = "w-3/4 mx-auto my-auto break-all p-3 " >
369
384
{ diffStatState ? statFormat ( ) : "" }
370
385
{ fileLineDiffState &&
371
386
fileLineDiffState !==
372
387
"Click on a file item to see the difference" ? (
373
388
< div
374
- className = "git-diff--codeview--content "
389
+ className = "p-3 overflow-auto break-words w-full "
375
390
style = { { height : "800px" } }
376
391
>
377
392
{ fileLineDiffComponent ( ) }
@@ -388,9 +403,11 @@ export default function GitDiffViewComponent() {
388
403
) : (
389
404
< >
390
405
{ isApiCalled ? (
391
- < div className = "git-diff--error" > No File changes in the repo</ div >
406
+ < div className = "mx-auto bg-yellow-100 w-full my-2 p-3 border-dashed rounded-lg shadow border-b-4 border-yellow-400 text-xl font-sans font-semibold text-center text-yellow-600" >
407
+ No File changes in the repo
408
+ </ div >
392
409
) : (
393
- < div className = "git-diff--loader " >
410
+ < div className = "w-full p-4 mx-auto text-center font-sans font-semibold text-xl rounded-lg shadow my-2 bg-pink-50 border-b-4 border-dashed border-pink-400 " >
394
411
< span className = "text-gray-400" >
395
412
Fetching changed files from the server...
396
413
</ span >
0 commit comments