File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ .cellCenter {
2
+ text-align : center;
3
+ }
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
+ import "./Table.css" ;
2
3
3
4
const join = ( array , separator ) =>
4
5
array . reduce ( ( result , child , index ) => {
@@ -28,7 +29,8 @@ const symbol = value => {
28
29
}
29
30
} ;
30
31
31
- const defaultFallback = ( options , field ) => options [ field ] || options . default ;
32
+ const defaultFallback = ( options , field ) =>
33
+ options [ field ] === undefined ? options . default : options [ field ] ;
32
34
33
35
const tdValue = {
34
36
Package : links ,
@@ -42,10 +44,20 @@ const thStyles = {
42
44
default : { }
43
45
} ;
44
46
47
+ const tdClasses = {
48
+ Package : null ,
49
+ Version : null ,
50
+ default : "cellCenter"
51
+ } ;
52
+
45
53
const CellTd = options => {
46
54
const { header, value } = options ;
47
55
const cellFormatter = defaultFallback ( tdValue , header ) ;
48
- return < td > { cellFormatter ( value ) } </ td > ;
56
+ return (
57
+ < td className = { defaultFallback ( tdClasses , header ) } >
58
+ { cellFormatter ( value ) }
59
+ </ td >
60
+ ) ;
49
61
} ;
50
62
51
63
const CellTh = options => {
You can’t perform that action at this time.
0 commit comments