@momo-kits/foundation 0.80.8 → 0.81.1-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/BottomSheet.tsx +212 -0
- package/Application/BottomTab/BottomTabBar.tsx +278 -0
- package/Application/BottomTab/index.tsx +143 -0
- package/Application/Components.tsx +384 -213
- package/Application/ModalScreen.tsx +14 -178
- package/Application/Navigation.ts +15 -19
- package/Application/NavigationContainer.tsx +66 -63
- package/Application/Navigator.ts +106 -53
- package/Application/StackScreen.tsx +123 -9
- package/Application/index.ts +19 -6
- package/Application/types.ts +83 -26
- package/Application/utils.tsx +62 -74
- package/Assets/icon.json +83 -5
- package/Assets/icon_bank.json +506 -0
- package/Assets/language.json +3 -1
- 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 +64 -28
- package/Button/styles.ts +19 -0
- package/CheckBox/index.tsx +37 -27
- package/CheckBox/types.ts +5 -3
- package/Consts/colors+spacing+radius.ts +18 -0
- package/Icon/index.tsx +14 -9
- package/Icon/types.ts +4 -3
- package/IconButton/index.tsx +24 -15
- package/Image/index.tsx +62 -47
- package/Image/styles.ts +1 -9
- package/Image/types.ts +5 -1
- package/Input/Input.tsx +104 -25
- package/Input/InputDropDown.tsx +115 -110
- package/Input/InputMoney.tsx +79 -18
- package/Input/InputOTP.tsx +190 -149
- package/Input/InputSearch.tsx +96 -44
- package/Input/InputTextArea.tsx +33 -17
- package/Input/common.tsx +26 -17
- package/Input/index.tsx +108 -41
- package/Input/styles.ts +5 -7
- package/Input/utils.ts +1 -1
- package/Layout/AnimatedInputSearch.tsx +44 -0
- package/Layout/Card.tsx +37 -13
- package/Layout/FloatingButton.tsx +168 -0
- package/Layout/GridSystem.tsx +2 -3
- package/Layout/Item.tsx +1 -2
- package/Layout/ItemList.tsx +55 -0
- package/Layout/ItemSectionList.tsx +39 -0
- package/Layout/Screen.tsx +404 -181
- package/Layout/Section.tsx +22 -22
- package/Layout/TextTyping.tsx +114 -0
- package/Layout/index.ts +12 -2
- package/Layout/styles.ts +46 -13
- package/Layout/types.ts +13 -5
- package/Layout/utils.ts +7 -12
- package/Loader/index.tsx +2 -0
- package/Pagination/PaginationDot.tsx +6 -1
- package/Pagination/PaginationNumber.tsx +7 -4
- package/Pagination/PaginationScroll.tsx +0 -1
- package/Pagination/PaginationWhiteDot.tsx +6 -1
- package/Pagination/styles.ts +3 -0
- package/Pagination/types.ts +2 -0
- package/Popup/PopupNotify.tsx +108 -40
- package/Popup/PopupPromotion.tsx +45 -10
- package/Popup/types.ts +13 -10
- package/Radio/index.tsx +35 -21
- package/Radio/types.ts +7 -5
- package/Skeleton/index.tsx +1 -1
- package/Switch/index.tsx +32 -19
- package/Switch/types.ts +5 -3
- package/Tag/index.tsx +2 -4
- package/Text/index.tsx +26 -6
- package/Text/styles.ts +38 -0
- package/Text/types.ts +25 -13
- package/Title/index.tsx +177 -64
- package/Title/styles.ts +48 -15
- package/Title/types.ts +16 -7
- package/code-scanner.js +125 -16
- package/index.ts +9 -0
- package/migrate_typo.js +56 -0
- package/package.json +8 -7
- package/publish.sh +21 -16
- package/tsconfig.json +1 -2
- package/verify.js +24 -6
- package/Application/BottomTab.tsx +0 -65
package/Layout/Section.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import Item from './Item';
|
|
|
7
7
|
import {ApplicationContext} from '../Application';
|
|
8
8
|
import styles from './styles';
|
|
9
9
|
import {Image} from '../Image';
|
|
10
|
+
import ItemList from './ItemList';
|
|
10
11
|
|
|
11
12
|
export interface SectionProps extends ViewProps {
|
|
12
13
|
/**
|
|
@@ -21,11 +22,6 @@ export interface SectionProps extends ViewProps {
|
|
|
21
22
|
*/
|
|
22
23
|
useMargin?: boolean;
|
|
23
24
|
|
|
24
|
-
/**
|
|
25
|
-
* Optional. Background color for the Section component.
|
|
26
|
-
*/
|
|
27
|
-
backgroundColor?: string;
|
|
28
|
-
|
|
29
25
|
/**
|
|
30
26
|
* Optional. Background image for the Section component.
|
|
31
27
|
*/
|
|
@@ -35,8 +31,9 @@ export interface SectionProps extends ViewProps {
|
|
|
35
31
|
const Section: React.FC<SectionProps> = ({
|
|
36
32
|
children,
|
|
37
33
|
useMargin = true,
|
|
38
|
-
backgroundColor,
|
|
39
34
|
backgroundImage,
|
|
35
|
+
style,
|
|
36
|
+
...props
|
|
40
37
|
}) => {
|
|
41
38
|
const {showGrid} = useContext(ApplicationContext);
|
|
42
39
|
const {numberOfColumns} = useGridSystem();
|
|
@@ -54,7 +51,6 @@ const Section: React.FC<SectionProps> = ({
|
|
|
54
51
|
const gridContext: GridContextProps = {
|
|
55
52
|
numberOfColumns,
|
|
56
53
|
gutterSize,
|
|
57
|
-
margin,
|
|
58
54
|
sizePerSpan,
|
|
59
55
|
getSizeSpan: span => {
|
|
60
56
|
return span * sizePerSpan + (span - 1) * gutterSize;
|
|
@@ -89,7 +85,7 @@ const Section: React.FC<SectionProps> = ({
|
|
|
89
85
|
{rows.map((i: React.ReactElement, index: number) => {
|
|
90
86
|
return (
|
|
91
87
|
<View key={`Card${cursor}${index}`} style={{flexDirection: 'row'}}>
|
|
92
|
-
{index
|
|
88
|
+
{index !== 0 && (
|
|
93
89
|
<View style={{width: gridContext.gutterSize}}></View>
|
|
94
90
|
)}
|
|
95
91
|
{i}
|
|
@@ -111,8 +107,9 @@ const Section: React.FC<SectionProps> = ({
|
|
|
111
107
|
if (Array.isArray(children)) {
|
|
112
108
|
let cursor = 0;
|
|
113
109
|
let rows: any[] = [];
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
const arrayChild = children.filter(item => !!item);
|
|
111
|
+
for (let i = 0; i < arrayChild.length; ++i) {
|
|
112
|
+
const item = arrayChild[i];
|
|
116
113
|
const totalSpan = rows
|
|
117
114
|
.concat([item])
|
|
118
115
|
.map(i => i.props?.widthSpan)
|
|
@@ -128,14 +125,14 @@ const Section: React.FC<SectionProps> = ({
|
|
|
128
125
|
rows = [item];
|
|
129
126
|
}
|
|
130
127
|
|
|
131
|
-
if (i
|
|
128
|
+
if (i === arrayChild.length - 1) {
|
|
132
129
|
cursor += 1;
|
|
133
130
|
element.push(addRowView(rows, cursor, true));
|
|
134
131
|
}
|
|
135
132
|
}
|
|
136
133
|
} else {
|
|
137
134
|
element.push(children);
|
|
138
|
-
if (children?.type
|
|
135
|
+
if (children?.type === Fragment) {
|
|
139
136
|
return renderView(children?.props.children);
|
|
140
137
|
}
|
|
141
138
|
}
|
|
@@ -147,28 +144,31 @@ const Section: React.FC<SectionProps> = ({
|
|
|
147
144
|
value={{
|
|
148
145
|
numberOfColumns,
|
|
149
146
|
gutterSize,
|
|
150
|
-
margin,
|
|
151
147
|
sizePerSpan,
|
|
152
148
|
getSizeSpan: span => {
|
|
153
149
|
return span * sizePerSpan + (span - 1) * gutterSize;
|
|
154
150
|
},
|
|
155
151
|
}}>
|
|
156
152
|
<View
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
{...props}
|
|
154
|
+
onLayout={undefined}
|
|
155
|
+
style={[
|
|
156
|
+
style,
|
|
157
|
+
styles.protectedStyle,
|
|
158
|
+
{
|
|
159
|
+
width: widthSection,
|
|
160
|
+
marginHorizontal: margin,
|
|
161
|
+
flexDirection: 'row',
|
|
162
|
+
flexWrap: 'wrap',
|
|
163
|
+
},
|
|
164
|
+
]}>
|
|
165
165
|
{!!backgroundImage && (
|
|
166
166
|
<Image
|
|
167
167
|
source={{uri: backgroundImage}}
|
|
168
168
|
style={styles.imageBackground}
|
|
169
169
|
/>
|
|
170
170
|
)}
|
|
171
|
-
{renderView(validateChildren(children, [Item]))}
|
|
171
|
+
{renderView(validateChildren(children, [Item, ItemList]))}
|
|
172
172
|
{showGrid && renderOverlay()}
|
|
173
173
|
</View>
|
|
174
174
|
</GridContext.Provider>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React, {FC, memo, useEffect, useRef} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
InteractionManager,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
TextInput,
|
|
6
|
+
TextStyle,
|
|
7
|
+
} from 'react-native';
|
|
8
|
+
import {Colors} from '../Consts';
|
|
9
|
+
import {scaleSize} from '../Text';
|
|
10
|
+
|
|
11
|
+
export interface TextTypingProps {
|
|
12
|
+
data: string[];
|
|
13
|
+
timeDelayEnd?: number;
|
|
14
|
+
timeDelayNextChar?: number;
|
|
15
|
+
inputStyle?: TextStyle;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const TextTyping: FC<TextTypingProps> = ({
|
|
19
|
+
data = [],
|
|
20
|
+
timeDelayEnd = 2000,
|
|
21
|
+
timeDelayNextChar = 20,
|
|
22
|
+
inputStyle = {},
|
|
23
|
+
}) => {
|
|
24
|
+
const textRef = useRef<TextInput>(null);
|
|
25
|
+
|
|
26
|
+
const currentIndex = useRef<number>(0);
|
|
27
|
+
const currentCharIndex = useRef<number>(0);
|
|
28
|
+
const currentText = useRef('');
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
InteractionManager.runAfterInteractions();
|
|
33
|
+
playAnimation();
|
|
34
|
+
}, 1000);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
const playAnimation = () => {
|
|
38
|
+
const handleResetList = () => {
|
|
39
|
+
currentIndex.current = 0;
|
|
40
|
+
handleAnimation();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const handleAnimation = () => {
|
|
44
|
+
const listChar = data?.[currentIndex.current]?.split('') || [];
|
|
45
|
+
listChar.length !== 0 && showChar(listChar?.[currentCharIndex.current]);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
currentIndex.current >= data?.length
|
|
49
|
+
? handleResetList()
|
|
50
|
+
: handleAnimation();
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const showChar = (char?: string) => {
|
|
54
|
+
const handleResetString = () => {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
reset();
|
|
57
|
+
}, timeDelayEnd);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const handleShowChar = () => {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
textRef.current?.setNativeProps?.({
|
|
63
|
+
text: currentText.current + char,
|
|
64
|
+
});
|
|
65
|
+
currentText.current += char;
|
|
66
|
+
currentCharIndex.current++;
|
|
67
|
+
playAnimation();
|
|
68
|
+
}, timeDelayNextChar);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
currentCharIndex.current >= (data?.[currentIndex.current]?.length || 0)
|
|
72
|
+
? handleResetString()
|
|
73
|
+
: handleShowChar();
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const reset = () => {
|
|
77
|
+
const handleNextString = () => {
|
|
78
|
+
currentIndex.current++;
|
|
79
|
+
playAnimation();
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleReset = () => {
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
textRef.current?.setNativeProps?.({
|
|
85
|
+
text: currentText.current.slice(0, -1),
|
|
86
|
+
});
|
|
87
|
+
currentText.current = currentText.current.slice(0, -1);
|
|
88
|
+
currentCharIndex.current--;
|
|
89
|
+
reset();
|
|
90
|
+
}, timeDelayNextChar);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
currentCharIndex.current <= 0 ? handleNextString() : handleReset();
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<TextInput
|
|
98
|
+
style={[styles.inputStyle, inputStyle]}
|
|
99
|
+
ref={textRef}
|
|
100
|
+
editable={false}
|
|
101
|
+
autoCorrect={false}
|
|
102
|
+
pointerEvents={'none'}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export default memo(TextTyping);
|
|
108
|
+
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
inputStyle: {
|
|
111
|
+
color: Colors.black_12,
|
|
112
|
+
fontSize: scaleSize(12),
|
|
113
|
+
},
|
|
114
|
+
});
|
package/Layout/index.ts
CHANGED
|
@@ -5,13 +5,23 @@ import {validateChildren} from './utils';
|
|
|
5
5
|
import {createContext} from 'react';
|
|
6
6
|
import {GridContextProps} from './types';
|
|
7
7
|
import Item from './Item';
|
|
8
|
+
import ItemList from './ItemList';
|
|
9
|
+
import ItemSectionList from './ItemSectionList';
|
|
8
10
|
|
|
9
11
|
const GridContext = createContext<GridContextProps>({
|
|
10
12
|
numberOfColumns: 12,
|
|
11
13
|
gutterSize: 12,
|
|
12
|
-
margin: 12,
|
|
13
14
|
sizePerSpan: 0,
|
|
14
15
|
getSizeSpan: () => 0,
|
|
15
16
|
});
|
|
16
17
|
|
|
17
|
-
export {
|
|
18
|
+
export {
|
|
19
|
+
GridContext,
|
|
20
|
+
Card,
|
|
21
|
+
Section,
|
|
22
|
+
GridSystem,
|
|
23
|
+
validateChildren,
|
|
24
|
+
Item,
|
|
25
|
+
ItemList,
|
|
26
|
+
ItemSectionList,
|
|
27
|
+
};
|
package/Layout/styles.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
1
|
+
import {Platform, StyleSheet} from 'react-native';
|
|
2
|
+
import {Colors, Radius, Spacing} from '../Consts';
|
|
2
3
|
|
|
3
4
|
export default StyleSheet.create({
|
|
5
|
+
extendedHeader: {
|
|
6
|
+
aspectRatio: 1.75,
|
|
7
|
+
position: 'absolute',
|
|
8
|
+
width: '100%',
|
|
9
|
+
height: 210,
|
|
10
|
+
},
|
|
11
|
+
screenBanner: {
|
|
12
|
+
width: '100%',
|
|
13
|
+
},
|
|
4
14
|
boxGrid: {
|
|
5
15
|
position: 'absolute',
|
|
6
16
|
top: 0,
|
|
@@ -34,19 +44,8 @@ export default StyleSheet.create({
|
|
|
34
44
|
card: {
|
|
35
45
|
flexDirection: 'row',
|
|
36
46
|
flexWrap: 'wrap',
|
|
37
|
-
|
|
38
|
-
paddingBottom: undefined,
|
|
39
|
-
paddingLeft: undefined,
|
|
40
|
-
paddingRight: undefined,
|
|
41
|
-
paddingVertical: undefined,
|
|
42
|
-
paddingHorizontal: undefined,
|
|
47
|
+
borderRadius: Radius.M,
|
|
43
48
|
padding: 12,
|
|
44
|
-
margin: undefined,
|
|
45
|
-
marginTop: undefined,
|
|
46
|
-
marginBottom: undefined,
|
|
47
|
-
marginLeft: undefined,
|
|
48
|
-
marginRight: undefined,
|
|
49
|
-
marginVertical: undefined,
|
|
50
49
|
},
|
|
51
50
|
item: {
|
|
52
51
|
overflow: 'hidden',
|
|
@@ -65,4 +64,38 @@ export default StyleSheet.create({
|
|
|
65
64
|
left: 0,
|
|
66
65
|
right: 0,
|
|
67
66
|
},
|
|
67
|
+
protectedStyle: {
|
|
68
|
+
marginTop: undefined,
|
|
69
|
+
marginBottom: undefined,
|
|
70
|
+
marginLeft: undefined,
|
|
71
|
+
marginRight: undefined,
|
|
72
|
+
paddingTop: undefined,
|
|
73
|
+
paddingBottom: undefined,
|
|
74
|
+
paddingLeft: undefined,
|
|
75
|
+
paddingRight: undefined,
|
|
76
|
+
padding: undefined,
|
|
77
|
+
margin: undefined,
|
|
78
|
+
marginHorizontal: undefined,
|
|
79
|
+
marginVertical: undefined,
|
|
80
|
+
paddingHorizontal: undefined,
|
|
81
|
+
paddingVertical: undefined,
|
|
82
|
+
},
|
|
83
|
+
shadow: {
|
|
84
|
+
paddingTop: Spacing.S,
|
|
85
|
+
...Platform.select({
|
|
86
|
+
ios: {
|
|
87
|
+
shadowColor: Colors.black_17,
|
|
88
|
+
shadowOffset: {
|
|
89
|
+
width: 2,
|
|
90
|
+
height: 2,
|
|
91
|
+
},
|
|
92
|
+
shadowOpacity: 0.25,
|
|
93
|
+
shadowRadius: 10,
|
|
94
|
+
},
|
|
95
|
+
android: {
|
|
96
|
+
shadowColor: Colors.black_20,
|
|
97
|
+
elevation: 24,
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
},
|
|
68
101
|
});
|
package/Layout/types.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {Animated} from 'react-native';
|
|
2
|
+
import {InputSearchProps} from '../Input';
|
|
3
|
+
|
|
4
|
+
export type HeaderType = 'default' | 'surface' | 'extended' | 'search' | 'none';
|
|
5
|
+
|
|
1
6
|
export type GridContextProps = {
|
|
2
7
|
/**
|
|
3
8
|
* Represents the number of columns in the grid.
|
|
@@ -9,11 +14,6 @@ export type GridContextProps = {
|
|
|
9
14
|
*/
|
|
10
15
|
gutterSize: number;
|
|
11
16
|
|
|
12
|
-
/**
|
|
13
|
-
* Optional. Represents the margin around the grid.
|
|
14
|
-
*/
|
|
15
|
-
margin?: number;
|
|
16
|
-
|
|
17
17
|
/**
|
|
18
18
|
* Represents the size (width or height) per span number.
|
|
19
19
|
*/
|
|
@@ -24,3 +24,11 @@ export type GridContextProps = {
|
|
|
24
24
|
*/
|
|
25
25
|
getSizeSpan: (span: number) => number;
|
|
26
26
|
};
|
|
27
|
+
|
|
28
|
+
export type AnimatedInputSearchProps = {
|
|
29
|
+
animatedValue: Animated.Value;
|
|
30
|
+
headerRightWidth: number;
|
|
31
|
+
heightHeader: number;
|
|
32
|
+
headerType: HeaderType;
|
|
33
|
+
inputSearchProps?: InputSearchProps;
|
|
34
|
+
};
|
package/Layout/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Alert, Dimensions} from 'react-native';
|
|
2
1
|
import React, {Fragment, ReactElement, useEffect, useState} from 'react';
|
|
2
|
+
import {Dimensions} from 'react-native';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* validate children type
|
|
@@ -8,25 +8,20 @@ import React, {Fragment, ReactElement, useEffect, useState} from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
const validateChildren = (
|
|
10
10
|
children: React.ReactNode | React.ReactNode[],
|
|
11
|
-
childrenTypes: Array<React.
|
|
11
|
+
childrenTypes: Array<React.ReactNode>,
|
|
12
12
|
) => {
|
|
13
|
-
if (!__DEV__) return children;
|
|
14
|
-
|
|
15
13
|
const validateType = (child: React.ReactElement) => {
|
|
16
14
|
const valid = childrenTypes.some(
|
|
17
|
-
childrenType => child?.type === childrenType || child?.type
|
|
15
|
+
childrenType => child?.type === childrenType || child?.type === Fragment,
|
|
18
16
|
);
|
|
19
17
|
if (!valid) {
|
|
20
|
-
|
|
21
|
-
'Component Kits',
|
|
18
|
+
console.warn(
|
|
22
19
|
`Wrong children type for this component, expected are ${childrenTypes
|
|
23
|
-
.map(
|
|
20
|
+
.map(item => item)
|
|
24
21
|
.join(', ')}.`,
|
|
25
22
|
);
|
|
26
23
|
}
|
|
27
|
-
return valid;
|
|
28
24
|
};
|
|
29
|
-
|
|
30
25
|
if (Array.isArray(children)) {
|
|
31
26
|
const flattenChildren: React.ReactElement[] = children.flat();
|
|
32
27
|
for (const child of flattenChildren) {
|
|
@@ -47,7 +42,7 @@ const useGridSystem = () => {
|
|
|
47
42
|
useEffect(() => {
|
|
48
43
|
const subscription: any = Dimensions.addEventListener('change', () => {
|
|
49
44
|
const newColumns = Dimensions.get('window').width > 600 ? 24 : 12;
|
|
50
|
-
if (newColumns
|
|
45
|
+
if (newColumns !== numberOfColumns) {
|
|
51
46
|
setNumberOfColumns(newColumns);
|
|
52
47
|
}
|
|
53
48
|
});
|
|
@@ -57,4 +52,4 @@ const useGridSystem = () => {
|
|
|
57
52
|
return {numberOfColumns};
|
|
58
53
|
};
|
|
59
54
|
|
|
60
|
-
export {
|
|
55
|
+
export {useGridSystem, validateChildren};
|
package/Loader/index.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {ApplicationContext} from '../Application';
|
|
|
9
9
|
const PaginationDot: FC<ChildPaginationProps> = ({
|
|
10
10
|
dataLength = 2,
|
|
11
11
|
activeIndex = 0,
|
|
12
|
+
style,
|
|
12
13
|
}) => {
|
|
13
14
|
const {theme} = useContext(ApplicationContext);
|
|
14
15
|
const renderDots = () => {
|
|
@@ -27,7 +28,11 @@ const PaginationDot: FC<ChildPaginationProps> = ({
|
|
|
27
28
|
}
|
|
28
29
|
return dots;
|
|
29
30
|
};
|
|
30
|
-
return
|
|
31
|
+
return (
|
|
32
|
+
<View style={[style, styles.row]}>
|
|
33
|
+
<View style={styles.paginationPinkContainer}>{renderDots()}</View>
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
export default PaginationDot;
|
|
@@ -8,12 +8,15 @@ import {Colors} from '../Consts';
|
|
|
8
8
|
const PaginationNumber: FC<ChildPaginationProps> = ({
|
|
9
9
|
activeIndex = 0,
|
|
10
10
|
dataLength = 2,
|
|
11
|
+
style,
|
|
11
12
|
}) => {
|
|
12
13
|
return (
|
|
13
|
-
<View style={[styles.
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<View style={[style, styles.row]}>
|
|
15
|
+
<View style={styles.paginationNumberContainer}>
|
|
16
|
+
<Text color={Colors.black_01} typography={'label_default_medium'}>{`${
|
|
17
|
+
activeIndex + 1
|
|
18
|
+
}/${dataLength}`}</Text>
|
|
19
|
+
</View>
|
|
17
20
|
</View>
|
|
18
21
|
);
|
|
19
22
|
};
|
|
@@ -8,6 +8,7 @@ import {Colors, Spacing} from '../Consts';
|
|
|
8
8
|
const PaginationWhiteDot: FC<ChildPaginationProps> = ({
|
|
9
9
|
dataLength = 2,
|
|
10
10
|
activeIndex = 0,
|
|
11
|
+
style,
|
|
11
12
|
}) => {
|
|
12
13
|
const renderDots = () => {
|
|
13
14
|
const dots: React.ReactElement[] = [];
|
|
@@ -24,7 +25,11 @@ const PaginationWhiteDot: FC<ChildPaginationProps> = ({
|
|
|
24
25
|
}
|
|
25
26
|
return dots;
|
|
26
27
|
};
|
|
27
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
<View style={[style, styles.row]}>
|
|
30
|
+
<View style={styles.paginationWhiteContainer}>{renderDots()}</View>
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
export default PaginationWhiteDot;
|
package/Pagination/styles.ts
CHANGED
|
@@ -25,6 +25,8 @@ export default StyleSheet.create({
|
|
|
25
25
|
paddingHorizontal: Spacing.S,
|
|
26
26
|
borderRadius: Radius.L,
|
|
27
27
|
backgroundColor: Colors.black_20 + '33',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center',
|
|
28
30
|
},
|
|
29
31
|
scrollContainer: {
|
|
30
32
|
alignItems: 'center',
|
|
@@ -44,4 +46,5 @@ export default StyleSheet.create({
|
|
|
44
46
|
height: 4,
|
|
45
47
|
borderRadius: Radius.XS,
|
|
46
48
|
},
|
|
49
|
+
row: {flexDirection: 'row'},
|
|
47
50
|
});
|