dhre-ui-kit 0.0.8 → 0.0.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/package.json +2 -1
- package/src/components/accordion/Accordion.styles.ts +1 -0
- package/src/components/bottomDrawer/BottomDrawer.interface.ts +2 -0
- package/src/components/bottomDrawer/BottomDrawer.styles.ts +1 -0
- package/src/components/bottomDrawer/BottomDrawer.tsx +8 -0
- package/src/components/customIcon/CustomIcon.styles.ts +0 -1
- package/src/components/swipableList/SwipableList.interface.ts +12 -1
- package/src/components/swipableList/SwipableList.styles.ts +4 -5
- package/src/components/swipableList/SwipableList.test.tsx +102 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dhre-ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"prepare": "husky"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@react-native-community/blur": "^4.4.1",
|
|
25
26
|
"@testing-library/react-native": "^12.5.1",
|
|
26
27
|
"lint-staged": "^15.2.7",
|
|
27
28
|
"react": "18.2.0",
|
|
@@ -9,6 +9,8 @@ export interface BottomDrawerProps {
|
|
|
9
9
|
testID?: string;
|
|
10
10
|
style?: ViewStyle;
|
|
11
11
|
modalContainerStyle?: ViewStyle;
|
|
12
|
+
blurAmount?: number;
|
|
13
|
+
blurViewStyle?: ViewStyle;
|
|
12
14
|
leftIcon?: React.ReactElement;
|
|
13
15
|
rightIcon?: React.ReactElement;
|
|
14
16
|
showLeftIcon?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {View, Modal} from 'react-native';
|
|
3
|
+
import {BlurView} from '@react-native-community/blur';
|
|
3
4
|
import {BottomDrawerProps} from './BottomDrawer.interface';
|
|
4
5
|
import styles from './BottomDrawer.styles';
|
|
5
6
|
import CustomTypography from '../customTypography/CustomTypography';
|
|
@@ -14,6 +15,8 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
|
|
|
14
15
|
testID = 'BOTTOM-DRAWER',
|
|
15
16
|
style,
|
|
16
17
|
modalContainerStyle,
|
|
18
|
+
blurAmount = 10,
|
|
19
|
+
blurViewStyle,
|
|
17
20
|
showLeftIcon = false,
|
|
18
21
|
showRightIcon = true,
|
|
19
22
|
leftIcon = <ArrowLeft />,
|
|
@@ -27,6 +30,11 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
|
|
|
27
30
|
visible={isModalVisible}
|
|
28
31
|
onRequestClose={toggleModal}>
|
|
29
32
|
<View style={[styles.mainContainer, style]} testID={testID}>
|
|
33
|
+
<BlurView
|
|
34
|
+
style={[styles.blurView, blurViewStyle]}
|
|
35
|
+
blurType="light"
|
|
36
|
+
blurAmount={blurAmount}
|
|
37
|
+
/>
|
|
30
38
|
<View style={[styles.modalContainer, modalContainerStyle]}>
|
|
31
39
|
<View style={styles.separator} />
|
|
32
40
|
<View style={styles.headerContainer}>
|
|
@@ -3,9 +3,20 @@ import {TextStyle, ViewStyle} from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
export interface ListItem {
|
|
5
5
|
id: string;
|
|
6
|
+
templateId: number;
|
|
6
7
|
title: string;
|
|
7
|
-
|
|
8
|
+
subTitle: string;
|
|
9
|
+
icon: string;
|
|
8
10
|
isRead: boolean;
|
|
11
|
+
isPinned: boolean;
|
|
12
|
+
isDeleted: boolean;
|
|
13
|
+
isActionable: boolean;
|
|
14
|
+
category: string;
|
|
15
|
+
url: string;
|
|
16
|
+
channel: string;
|
|
17
|
+
status: string;
|
|
18
|
+
createdBy: string;
|
|
19
|
+
createdDateTime: string;
|
|
9
20
|
}
|
|
10
21
|
|
|
11
22
|
export interface ActionButtonProps {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {horizontalScale, verticalScale} from '../../utils/stylehelper';
|
|
2
2
|
import {StyleSheet} from 'react-native';
|
|
3
3
|
|
|
4
4
|
export const styles = StyleSheet.create({
|
|
@@ -9,19 +9,18 @@ export const styles = StyleSheet.create({
|
|
|
9
9
|
actionButton: {
|
|
10
10
|
justifyContent: 'center',
|
|
11
11
|
alignItems: 'center',
|
|
12
|
-
paddingHorizontal: moderateScale(24),
|
|
13
|
-
paddingVertical: moderateScale(8),
|
|
14
12
|
},
|
|
15
13
|
titleStyle: {
|
|
16
14
|
color: '#fff',
|
|
17
15
|
},
|
|
18
16
|
leftActions: {
|
|
19
17
|
flexDirection: 'row',
|
|
20
|
-
|
|
18
|
+
gap: horizontalScale(24),
|
|
19
|
+
paddingHorizontal: horizontalScale(24),
|
|
21
20
|
},
|
|
22
21
|
rightActions: {
|
|
23
22
|
flexDirection: 'row',
|
|
24
|
-
|
|
23
|
+
paddingHorizontal: horizontalScale(24),
|
|
25
24
|
},
|
|
26
25
|
seprator: {
|
|
27
26
|
height: verticalScale(16),
|
|
@@ -35,18 +35,114 @@ const customStyle = {backgroundColor: 'red', padding: 20};
|
|
|
35
35
|
|
|
36
36
|
describe('Notification Component', () => {
|
|
37
37
|
const notifications = [
|
|
38
|
-
{
|
|
39
|
-
|
|
38
|
+
{
|
|
39
|
+
id: '1',
|
|
40
|
+
title: 'Notification 1',
|
|
41
|
+
isPinned: false,
|
|
42
|
+
isRead: true,
|
|
43
|
+
templateId: 1,
|
|
44
|
+
subTitle: 'Welcome Albus',
|
|
45
|
+
icon: 'https://svgshare.com/i/U7z.svg',
|
|
46
|
+
isDeleted: false,
|
|
47
|
+
isActionable: false,
|
|
48
|
+
category: 'general',
|
|
49
|
+
url: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIzIiBmaWxsPSJyZWQiIC8+Cjwvc3ZnPg==',
|
|
50
|
+
channel: 'push',
|
|
51
|
+
status: 'sent',
|
|
52
|
+
createdBy: 'system',
|
|
53
|
+
createdDateTime: '2024-09-02T12:00:00+05:30',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: '2',
|
|
57
|
+
title: 'Notification 2',
|
|
58
|
+
isPinned: true,
|
|
59
|
+
isRead: false,
|
|
60
|
+
templateId: 1,
|
|
61
|
+
subTitle: 'Welcome Albus',
|
|
62
|
+
icon: 'https://svgshare.com/i/U7z.svg',
|
|
63
|
+
isDeleted: false,
|
|
64
|
+
isActionable: false,
|
|
65
|
+
category: 'general',
|
|
66
|
+
url: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIzIiBmaWxsPSJyZWQiIC8+Cjwvc3ZnPg==',
|
|
67
|
+
channel: 'push',
|
|
68
|
+
status: 'sent',
|
|
69
|
+
createdBy: 'system',
|
|
70
|
+
createdDateTime: '2024-09-02T12:00:00+05:30',
|
|
71
|
+
},
|
|
40
72
|
];
|
|
41
73
|
|
|
42
74
|
const notificationsPinned = [
|
|
43
|
-
{
|
|
44
|
-
|
|
75
|
+
{
|
|
76
|
+
id: '1',
|
|
77
|
+
title: 'Notification 1',
|
|
78
|
+
isPinned: true,
|
|
79
|
+
isRead: true,
|
|
80
|
+
templateId: 1,
|
|
81
|
+
subTitle: 'Welcome Albus',
|
|
82
|
+
icon: 'https://svgshare.com/i/U7z.svg',
|
|
83
|
+
isDeleted: false,
|
|
84
|
+
isActionable: false,
|
|
85
|
+
category: 'general',
|
|
86
|
+
url: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIzIiBmaWxsPSJyZWQiIC8+Cjwvc3ZnPg==',
|
|
87
|
+
channel: 'push',
|
|
88
|
+
status: 'sent',
|
|
89
|
+
createdBy: 'system',
|
|
90
|
+
createdDateTime: '2024-09-02T12:00:00+05:30',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: '2',
|
|
94
|
+
title: 'Notification 2',
|
|
95
|
+
isPinned: false,
|
|
96
|
+
isRead: false,
|
|
97
|
+
templateId: 1,
|
|
98
|
+
subTitle: 'Welcome Albus',
|
|
99
|
+
icon: 'https://svgshare.com/i/U7z.svg',
|
|
100
|
+
isDeleted: false,
|
|
101
|
+
isActionable: false,
|
|
102
|
+
category: 'general',
|
|
103
|
+
url: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIzIiBmaWxsPSJyZWQiIC8+Cjwvc3ZnPg==',
|
|
104
|
+
channel: 'push',
|
|
105
|
+
status: 'sent',
|
|
106
|
+
createdBy: 'system',
|
|
107
|
+
createdDateTime: '2024-09-02T12:00:00+05:30',
|
|
108
|
+
},
|
|
45
109
|
];
|
|
46
110
|
|
|
47
111
|
const notificationsUnPinned = [
|
|
48
|
-
{
|
|
49
|
-
|
|
112
|
+
{
|
|
113
|
+
id: '1',
|
|
114
|
+
title: 'Notification 1',
|
|
115
|
+
isPinned: false,
|
|
116
|
+
isRead: false,
|
|
117
|
+
templateId: 1,
|
|
118
|
+
subTitle: 'Welcome Albus',
|
|
119
|
+
icon: 'https://svgshare.com/i/U7z.svg',
|
|
120
|
+
isDeleted: false,
|
|
121
|
+
isActionable: false,
|
|
122
|
+
category: 'general',
|
|
123
|
+
url: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIzIiBmaWxsPSJyZWQiIC8+Cjwvc3ZnPg==',
|
|
124
|
+
channel: 'push',
|
|
125
|
+
status: 'sent',
|
|
126
|
+
createdBy: 'system',
|
|
127
|
+
createdDateTime: '2024-09-02T12:00:00+05:30',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: '2',
|
|
131
|
+
title: 'Notification 2',
|
|
132
|
+
isPinned: false,
|
|
133
|
+
isRead: false,
|
|
134
|
+
templateId: 1,
|
|
135
|
+
subTitle: 'Welcome Albus',
|
|
136
|
+
icon: 'https://svgshare.com/i/U7z.svg',
|
|
137
|
+
isDeleted: false,
|
|
138
|
+
isActionable: false,
|
|
139
|
+
category: 'general',
|
|
140
|
+
url: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIzIiBmaWxsPSJyZWQiIC8+Cjwvc3ZnPg==',
|
|
141
|
+
channel: 'push',
|
|
142
|
+
status: 'sent',
|
|
143
|
+
createdBy: 'system',
|
|
144
|
+
createdDateTime: '2024-09-02T12:00:00+05:30',
|
|
145
|
+
},
|
|
50
146
|
];
|
|
51
147
|
|
|
52
148
|
const mockLeftPrimaryActionHandler = jest.fn();
|