@momo-kits/foundation 0.75.1-beta.9 → 0.75.2-beta.0
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/Application/BottomTab/BottomTabBar.tsx +478 -0
- package/Application/BottomTab/index.tsx +134 -0
- package/Application/Components.tsx +552 -0
- package/Application/ModalScreen.tsx +244 -0
- package/Application/Navigation.ts +50 -0
- package/Application/NavigationContainer.tsx +128 -0
- package/Application/Navigator.ts +151 -0
- package/Application/StackScreen.tsx +146 -0
- package/Application/index.ts +37 -0
- package/{Navigation → Application}/types.ts +96 -27
- package/Application/utils.tsx +175 -0
- package/Assets/DotAnimation.json +256 -0
- package/Assets/SpinnerAnimation.json +1027 -0
- package/Assets/icon.json +89 -5
- package/Assets/icon_bank.json +506 -0
- package/Assets/language.json +202 -0
- package/Badge/Badge.tsx +56 -0
- package/Badge/BadgeDot.tsx +11 -0
- package/Badge/BadgeRibbon.tsx +125 -0
- package/Badge/Shape.tsx +29 -0
- package/Badge/index.tsx +7 -0
- package/Badge/styles.ts +58 -0
- package/Badge/types.ts +63 -0
- package/Button/index.tsx +90 -39
- package/Button/styles.ts +19 -0
- package/CheckBox/index.tsx +58 -43
- package/CheckBox/styles.ts +1 -1
- package/CheckBox/types.ts +6 -4
- package/Consts/colors+spacing+radius.ts +18 -0
- package/Consts/styles.ts +0 -26
- package/Consts/theme.ts +5 -1
- package/Divider/index.tsx +3 -1
- package/Icon/index.tsx +14 -10
- package/Icon/types.ts +4 -3
- package/IconButton/index.tsx +24 -15
- package/Image/index.tsx +63 -45
- package/Image/styles.ts +1 -9
- package/Image/types.ts +5 -1
- package/Input/Input.tsx +227 -115
- package/Input/InputDropDown.tsx +132 -0
- package/Input/InputMoney.tsx +174 -110
- package/Input/InputOTP.tsx +257 -0
- package/Input/InputSearch.tsx +160 -130
- package/Input/InputTextArea.tsx +149 -121
- package/Input/common.tsx +43 -18
- package/Input/index.tsx +205 -17
- package/Input/styles.ts +44 -7
- package/Input/utils.ts +2 -2
- package/Layout/Card.tsx +76 -37
- package/Layout/FloatingButton.tsx +128 -0
- package/Layout/GridSystem.tsx +35 -23
- package/Layout/Item.tsx +29 -33
- package/Layout/ItemList.tsx +55 -0
- package/Layout/ItemSectionList.tsx +39 -0
- package/Layout/Screen.tsx +378 -0
- package/Layout/Section.tsx +73 -35
- package/Layout/index.ts +13 -3
- package/Layout/styles.ts +101 -0
- package/Layout/types.ts +1 -37
- package/Layout/utils.ts +38 -43
- package/Loader/DotLoader.tsx +37 -0
- package/Loader/Loader.tsx +13 -0
- package/Loader/ProgressBar.tsx +44 -0
- package/Loader/Spinner.tsx +29 -0
- package/Loader/index.tsx +4 -0
- package/Loader/styles.ts +10 -0
- package/Loader/types.ts +35 -0
- package/Loader/utils.ts +25 -0
- package/Pagination/Dot.tsx +1 -1
- package/Pagination/PaginationDot.tsx +8 -3
- package/Pagination/PaginationNumber.tsx +8 -7
- package/Pagination/PaginationScroll.tsx +1 -1
- package/Pagination/PaginationWhiteDot.tsx +8 -5
- package/Pagination/styles.ts +3 -0
- package/Pagination/types.ts +2 -0
- package/Popup/PopupNotify.tsx +102 -44
- package/Popup/PopupPromotion.tsx +63 -22
- package/Popup/types.ts +15 -4
- package/Radio/index.tsx +35 -21
- package/Radio/types.ts +7 -5
- package/Skeleton/index.tsx +1 -1
- package/Skeleton/types.ts +3 -0
- package/Switch/index.tsx +35 -24
- package/Switch/types.ts +5 -3
- package/Tag/index.tsx +1 -1
- package/Text/index.tsx +32 -26
- package/Text/styles.ts +38 -0
- package/Text/types.ts +25 -13
- package/Text/utils.ts +14 -0
- package/Title/index.tsx +186 -0
- package/Title/styles.ts +79 -0
- package/Title/types.ts +20 -0
- package/code-scanner.js +143 -0
- package/index.ts +17 -3
- package/migrate_typo.js +56 -0
- package/package.json +44 -39
- package/publish.sh +2 -5
- package/tsconfig.json +24 -0
- package/verify.js +47 -0
- package/Assets/header-background.png +0 -0
- package/Layout/ScreenContainer.tsx +0 -121
- package/Navigation/BottomTab.tsx +0 -39
- package/Navigation/Components.tsx +0 -365
- package/Navigation/ModalScreen.tsx +0 -226
- package/Navigation/Navigation.ts +0 -44
- package/Navigation/NavigationButton.tsx +0 -54
- package/Navigation/NavigationContainer.tsx +0 -77
- package/Navigation/Navigator.ts +0 -82
- package/Navigation/Observer.ts +0 -79
- package/Navigation/StackScreen.tsx +0 -27
- package/Navigation/index.ts +0 -14
- package/Navigation/utils.tsx +0 -137
package/migrate_typo.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const {readFileSync, writeFileSync, readdirSync, statSync} = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
let rootPath = process.argv[2];
|
|
4
|
+
|
|
5
|
+
const migrateText = [
|
|
6
|
+
{typo1: 'headline_s', typo2: 'headline_default_bold'},
|
|
7
|
+
{typo1: 'header_s', typo2: 'header_s_semibold'},
|
|
8
|
+
{typo1: 'header_xs', typo2: 'header_xs_semibold'},
|
|
9
|
+
{typo1: 'description_default', typo2: 'body_default_regular'},
|
|
10
|
+
{typo1: 'description_s', typo2: 'description_default_regular'},
|
|
11
|
+
{typo1: 'description_xs', typo2: 'description_xs_regular'},
|
|
12
|
+
{typo1: 'label_default', typo2: 'label_default_medium'},
|
|
13
|
+
{typo1: 'label_s', typo2: 'label_s_medium'},
|
|
14
|
+
{typo1: 'label_xs', typo2: 'label_xs_medium'},
|
|
15
|
+
{typo1: 'action_default', typo2: 'action_default_bold'},
|
|
16
|
+
{typo1: 'action_xs', typo2: 'action_xs_bold'},
|
|
17
|
+
{typo1: 'action_xxs', typo2: 'action_xxs_bold'},
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
function replaceTextInFile(oldText, newText, filePath) {
|
|
21
|
+
try {
|
|
22
|
+
let content = readFileSync(filePath, {encoding: 'utf-8'});
|
|
23
|
+
const regex = new RegExp(`\\b${oldText}\\b`, 'g');
|
|
24
|
+
content = content.replace(regex, newText);
|
|
25
|
+
writeFileSync(filePath, content, 'utf8');
|
|
26
|
+
console.log(`Replaced text in: ${filePath}`);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(`Error processing file ${filePath}:`, error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function scanDirectory(directory, oldText, newText) {
|
|
33
|
+
const files = readdirSync(directory);
|
|
34
|
+
|
|
35
|
+
files.forEach(file => {
|
|
36
|
+
const filePath = path.join(directory, file);
|
|
37
|
+
const stat = statSync(filePath);
|
|
38
|
+
|
|
39
|
+
if (stat.isDirectory()) {
|
|
40
|
+
scanDirectory(filePath, oldText, newText);
|
|
41
|
+
} else if (
|
|
42
|
+
stat.isFile() &&
|
|
43
|
+
(filePath.endsWith('.tsx') || filePath.endsWith('.ts'))
|
|
44
|
+
) {
|
|
45
|
+
replaceTextInFile(oldText, newText, filePath);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function main() {
|
|
51
|
+
migrateText.forEach(({typo1, typo2}) => {
|
|
52
|
+
scanDirectory(rootPath, typo1, typo2);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
2
|
+
"name": "@momo-kits/foundation",
|
|
3
|
+
"version": "0.75.2-beta.0",
|
|
4
|
+
"description": "React Native Component Kits",
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"scripts": {},
|
|
7
|
+
"keywords": [
|
|
8
|
+
"@momo-kits/foundation"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@gorhom/bottom-sheet": "2.4.1",
|
|
12
|
+
"@react-navigation/bottom-tabs": "https://oauth2:5WXQLHPMxxCyvGt_Py4D@gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
|
|
13
|
+
"@react-navigation/core": "5.16.1",
|
|
14
|
+
"@react-navigation/native": "5.9.8",
|
|
15
|
+
"@react-navigation/routers": "5.7.4",
|
|
16
|
+
"@react-navigation/stack": "https://oauth2:eX-jVhzQdLc343AjD3Sc@gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git",
|
|
17
|
+
"lottie-react-native": "3.3.2",
|
|
18
|
+
"react-native-fast-image": "8.1.5",
|
|
19
|
+
"react-native-gesture-handler": "1.10.3",
|
|
20
|
+
"react-native-linear-gradient": "2.8.3",
|
|
21
|
+
"react-native-modalize": "2.1.1",
|
|
22
|
+
"react-native-safe-area-context": "3.1.4"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react-native": "*"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.12.9",
|
|
29
|
+
"@babel/runtime": "^7.12.5",
|
|
30
|
+
"@momo-platform/versions": "4.1.11",
|
|
31
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
32
|
+
"@types/d3-shape": "1.3.7",
|
|
33
|
+
"@types/jest": "26.0.23",
|
|
34
|
+
"@types/react-native": "0.64.4",
|
|
35
|
+
"@types/react-test-renderer": "16.9.2",
|
|
36
|
+
"babel-jest": "^26.6.3",
|
|
37
|
+
"eslint": "^7.14.0",
|
|
38
|
+
"jest": "^26.6.3",
|
|
39
|
+
"metro-react-native-babel-preset": "^0.64.0",
|
|
40
|
+
"react-scanner": "^1.1.0",
|
|
41
|
+
"react-test-renderer": "17.0.1",
|
|
42
|
+
"typescript": "^4.0.3"
|
|
43
|
+
},
|
|
44
|
+
"author": "@momo-kits/foundation",
|
|
45
|
+
"license": "ISC"
|
|
41
46
|
}
|
package/publish.sh
CHANGED
|
@@ -12,15 +12,12 @@ echo VERSION: $VERSION
|
|
|
12
12
|
|
|
13
13
|
rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
|
|
14
14
|
|
|
15
|
-
#babel component to dist
|
|
16
|
-
#babel ./dist -d dist --copy-files
|
|
17
|
-
|
|
18
15
|
cd dist
|
|
19
|
-
npm publish --tag
|
|
16
|
+
npm publish --tag latest --access=public
|
|
20
17
|
|
|
21
18
|
#clear dist and package json
|
|
22
19
|
cd ..
|
|
23
20
|
rm -rf dist
|
|
24
21
|
|
|
25
22
|
|
|
26
|
-
#curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/core new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/
|
|
23
|
+
#curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/core new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/foundation"}'
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": ".",
|
|
4
|
+
"allowUnreachableCode": false,
|
|
5
|
+
"allowUnusedLabels": false,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"jsx": "react",
|
|
9
|
+
"lib": ["esnext"],
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"noImplicitReturns": false,
|
|
14
|
+
"noImplicitUseStrict": false,
|
|
15
|
+
"noStrictGenericChecks": false,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"strict": true,
|
|
22
|
+
"target": "esnext",
|
|
23
|
+
}
|
|
24
|
+
}
|
package/verify.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
const packageInfo = JSON.parse(
|
|
6
|
+
fs.readFileSync(path.join(`${__dirname}`, 'package.json'), 'utf8'),
|
|
7
|
+
);
|
|
8
|
+
const packageVersion = parseInt(packageInfo?.version.split('.')?.[1]);
|
|
9
|
+
|
|
10
|
+
const app = path.join(`${__dirname}/../../../`, 'app.json');
|
|
11
|
+
const miniJson = path.join(`${__dirname}/../../../`, 'package.json');
|
|
12
|
+
|
|
13
|
+
if (!fs.existsSync(app) || fs.existsSync(miniJson)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const appInfo = JSON.parse(fs.readFileSync(app, 'utf8'));
|
|
18
|
+
const miniInfo = JSON.parse(fs.readFileSync(miniJson, 'utf8'));
|
|
19
|
+
|
|
20
|
+
const iOSAppTarget = appInfo?.client?.ios.deploymentTarget;
|
|
21
|
+
const androidAppTarget = appInfo?.client?.android.deploymentTarget;
|
|
22
|
+
|
|
23
|
+
if (packageVersion > iOSAppTarget || packageVersion > androidAppTarget) {
|
|
24
|
+
console.error(
|
|
25
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
|
|
26
|
+
);
|
|
27
|
+
throw new Error(
|
|
28
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (
|
|
33
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core'] &&
|
|
34
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core'] !==
|
|
35
|
+
packageInfo?.version
|
|
36
|
+
) {
|
|
37
|
+
console.error(
|
|
38
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
|
|
39
|
+
);
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(`Installation failed: ${error.message}`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
Binary file
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import {Animated, KeyboardAvoidingView, Platform, View} from 'react-native';
|
|
2
|
-
import {useHeaderHeight} from '@react-navigation/stack';
|
|
3
|
-
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
|
4
|
-
import React, {useContext} from 'react';
|
|
5
|
-
import {ScreenContainerProps} from '../Navigation/types';
|
|
6
|
-
import {Spacing, Styles} from '../Consts';
|
|
7
|
-
import {Section, Card, validateChildren} from './index';
|
|
8
|
-
import {ApplicationContext} from '../Navigation';
|
|
9
|
-
|
|
10
|
-
const ScreenContainer: React.FC<ScreenContainerProps> = ({
|
|
11
|
-
children,
|
|
12
|
-
enableKeyboardAvoidingView,
|
|
13
|
-
scrollable,
|
|
14
|
-
scrollY,
|
|
15
|
-
headerBackground,
|
|
16
|
-
scrollViewProps,
|
|
17
|
-
footerComponent: Footer,
|
|
18
|
-
}) => {
|
|
19
|
-
const {theme} = useContext(ApplicationContext);
|
|
20
|
-
const insets = useSafeAreaInsets();
|
|
21
|
-
let marginHeader = 0;
|
|
22
|
-
let handleScroll;
|
|
23
|
-
let imageAnimatedStyle = {};
|
|
24
|
-
let Component: any = View;
|
|
25
|
-
if (scrollable) {
|
|
26
|
-
Component = Animated.ScrollView;
|
|
27
|
-
}
|
|
28
|
-
if (scrollY) {
|
|
29
|
-
marginHeader = useHeaderHeight();
|
|
30
|
-
imageAnimatedStyle = {
|
|
31
|
-
transform: [
|
|
32
|
-
{
|
|
33
|
-
scale: scrollY.interpolate?.({
|
|
34
|
-
inputRange: [-300, 0, 1],
|
|
35
|
-
outputRange: [1.75, 1, 1],
|
|
36
|
-
extrapolate: 'clamp',
|
|
37
|
-
}),
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
};
|
|
41
|
-
handleScroll = Animated.event(
|
|
42
|
-
[{nativeEvent: {contentOffset: {y: scrollY}}}],
|
|
43
|
-
{useNativeDriver: true},
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* build content for screen
|
|
49
|
-
*/
|
|
50
|
-
const renderContent = () => {
|
|
51
|
-
const results = validateChildren(children, [Section, Card]);
|
|
52
|
-
if (Array.isArray(results)) {
|
|
53
|
-
return results.map((item, index) => {
|
|
54
|
-
return (
|
|
55
|
-
<View
|
|
56
|
-
key={`ScreenItem${index}`}
|
|
57
|
-
style={{
|
|
58
|
-
marginTop: Spacing.M,
|
|
59
|
-
flex: item.props?.expanded ? 1 : undefined,
|
|
60
|
-
}}>
|
|
61
|
-
{item}
|
|
62
|
-
</View>
|
|
63
|
-
);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return results;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<View style={Styles.flex} accessibilityLabel={`ScreenContainer`}>
|
|
71
|
-
<View
|
|
72
|
-
style={{
|
|
73
|
-
position: 'absolute',
|
|
74
|
-
height: 300,
|
|
75
|
-
width: '100%',
|
|
76
|
-
}}>
|
|
77
|
-
{!!headerBackground && (
|
|
78
|
-
<Animated.Image
|
|
79
|
-
source={{
|
|
80
|
-
uri: headerBackground,
|
|
81
|
-
}}
|
|
82
|
-
style={{
|
|
83
|
-
aspectRatio: 1.3,
|
|
84
|
-
...imageAnimatedStyle,
|
|
85
|
-
}}
|
|
86
|
-
/>
|
|
87
|
-
)}
|
|
88
|
-
</View>
|
|
89
|
-
<KeyboardAvoidingView
|
|
90
|
-
style={Styles.flex}
|
|
91
|
-
enabled={enableKeyboardAvoidingView}
|
|
92
|
-
behavior={Platform.select({
|
|
93
|
-
ios: 'padding',
|
|
94
|
-
android: undefined,
|
|
95
|
-
})}>
|
|
96
|
-
<Component
|
|
97
|
-
{...scrollViewProps}
|
|
98
|
-
onScroll={handleScroll}
|
|
99
|
-
style={[Styles.flex, {marginTop: marginHeader}]}>
|
|
100
|
-
{renderContent()}
|
|
101
|
-
</Component>
|
|
102
|
-
{Footer && (
|
|
103
|
-
<View
|
|
104
|
-
style={{
|
|
105
|
-
paddingTop: Spacing.S,
|
|
106
|
-
paddingBottom: insets.bottom,
|
|
107
|
-
backgroundColor: theme.colors.background.surface,
|
|
108
|
-
}}>
|
|
109
|
-
<Section>{Footer}</Section>
|
|
110
|
-
</View>
|
|
111
|
-
)}
|
|
112
|
-
</KeyboardAvoidingView>
|
|
113
|
-
</View>
|
|
114
|
-
);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
ScreenContainer.defaultProps = {
|
|
118
|
-
enableKeyboardAvoidingView: false,
|
|
119
|
-
scrollable: false,
|
|
120
|
-
};
|
|
121
|
-
export default ScreenContainer;
|
package/Navigation/BottomTab.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React, {FC} from 'react';
|
|
2
|
-
import {BottomTabProps} from './types';
|
|
3
|
-
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
|
|
4
|
-
import {Icon} from '../Icon';
|
|
5
|
-
|
|
6
|
-
const Tab = createBottomTabNavigator();
|
|
7
|
-
|
|
8
|
-
const BottomTab: FC<BottomTabProps> = ({tabs}) => {
|
|
9
|
-
return (
|
|
10
|
-
<Tab.Navigator>
|
|
11
|
-
{tabs.map((item, index) => {
|
|
12
|
-
return (
|
|
13
|
-
<Tab.Screen
|
|
14
|
-
key={`${item.label}-${index}`}
|
|
15
|
-
name={item.label}
|
|
16
|
-
component={item.screen}
|
|
17
|
-
options={{
|
|
18
|
-
tabBarLabel: item.label,
|
|
19
|
-
tabBarBadge: item?.badgeLabel,
|
|
20
|
-
tabBarBadgeStyle: {
|
|
21
|
-
borderColor: 'white',
|
|
22
|
-
borderWidth: 2,
|
|
23
|
-
fontSize: 10,
|
|
24
|
-
lineHeight: 14,
|
|
25
|
-
fontWeight: 'bold',
|
|
26
|
-
alignSelf: 'center',
|
|
27
|
-
},
|
|
28
|
-
tabBarIcon: ({color, size}) => (
|
|
29
|
-
<Icon source={item.icon} color={color} size={size} />
|
|
30
|
-
),
|
|
31
|
-
}}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
})}
|
|
35
|
-
</Tab.Navigator>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default BottomTab;
|