clwy-react-native-tableview-simple 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clwy-react-native-tableview-simple",
|
|
3
3
|
"description": "React Native component for TableView made with pure CSS",
|
|
4
|
-
"homepage": "https://github.com/
|
|
5
|
-
"version": "4.5.
|
|
4
|
+
"homepage": "https://github.com/Purii/react-native-tableview-simple",
|
|
5
|
+
"version": "4.5.1",
|
|
6
6
|
"author": "Patrick Böder <hello@patrickpuritscher.com>",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"clean": "watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn",
|
package/src/components/Cell.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ImageProps,
|
|
15
15
|
} from 'react-native';
|
|
16
16
|
import { ThemeContext } from './Theme';
|
|
17
|
-
import {
|
|
17
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
18
18
|
|
|
19
19
|
export interface CellInterface {
|
|
20
20
|
accessory?:
|
|
@@ -394,20 +394,18 @@ const Cell: React.FC<CellInterface> = ({
|
|
|
394
394
|
* @return {View} Complete View with cell elements
|
|
395
395
|
*/
|
|
396
396
|
const renderCellWithSafeAreaView = (): React.ReactNode => (
|
|
397
|
-
<
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
</SafeAreaView>
|
|
410
|
-
</SafeAreaProvider>
|
|
397
|
+
<SafeAreaView
|
|
398
|
+
style={[
|
|
399
|
+
localStyles.cellBackgroundColor,
|
|
400
|
+
localStyles.cellSafeAreaContainer,
|
|
401
|
+
]}>
|
|
402
|
+
<View style={localStyles.cell}>
|
|
403
|
+
{cellImageView || renderImageView()}
|
|
404
|
+
{cellContentView || renderCellContentView()}
|
|
405
|
+
{cellAccessoryView || renderAccessoryView()}
|
|
406
|
+
</View>
|
|
407
|
+
{children}
|
|
408
|
+
</SafeAreaView>
|
|
411
409
|
);
|
|
412
410
|
|
|
413
411
|
if (isPressable && !isDisabled) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
TextStyle,
|
|
8
8
|
ViewStyle,
|
|
9
9
|
} from 'react-native';
|
|
10
|
-
import {
|
|
10
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
11
11
|
|
|
12
12
|
import Separator from './Separator';
|
|
13
13
|
import { CellInterface } from './Cell';
|
|
@@ -172,15 +172,13 @@ const Section: React.FC<SectionInterface> = ({
|
|
|
172
172
|
if (header && withSafeAreaView) {
|
|
173
173
|
return (
|
|
174
174
|
<View style={styles.sectionheader}>
|
|
175
|
-
<
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
</SafeAreaView>
|
|
183
|
-
</SafeAreaProvider>
|
|
175
|
+
<SafeAreaView>
|
|
176
|
+
<Text
|
|
177
|
+
allowFontScaling={allowFontScaling}
|
|
178
|
+
style={localStyles.sectionheaderText}>
|
|
179
|
+
{header}
|
|
180
|
+
</Text>
|
|
181
|
+
</SafeAreaView>
|
|
184
182
|
</View>
|
|
185
183
|
);
|
|
186
184
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ViewStyle,
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import { ThemeContext } from './Theme';
|
|
9
|
-
import {
|
|
9
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
10
10
|
|
|
11
11
|
export interface SeparatorInterface {
|
|
12
12
|
backgroundColor?: ViewStyle['backgroundColor'];
|
|
@@ -49,11 +49,9 @@ const Separator: React.FC<SeparatorInterface> = ({
|
|
|
49
49
|
|
|
50
50
|
if (withSafeAreaView) {
|
|
51
51
|
return (
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
</SafeAreaView>
|
|
56
|
-
</SafeAreaProvider>
|
|
52
|
+
<SafeAreaView style={localStyles.separator}>
|
|
53
|
+
<View style={localStyles.separatorInner} />
|
|
54
|
+
</SafeAreaView>
|
|
57
55
|
);
|
|
58
56
|
}
|
|
59
57
|
return (
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import { THEMES, ThemeContext, THEME_APPEARANCE } from './Theme';
|
|
10
10
|
import { StringWithAutocomplete } from '../../CustomTypes';
|
|
11
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
11
12
|
|
|
12
13
|
export interface TableViewInterface {
|
|
13
14
|
children?: React.ReactNode;
|
|
@@ -19,11 +20,11 @@ export interface TableViewInterface {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const TableView: React.FC<TableViewInterface> = ({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}: TableViewInterface) => {
|
|
23
|
+
children,
|
|
24
|
+
appearance = 'auto',
|
|
25
|
+
customAppearances,
|
|
26
|
+
style,
|
|
27
|
+
}: TableViewInterface) => {
|
|
27
28
|
let themeMode: THEME_APPEARANCE = THEMES?.appearances?.light;
|
|
28
29
|
const systemColorScheme = useColorScheme();
|
|
29
30
|
if (
|
|
@@ -42,7 +43,9 @@ const TableView: React.FC<TableViewInterface> = ({
|
|
|
42
43
|
}
|
|
43
44
|
return (
|
|
44
45
|
<ThemeContext.Provider value={themeMode}>
|
|
45
|
-
<
|
|
46
|
+
<SafeAreaProvider>
|
|
47
|
+
<View style={[styles.tableView, style]}>{children}</View>
|
|
48
|
+
</SafeAreaProvider>
|
|
46
49
|
</ThemeContext.Provider>
|
|
47
50
|
);
|
|
48
51
|
};
|