Skip to content

Commit 9bf67b0

Browse files
committed
Fix rows data parsing
1 parent c4b92d1 commit 9bf67b0

4 files changed

Lines changed: 345 additions & 344 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-sqlite-explorer",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "Explorer for react-native-sqlite-storage library database inside react native app",
55
"source": "./src/index.tsx",
66
"main": "./lib/commonjs/index.js",

src/components/Table/TableModal.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,14 @@ const TableModal = ({
7979
>
8080
<View>
8181
{tableData.fields.map((field) => {
82-
const readOnly =
83-
typeof model[field.name] === 'object' && model[field.name] !== null;
84-
8582
return (
8683
<Input
8784
title={`${isFieldRequired(field.type) ? '*' : ''}${field.name} (${field.type})`}
8885
key={`field-input-${field.name}`}
8986
text={model[field.name]}
90-
readOnly={readOnly ? () => {} : false}
9187
onChangeText={(value) => onChange(field.name, value)}
9288
style={{ marginBottom: 6 }}
9389
showMicrofone={false}
94-
showClearButton={!readOnly}
9590
placeholder={`${field.name}`}
9691
error={!!errors?.[field.name] ? errors[field.name] : false}
9792
/>

src/components/Table/TableRow.tsx

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,62 @@ import { TableSignatureValue } from '../../types';
33
import { GlobalStyles } from '../../styles';
44

55
type 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

1212
const 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

3533
const 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

Comments
 (0)