@momo-kits/foundation 0.115.3-beta.7 → 0.115.3-beta.9
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/Divider/DashDivider.tsx +45 -0
- package/Divider/index.tsx +32 -8
- package/package.json +3 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {View, ViewStyle} from 'react-native';
|
|
3
|
+
import {ApplicationContext} from '../Application';
|
|
4
|
+
import {Spacing} from '../Consts';
|
|
5
|
+
import Svg, {Line} from 'react-native-svg';
|
|
6
|
+
|
|
7
|
+
export interface DashDividerProps {
|
|
8
|
+
/**
|
|
9
|
+
* Custom styles for dash divider
|
|
10
|
+
*/
|
|
11
|
+
style?: ViewStyle;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const DashDivider: React.FC<DashDividerProps> = ({style}) => {
|
|
15
|
+
const {theme} = useContext(ApplicationContext);
|
|
16
|
+
const borderColor = theme.colors.border.default;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<View
|
|
20
|
+
style={[
|
|
21
|
+
{
|
|
22
|
+
width: '100%',
|
|
23
|
+
height: 1,
|
|
24
|
+
marginVertical: Spacing.XS,
|
|
25
|
+
},
|
|
26
|
+
style,
|
|
27
|
+
]}>
|
|
28
|
+
<Svg height="1" width="100%">
|
|
29
|
+
<Line
|
|
30
|
+
x1="0"
|
|
31
|
+
y1="0"
|
|
32
|
+
x2="100%"
|
|
33
|
+
y2="0"
|
|
34
|
+
stroke={borderColor}
|
|
35
|
+
strokeWidth="1"
|
|
36
|
+
strokeDasharray={`4, 4`}
|
|
37
|
+
strokeLinecap={'round'}
|
|
38
|
+
strokeLinejoin={'miter'}
|
|
39
|
+
/>
|
|
40
|
+
</Svg>
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export {DashDivider};
|
package/Divider/index.tsx
CHANGED
|
@@ -1,19 +1,43 @@
|
|
|
1
1
|
import React, {useContext} from 'react';
|
|
2
|
-
import {View} from 'react-native';
|
|
2
|
+
import {View, ViewStyle} from 'react-native';
|
|
3
3
|
import {ApplicationContext} from '../Application';
|
|
4
4
|
import {Spacing} from '../Consts';
|
|
5
|
+
import {DashDivider} from './DashDivider';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export interface DividerProps {
|
|
8
|
+
/**
|
|
9
|
+
* Custom styles for divider
|
|
10
|
+
*/
|
|
11
|
+
style?: ViewStyle;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Enable margin vertical 4px
|
|
15
|
+
*/
|
|
16
|
+
useMargin?: boolean;
|
|
17
|
+
|
|
18
|
+
type?: 'dash' | 'default';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Divider: React.FC<DividerProps> = ({
|
|
22
|
+
style,
|
|
23
|
+
useMargin = true,
|
|
24
|
+
type = 'default',
|
|
25
|
+
}) => {
|
|
7
26
|
const {theme} = useContext(ApplicationContext);
|
|
8
27
|
|
|
28
|
+
if (type === 'dash') return <DashDivider style={style} />;
|
|
29
|
+
|
|
9
30
|
return (
|
|
10
31
|
<View
|
|
11
|
-
style={
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
style={[
|
|
33
|
+
style,
|
|
34
|
+
{
|
|
35
|
+
height: 1,
|
|
36
|
+
width: '100%',
|
|
37
|
+
backgroundColor: theme.colors.border.default,
|
|
38
|
+
marginVertical: useMargin ? Spacing.XS : 0,
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
17
41
|
/>
|
|
18
42
|
);
|
|
19
43
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.115.3-beta.
|
|
3
|
+
"version": "0.115.3-beta.9",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {},
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"@react-navigation/routers": "5.7.4",
|
|
21
21
|
"react-native-reanimated": "git+https://gitlab.mservice.com.vn/momo-platform/react-native-reanimated.git#v1.13.4_gradle_7",
|
|
22
22
|
"lottie-react-native": "git+https://gitlab.mservice.com.vn/momo-platform/momo-lottie-react-native.git",
|
|
23
|
-
"@react-navigation/stack": "https://gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
|
|
23
|
+
"@react-navigation/stack": "https://gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git",
|
|
24
|
+
"react-native-svg": "git+https://gitlab.mservice.com.vn/momo-platform/react-native-svg.git#v12.1.0.public"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"react-native": "*"
|