@@ -3,64 +3,62 @@ import { TableSignatureValue } from '../../types';
33import { GlobalStyles } from '../../styles' ;
44
55type TableRowProps = {
6- row : TableSignatureValue ;
7- index : number ;
8- isChecked : boolean ;
9- onPress : ( index : number | null ) => void ;
6+ row : TableSignatureValue ;
7+ index : number ;
8+ isChecked : boolean ;
9+ onPress : ( index : number | null ) => void ;
1010} ;
1111
1212const TableRow = ( { row, index, isChecked, onPress } : TableRowProps ) => {
13- return < TouchableOpacity onPress = { ( ) => onPress ( index ) } style = { styles . Row } >
14- < View style = { [ styles . CheckedCell , isChecked && styles . CheckedCellActive ] } > </ View >
13+ return (
14+ < TouchableOpacity onPress = { ( ) => onPress ( index ) } style = { styles . Row } >
15+ < View
16+ style = { [ styles . CheckedCell , isChecked && styles . CheckedCellActive ] }
17+ > </ View >
1518
16- { Object . values ( row ) . map ( ( value , valueIndex ) => {
17- let val = '-' ;
18-
19- if ( ! ! value && typeof value === 'object' ) {
20- val = '[Object]'
21- } else if ( ! ! value ) {
22- val = value ;
23- }
24-
25- return < View
26- key = { `row-${ index } -value-${ valueIndex } ` }
27- style = { [ styles . RowCell , isChecked && styles . RowCellActive ] }
28- >
29- < Text style = { styles . Text } numberOfLines = { 4 } > { val } </ Text >
30- </ View >
31- } ) }
32- </ TouchableOpacity >
19+ { Object . values ( row ) . map ( ( value , valueIndex ) => (
20+ < View
21+ key = { `row-${ index } -value-${ valueIndex } ` }
22+ style = { [ styles . RowCell , isChecked && styles . RowCellActive ] }
23+ >
24+ < Text style = { styles . Text } numberOfLines = { 4 } >
25+ { value }
26+ </ Text >
27+ </ View >
28+ ) ) }
29+ </ TouchableOpacity >
30+ ) ;
3331} ;
3432
3533const styles = StyleSheet . create ( {
36- CheckedCell : {
37- width : 6 ,
38- height : '100%' ,
39- justifyContent : 'center' ,
40- alignItems : 'center' ,
41- borderWidth : 1 ,
42- borderColor : GlobalStyles . colors . gray ,
43- } ,
44- CheckedCellActive : {
45- backgroundColor : GlobalStyles . colors . blue ,
46- } ,
47- Row : {
48- flexDirection : 'row' ,
49- gap : 5 ,
50- marginBottom : 5 ,
51- } ,
52- RowCell : {
53- width : 100 ,
54- padding : 3 ,
55- borderColor : GlobalStyles . colors . gray ,
56- borderWidth : 1 ,
57- } ,
58- RowCellActive : {
59- backgroundColor : GlobalStyles . colors . white ,
60- } ,
61- Text : {
62- textAlign : 'center'
63- } ,
34+ CheckedCell : {
35+ width : 6 ,
36+ height : '100%' ,
37+ justifyContent : 'center' ,
38+ alignItems : 'center' ,
39+ borderWidth : 1 ,
40+ borderColor : GlobalStyles . colors . gray ,
41+ } ,
42+ CheckedCellActive : {
43+ backgroundColor : GlobalStyles . colors . blue ,
44+ } ,
45+ Row : {
46+ flexDirection : 'row' ,
47+ gap : 5 ,
48+ marginBottom : 5 ,
49+ } ,
50+ RowCell : {
51+ width : 100 ,
52+ padding : 3 ,
53+ borderColor : GlobalStyles . colors . gray ,
54+ borderWidth : 1 ,
55+ } ,
56+ RowCellActive : {
57+ backgroundColor : GlobalStyles . colors . white ,
58+ } ,
59+ Text : {
60+ textAlign : 'center' ,
61+ } ,
6462} ) ;
6563
66- export default TableRow ;
64+ export default TableRow ;
0 commit comments