Skip to content

Commit 8d5098c

Browse files
feat: drop layout-helper and codepush, move analytics to modular fire…
feat: drop layout-helper and codepush, move analytics to modular fire…
2 parents abca633 + 7500167 commit 8d5098c

17 files changed

Lines changed: 185 additions & 1202 deletions

File tree

‎package-lock.json‎

Lines changed: 98 additions & 1033 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"prepare": "husky install"
3636
},
3737
"dependencies": {
38-
"@lomray/react-native-layout-helper": "^2.0.0",
3938
"@lomray/reactotron-mobx-store-manager": "^1.2.0",
4039
"atomic-batcher": "^1.0.2",
4140
"react-native-flash-message": "^0.4.2",
@@ -92,9 +91,9 @@
9291
"peerDependencies": {
9392
"@lomray/client-helpers": "*",
9493
"@react-native-firebase/analytics": "^21.8.0",
94+
"@react-native-firebase/app": "^21.8.0",
9595
"axios": "*",
9696
"lodash": "*",
97-
"react-native-code-push": ">=7.0.5",
9897
"react-native-device-info": ">=10.6.0",
9998
"react-native-haptic-feedback": ">=2.0.3",
10099
"react-native-localize": "^3.0.6",

‎src/components/error-boundary/index.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React, { Component } from 'react';
33
import { withTranslation } from 'react-i18next';
44
import type { WithTranslation } from 'react-i18next';
55
import { Text, View, Button } from 'react-native';
6-
import CodePush from 'react-native-code-push';
76
import Config from '../../services/config';
87
import styles from './styles';
98

@@ -29,10 +28,10 @@ class ErrorBoundary extends Component<WithTranslation & { children: ReactNode },
2928
}
3029

3130
/**
32-
* Reload app
31+
* Drop the error state and render the tree again
3332
*/
3433
handleReloadApp = () => {
35-
CodePush.restartApp();
34+
this.setState({ hasError: false });
3635
};
3736

3837
render(): ReactNode {

‎src/components/error-boundary/styles.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { fs } from '@lomray/react-native-layout-helper';
21
import { StyleSheet } from 'react-native';
32

43
const styles = StyleSheet.create({
@@ -12,7 +11,7 @@ const styles = StyleSheet.create({
1211
paddingBottom: 10,
1312
},
1413
restartButtonText: {
15-
fontSize: fs(9),
14+
fontSize: 34,
1615
},
1716
});
1817

‎src/components/flat-list/empty/index.tsx‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { FC } from 'react';
22
import React from 'react';
3-
import type { ImageSourcePropType } from 'react-native';
3+
import type { ImageSourcePropType, StyleProp, TextStyle, ViewStyle } from 'react-native';
44
import { ImageBackground, View, Text } from 'react-native';
55
import styles from './styles';
66

@@ -10,18 +10,34 @@ interface IEmpty {
1010
title?: string;
1111
text?: string;
1212
Img?: ImageSourcePropType;
13+
containerStyle?: StyleProp<ViewStyle>;
14+
imageStyle?: StyleProp<ViewStyle>;
15+
titleStyle?: StyleProp<TextStyle>;
16+
textStyle?: StyleProp<TextStyle>;
1317
}
1418

1519
/**
1620
* Empty flat list component
1721
* @constructor
1822
*/
19-
const Empty: FC<IEmpty> = ({ hasRows, isFetching, title, text, Img }) =>
23+
const Empty: FC<IEmpty> = ({
24+
hasRows,
25+
isFetching,
26+
title,
27+
text,
28+
Img,
29+
containerStyle,
30+
imageStyle,
31+
titleStyle,
32+
textStyle,
33+
}) =>
2034
(!hasRows && !isFetching && (
21-
<View style={styles.emptyBlock}>
22-
{Img && <ImageBackground source={Img} style={styles.background} resizeMode="cover" />}
23-
{title && <Text style={styles.noFoundTitle}>{title}</Text>}
24-
{text && <Text style={styles.noFoundText}>{text}</Text>}
35+
<View style={[styles.emptyBlock, containerStyle]}>
36+
{Img && (
37+
<ImageBackground source={Img} style={[styles.background, imageStyle]} resizeMode="cover" />
38+
)}
39+
{title && <Text style={[styles.noFoundTitle, titleStyle]}>{title}</Text>}
40+
{text && <Text style={[styles.noFoundText, textStyle]}>{text}</Text>}
2541
</View>
2642
)) ||
2743
null;

‎src/components/flat-list/empty/styles.ts‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
import { fs, hp } from '@lomray/react-native-layout-helper';
21
import { StyleSheet } from 'react-native';
32

43
const styles = StyleSheet.create({
54
emptyBlock: {
65
flex: 1,
7-
minHeight: hp(49.261), // 400
6+
minHeight: 400,
87
justifyContent: 'center',
98
alignItems: 'center',
109
},
1110
background: {
1211
position: 'absolute',
1312
top: '50%',
1413
left: '50%',
15-
marginTop: hp(-18.473), // -150,
16-
marginLeft: hp(-18.473), // -150,
17-
width: hp(36.946), // 300
18-
height: hp(36.946), // 300
14+
marginTop: -150,
15+
marginLeft: -150,
16+
width: 300,
17+
height: 300,
1918
},
2019
noFoundTitle: {
2120
fontWeight: '600',
22-
fontSize: fs(6.4), // 24
21+
fontSize: 24,
2322
lineHeight: 26,
24-
marginBottom: hp(2.217), // 18
23+
marginBottom: 18,
2524
},
2625
noFoundText: {
2726
lineHeight: 20,
28-
fontSize: fs(3.733), // 14
27+
fontSize: 14,
2928
fontWeight: '400',
3029
},
3130
});

‎src/components/top-flash-messages/index.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { fs } from '@lomray/react-native-layout-helper';
21
import type { MessageOptions } from 'react-native-flash-message';
32
import { showMessage } from 'react-native-flash-message';
43
import type { IConfigParams } from '../../services/config';
@@ -24,7 +23,7 @@ const showTopFlashMessage = (msgOptions: MessageOptions): void => {
2423
{
2524
color: '#ffffff',
2625
fontWeight: '500',
27-
fontSize: fs(3.733), // 14
26+
fontSize: 14,
2827
},
2928
commonOptions?.textStyle,
3029
typeOptions?.textStyle,

‎src/helpers/get-navigation-bar-dimension.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { isAndroid } from '@lomray/react-native-layout-helper';
21
import { NativeModules } from 'react-native';
2+
import { isAndroid } from './platform';
33

44
/**
55
* Get navigation bar dimension on android
@@ -8,7 +8,7 @@ import { NativeModules } from 'react-native';
88
const getNavigationBarDimension = (): ReturnType<
99
(typeof NativeModules)['CommonModule']['getNavigationBarDimension']
1010
> => {
11-
if (!isAndroid) {
11+
if (!isAndroid()) {
1212
return Promise.resolve({});
1313
}
1414

‎src/helpers/platform.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Platform } from 'react-native';
2+
3+
/**
4+
* Running on iOS
5+
*/
6+
const isIOS = (): boolean => Platform.OS === 'ios';
7+
8+
/**
9+
* Running on Android
10+
*/
11+
const isAndroid = (): boolean => Platform.OS === 'android';
12+
13+
export { isAndroid, isIOS };

‎src/modals/bottom-half/styles.ts‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { hp, wp } from '@lomray/react-native-layout-helper';
21
import { StyleSheet } from 'react-native';
32

43
const styles = StyleSheet.create({
@@ -12,8 +11,8 @@ const styles = StyleSheet.create({
1211
dropdown: {
1312
marginTop: 'auto',
1413
justifyContent: 'flex-start',
15-
paddingBottom: hp(6.158), // 50
16-
paddingHorizontal: wp(7.467), // 28
14+
paddingBottom: 50,
15+
paddingHorizontal: 28,
1716
backgroundColor: '#FFFFFF',
1817
borderTopLeftRadius: 24,
1918
borderTopRightRadius: 24,
@@ -23,12 +22,12 @@ const styles = StyleSheet.create({
2322
width: '100%',
2423
justifyContent: 'center',
2524
alignItems: 'center',
26-
paddingTop: hp(1.478), // 12
27-
paddingBottom: hp(2.956), // 24
25+
paddingTop: 12,
26+
paddingBottom: 24,
2827
},
2928
controlButton: {
30-
width: wp(11.733), // 44
31-
height: hp(0.493), // 4
29+
width: 44,
30+
height: 4,
3231
backgroundColor: 'rgba(18, 18, 29, 0.1)',
3332
borderRadius: 10,
3433
},

0 commit comments

Comments
 (0)