be-components 7.6.3 → 7.6.4
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/lib/commonjs/NotificationManager/NotificationManagerTabs.js +188 -0
- package/lib/commonjs/NotificationManager/NotificationManagerTabs.js.map +1 -0
- package/lib/commonjs/NotificationManager/api/index.js +235 -6
- package/lib/commonjs/NotificationManager/api/index.js.map +1 -1
- package/lib/commonjs/NotificationManager/components/GroupManagement.js +1038 -0
- package/lib/commonjs/NotificationManager/components/GroupManagement.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/JobManagement.js +783 -0
- package/lib/commonjs/NotificationManager/components/JobManagement.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/ScheduleNotification.js +407 -0
- package/lib/commonjs/NotificationManager/components/ScheduleNotification.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/index.js +56 -0
- package/lib/commonjs/NotificationManager/components/index.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/shared/DateTimePicker.js +113 -0
- package/lib/commonjs/NotificationManager/components/shared/DateTimePicker.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/shared/GroupSelector.js +191 -0
- package/lib/commonjs/NotificationManager/components/shared/GroupSelector.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/shared/NotificationBuilderForm.js +509 -0
- package/lib/commonjs/NotificationManager/components/shared/NotificationBuilderForm.js.map +1 -0
- package/lib/commonjs/NotificationManager/components/shared/StatusBadge.js +69 -0
- package/lib/commonjs/NotificationManager/components/shared/StatusBadge.js.map +1 -0
- package/lib/commonjs/NotificationManager/index.js +38 -23
- package/lib/commonjs/NotificationManager/index.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.d.js +2 -0
- package/lib/commonjs/types.d.js.map +1 -1
- package/lib/module/NotificationManager/NotificationManagerTabs.js +180 -0
- package/lib/module/NotificationManager/NotificationManagerTabs.js.map +1 -0
- package/lib/module/NotificationManager/api/index.js +235 -6
- package/lib/module/NotificationManager/api/index.js.map +1 -1
- package/lib/module/NotificationManager/components/GroupManagement.js +1030 -0
- package/lib/module/NotificationManager/components/GroupManagement.js.map +1 -0
- package/lib/module/NotificationManager/components/JobManagement.js +775 -0
- package/lib/module/NotificationManager/components/JobManagement.js.map +1 -0
- package/lib/module/NotificationManager/components/ScheduleNotification.js +399 -0
- package/lib/module/NotificationManager/components/ScheduleNotification.js.map +1 -0
- package/lib/module/NotificationManager/components/index.js +8 -0
- package/lib/module/NotificationManager/components/index.js.map +1 -0
- package/lib/module/NotificationManager/components/shared/DateTimePicker.js +106 -0
- package/lib/module/NotificationManager/components/shared/DateTimePicker.js.map +1 -0
- package/lib/module/NotificationManager/components/shared/GroupSelector.js +184 -0
- package/lib/module/NotificationManager/components/shared/GroupSelector.js.map +1 -0
- package/lib/module/NotificationManager/components/shared/NotificationBuilderForm.js +501 -0
- package/lib/module/NotificationManager/components/shared/NotificationBuilderForm.js.map +1 -0
- package/lib/module/NotificationManager/components/shared/StatusBadge.js +62 -0
- package/lib/module/NotificationManager/components/shared/StatusBadge.js.map +1 -0
- package/lib/module/NotificationManager/index.js +32 -23
- package/lib/module/NotificationManager/index.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.d.js +2 -0
- package/lib/module/types.d.js.map +1 -1
- package/lib/typescript/lib/commonjs/NotificationManager/NotificationManagerTabs.d.ts +17 -0
- package/lib/typescript/lib/commonjs/NotificationManager/NotificationManagerTabs.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/api/index.d.ts +17 -2
- package/lib/typescript/lib/commonjs/NotificationManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/NotificationManager/components/GroupManagement.d.ts +6 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/GroupManagement.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/JobManagement.d.ts +7 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/JobManagement.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/ScheduleNotification.d.ts +8 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/ScheduleNotification.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/DateTimePicker.d.ts +9 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/DateTimePicker.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/GroupSelector.d.ts +13 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/GroupSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/NotificationBuilderForm.d.ts +10 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/NotificationBuilderForm.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/StatusBadge.d.ts +6 -0
- package/lib/typescript/lib/commonjs/NotificationManager/components/shared/StatusBadge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/NotificationManager/index.d.ts +18 -2
- package/lib/typescript/lib/commonjs/NotificationManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/index.d.ts +18 -2
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/NotificationManager/NotificationManagerTabs.d.ts +17 -0
- package/lib/typescript/lib/module/NotificationManager/NotificationManagerTabs.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/api/index.d.ts +17 -2
- package/lib/typescript/lib/module/NotificationManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/NotificationManager/components/GroupManagement.d.ts +6 -0
- package/lib/typescript/lib/module/NotificationManager/components/GroupManagement.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/JobManagement.d.ts +7 -0
- package/lib/typescript/lib/module/NotificationManager/components/JobManagement.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/ScheduleNotification.d.ts +8 -0
- package/lib/typescript/lib/module/NotificationManager/components/ScheduleNotification.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/index.d.ts +8 -0
- package/lib/typescript/lib/module/NotificationManager/components/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/DateTimePicker.d.ts +9 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/DateTimePicker.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/GroupSelector.d.ts +13 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/GroupSelector.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/NotificationBuilderForm.d.ts +10 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/NotificationBuilderForm.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/StatusBadge.d.ts +6 -0
- package/lib/typescript/lib/module/NotificationManager/components/shared/StatusBadge.d.ts.map +1 -0
- package/lib/typescript/lib/module/NotificationManager/index.d.ts +1 -0
- package/lib/typescript/lib/module/NotificationManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +2 -1
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/NotificationManager/NotificationManagerTabs.d.ts +20 -0
- package/lib/typescript/src/NotificationManager/NotificationManagerTabs.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/api/index.d.ts +74 -3
- package/lib/typescript/src/NotificationManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/NotificationManager/components/GroupManagement.d.ts +8 -0
- package/lib/typescript/src/NotificationManager/components/GroupManagement.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/JobManagement.d.ts +9 -0
- package/lib/typescript/src/NotificationManager/components/JobManagement.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/ScheduleNotification.d.ts +10 -0
- package/lib/typescript/src/NotificationManager/components/ScheduleNotification.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/index.d.ts +8 -0
- package/lib/typescript/src/NotificationManager/components/index.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/shared/DateTimePicker.d.ts +12 -0
- package/lib/typescript/src/NotificationManager/components/shared/DateTimePicker.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/shared/GroupSelector.d.ts +16 -0
- package/lib/typescript/src/NotificationManager/components/shared/GroupSelector.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/shared/NotificationBuilderForm.d.ts +12 -0
- package/lib/typescript/src/NotificationManager/components/shared/NotificationBuilderForm.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/components/shared/StatusBadge.d.ts +8 -0
- package/lib/typescript/src/NotificationManager/components/shared/StatusBadge.d.ts.map +1 -0
- package/lib/typescript/src/NotificationManager/index.d.ts +1 -0
- package/lib/typescript/src/NotificationManager/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NotificationManager/NotificationManagerTabs.tsx +178 -0
- package/src/NotificationManager/api/index.ts +239 -6
- package/src/NotificationManager/components/GroupManagement.tsx +854 -0
- package/src/NotificationManager/components/JobManagement.tsx +569 -0
- package/src/NotificationManager/components/ScheduleNotification.tsx +388 -0
- package/src/NotificationManager/components/index.ts +7 -0
- package/src/NotificationManager/components/shared/DateTimePicker.tsx +94 -0
- package/src/NotificationManager/components/shared/GroupSelector.tsx +130 -0
- package/src/NotificationManager/components/shared/NotificationBuilderForm.tsx +364 -0
- package/src/NotificationManager/components/shared/StatusBadge.tsx +72 -0
- package/src/NotificationManager/index.tsx +43 -24
- package/src/index.tsx +2 -0
- package/src/types.d.ts +38 -3
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FlatList, TouchableOpacity, ActivityIndicator } from 'react-native';
|
|
3
|
+
import { View, Text, Button } from '../../../Components/Themed';
|
|
4
|
+
import { useColors } from '../../../constants/useColors';
|
|
5
|
+
const GroupSelector = ({
|
|
6
|
+
visible,
|
|
7
|
+
onClose,
|
|
8
|
+
onSelectGroup,
|
|
9
|
+
groups,
|
|
10
|
+
loading = false,
|
|
11
|
+
selectedGroup,
|
|
12
|
+
showCustomOption = true,
|
|
13
|
+
customGroup
|
|
14
|
+
}) => {
|
|
15
|
+
const Colors = useColors();
|
|
16
|
+
if (!visible) return null;
|
|
17
|
+
|
|
18
|
+
// Combine custom group with regular groups if enabled
|
|
19
|
+
const allGroups = showCustomOption && customGroup ? [customGroup, ...groups] : groups;
|
|
20
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
type: "blur",
|
|
22
|
+
style: {
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
top: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
right: 0,
|
|
27
|
+
bottom: 0,
|
|
28
|
+
padding: 20
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
31
|
+
float: true,
|
|
32
|
+
style: {
|
|
33
|
+
flex: 1
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
36
|
+
type: "header",
|
|
37
|
+
style: {
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
padding: 10,
|
|
41
|
+
borderTopRightRadius: 8,
|
|
42
|
+
borderTopLeftRadius: 8
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
transparent: true,
|
|
46
|
+
style: {
|
|
47
|
+
flex: 1
|
|
48
|
+
}
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
50
|
+
theme: "h1"
|
|
51
|
+
}, "Notification Groups"), /*#__PURE__*/React.createElement(Text, {
|
|
52
|
+
theme: "description",
|
|
53
|
+
style: {
|
|
54
|
+
marginTop: 3
|
|
55
|
+
}
|
|
56
|
+
}, "Select a group to send to"))), /*#__PURE__*/React.createElement(View, {
|
|
57
|
+
style: {
|
|
58
|
+
flex: 1
|
|
59
|
+
}
|
|
60
|
+
}, loading ? /*#__PURE__*/React.createElement(View, {
|
|
61
|
+
style: {
|
|
62
|
+
padding: 40,
|
|
63
|
+
alignItems: 'center'
|
|
64
|
+
}
|
|
65
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
66
|
+
size: "large",
|
|
67
|
+
color: Colors.text.action
|
|
68
|
+
})) : /*#__PURE__*/React.createElement(FlatList, {
|
|
69
|
+
data: allGroups,
|
|
70
|
+
keyExtractor: item => item.notification_group_id,
|
|
71
|
+
renderItem: ({
|
|
72
|
+
item
|
|
73
|
+
}) => {
|
|
74
|
+
const isSelected = selectedGroup?.notification_group_id === item.notification_group_id;
|
|
75
|
+
const isCustom = item.notification_group_id === 'custom_group';
|
|
76
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
77
|
+
onPress: () => {
|
|
78
|
+
onSelectGroup(item);
|
|
79
|
+
onClose();
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
padding: 15,
|
|
83
|
+
borderBottomWidth: 1,
|
|
84
|
+
borderColor: Colors.borders.light,
|
|
85
|
+
backgroundColor: isSelected ? Colors.views.header : 'transparent'
|
|
86
|
+
}
|
|
87
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
transparent: true
|
|
89
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
90
|
+
transparent: true,
|
|
91
|
+
style: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
justifyContent: 'space-between'
|
|
95
|
+
}
|
|
96
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
97
|
+
transparent: true,
|
|
98
|
+
style: {
|
|
99
|
+
flexDirection: 'row',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
flex: 1
|
|
102
|
+
}
|
|
103
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
104
|
+
theme: "h1"
|
|
105
|
+
}, item.name), isCustom && /*#__PURE__*/React.createElement(View, {
|
|
106
|
+
transparent: true,
|
|
107
|
+
style: {
|
|
108
|
+
marginLeft: 8,
|
|
109
|
+
paddingHorizontal: 6,
|
|
110
|
+
paddingVertical: 2,
|
|
111
|
+
backgroundColor: Colors.buttons.background.action,
|
|
112
|
+
borderRadius: 4
|
|
113
|
+
}
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
115
|
+
theme: "description",
|
|
116
|
+
color: Colors.text.white,
|
|
117
|
+
style: {
|
|
118
|
+
fontSize: 10
|
|
119
|
+
}
|
|
120
|
+
}, "CUSTOM")), isSelected && /*#__PURE__*/React.createElement(View, {
|
|
121
|
+
transparent: true,
|
|
122
|
+
style: {
|
|
123
|
+
marginLeft: 8,
|
|
124
|
+
paddingHorizontal: 6,
|
|
125
|
+
paddingVertical: 2,
|
|
126
|
+
backgroundColor: Colors.text.success,
|
|
127
|
+
borderRadius: 4
|
|
128
|
+
}
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
130
|
+
theme: "description",
|
|
131
|
+
color: Colors.text.white,
|
|
132
|
+
style: {
|
|
133
|
+
fontSize: 10
|
|
134
|
+
}
|
|
135
|
+
}, "SELECTED"))), item.player_count !== undefined && /*#__PURE__*/React.createElement(View, {
|
|
136
|
+
transparent: true,
|
|
137
|
+
style: {
|
|
138
|
+
marginLeft: 8,
|
|
139
|
+
paddingHorizontal: 8,
|
|
140
|
+
paddingVertical: 4,
|
|
141
|
+
backgroundColor: Colors.views.header,
|
|
142
|
+
borderRadius: 4
|
|
143
|
+
}
|
|
144
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
145
|
+
theme: "description",
|
|
146
|
+
style: {
|
|
147
|
+
fontSize: 12,
|
|
148
|
+
fontWeight: '600'
|
|
149
|
+
}
|
|
150
|
+
}, item.player_count.toLocaleString(), " users"))), item.description && /*#__PURE__*/React.createElement(Text, {
|
|
151
|
+
theme: "description",
|
|
152
|
+
style: {
|
|
153
|
+
marginTop: 4
|
|
154
|
+
}
|
|
155
|
+
}, item.description)));
|
|
156
|
+
},
|
|
157
|
+
ListEmptyComponent: /*#__PURE__*/React.createElement(View, {
|
|
158
|
+
style: {
|
|
159
|
+
padding: 40,
|
|
160
|
+
alignItems: 'center'
|
|
161
|
+
}
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
163
|
+
theme: "description"
|
|
164
|
+
}, "No groups found"))
|
|
165
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
166
|
+
type: "footer",
|
|
167
|
+
style: {
|
|
168
|
+
flexDirection: 'row',
|
|
169
|
+
alignItems: 'center',
|
|
170
|
+
padding: 10,
|
|
171
|
+
borderBottomRightRadius: 8,
|
|
172
|
+
borderBottomLeftRadius: 8
|
|
173
|
+
}
|
|
174
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
175
|
+
style: {
|
|
176
|
+
flex: 1
|
|
177
|
+
},
|
|
178
|
+
type: "close",
|
|
179
|
+
title: "CLOSE",
|
|
180
|
+
onPress: onClose
|
|
181
|
+
}))));
|
|
182
|
+
};
|
|
183
|
+
export default GroupSelector;
|
|
184
|
+
//# sourceMappingURL=GroupSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","FlatList","TouchableOpacity","ActivityIndicator","View","Text","Button","useColors","GroupSelector","visible","onClose","onSelectGroup","groups","loading","selectedGroup","showCustomOption","customGroup","Colors","allGroups","createElement","type","style","position","top","left","right","bottom","padding","float","flex","flexDirection","alignItems","borderTopRightRadius","borderTopLeftRadius","transparent","theme","marginTop","size","color","text","action","data","keyExtractor","item","notification_group_id","renderItem","isSelected","isCustom","onPress","borderBottomWidth","borderColor","borders","light","backgroundColor","views","header","justifyContent","name","marginLeft","paddingHorizontal","paddingVertical","buttons","background","borderRadius","white","fontSize","success","player_count","undefined","fontWeight","toLocaleString","description","ListEmptyComponent","borderBottomRightRadius","borderBottomLeftRadius","title"],"sourceRoot":"../../../../../src","sources":["NotificationManager/components/shared/GroupSelector.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,gBAAgB,EAAEC,iBAAiB,QAAQ,cAAc;AAC5E,SAASC,IAAI,EAAEC,IAAI,EAAEC,MAAM,QAAQ,4BAA4B;AAC/D,SAASC,SAAS,QAAQ,8BAA8B;AAexD,MAAMC,aAAa,GAAGA,CAAC;EACnBC,OAAO;EACPC,OAAO;EACPC,aAAa;EACbC,MAAM;EACNC,OAAO,GAAG,KAAK;EACfC,aAAa;EACbC,gBAAgB,GAAG,IAAI;EACvBC;AACgB,CAAC,KAAK;EACtB,MAAMC,MAAM,GAAGV,SAAS,CAAC,CAAC;EAE1B,IAAI,CAACE,OAAO,EAAE,OAAO,IAAI;;EAEzB;EACA,MAAMS,SAAS,GAAGH,gBAAgB,IAAIC,WAAW,GAC3C,CAACA,WAAW,EAAE,GAAGJ,MAAM,CAAC,GACxBA,MAAM;EAEZ,oBACIZ,KAAA,CAAAmB,aAAA,CAACf,IAAI;IAACgB,IAAI,EAAC,MAAM;IAACC,KAAK,EAAE;MAAEC,QAAQ,EAAE,UAAU;MAAEC,GAAG,EAAE,CAAC;MAAEC,IAAI,EAAE,CAAC;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAG;EAAE,gBACjG3B,KAAA,CAAAmB,aAAA,CAACf,IAAI;IAACwB,KAAK;IAACP,KAAK,EAAE;MAAEQ,IAAI,EAAE;IAAE;EAAE,gBAC3B7B,KAAA,CAAAmB,aAAA,CAACf,IAAI;IAACgB,IAAI,EAAC,QAAQ;IAACC,KAAK,EAAE;MAAES,aAAa,EAAE,KAAK;MAAEC,UAAU,EAAE,QAAQ;MAAEJ,OA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MAAS;IAAE,gBAC/C/B,KAAA,CAAAmB,aAAA,CAACd,IAAI;MAAC8B,KAAK,EAAC;IAAa,GAAC,iBAAqB,CAC7C;EACT,CACJ,CAEH,CAAC,eACPnC,KAAA,CAAAmB,aAAA,CAACf,IAAI;IAACgB,IAAI,EAAC,QAAQ;IAACC,KAAK,EAAE;MAAES,aAAa,EAAE,KAAK;MAAEC,UAAU,EAAE,QAAQ;MAAEJ,OAAO,EAAE,EAAE;MAAE8C,uBAAuB,EAAE,CAAC;MAAEC,sBAAsB,EAAE;IAAE;EAAE,gBAC1I1E,KAAA,CAAAmB,aAAA,CAACb,MAAM;IACHe,KAAK,EAAE;MAAEQ,IAAI,EAAE;IAAE,CAAE;IACnBT,IAAI,EAAC,OAAO;IACZuD,KAAK,EAAC,OAAO;IACb3B,OAAO,EAAEtC;EAAQ,CACpB,CACC,CACJ,CACJ,CAAC;AAEf,CAAC;AAED,eAAeF,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
2
|
+
import { FlatList, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { View, Text, TextInput } from '../../../Components/Themed';
|
|
4
|
+
import { useColors } from '../../../constants/useColors';
|
|
5
|
+
import { NotificationHelpers } from '../../api';
|
|
6
|
+
import { Icons } from '../../../Components';
|
|
7
|
+
import DropDown from '../../../Components/Dropdown';
|
|
8
|
+
const notification_types = [{
|
|
9
|
+
label: 'Order Notifications',
|
|
10
|
+
value: 'order_notifications'
|
|
11
|
+
}, {
|
|
12
|
+
label: 'Competition Notifications',
|
|
13
|
+
value: 'competition_notifications'
|
|
14
|
+
}, {
|
|
15
|
+
label: 'Social Notifications',
|
|
16
|
+
value: 'social_notifications'
|
|
17
|
+
}];
|
|
18
|
+
const NotificationBuilderForm = ({
|
|
19
|
+
notification,
|
|
20
|
+
onChange,
|
|
21
|
+
onFocusPosition,
|
|
22
|
+
showPreview = true,
|
|
23
|
+
showType = true
|
|
24
|
+
}) => {
|
|
25
|
+
const Colors = useColors();
|
|
26
|
+
const [pathSearch, setPathSearch] = useState('');
|
|
27
|
+
const [selectedPath, setSelectedPath] = useState(NotificationHelpers.app_paths[0]);
|
|
28
|
+
const [pathParams, setPathParams] = useState({});
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
// Initialize selectedPath from notification options if exists
|
|
31
|
+
if (notification.options?.data?.path_name) {
|
|
32
|
+
const path = NotificationHelpers.app_paths.find(p => p.path_name === notification.options?.data?.path_name);
|
|
33
|
+
if (path) {
|
|
34
|
+
setSelectedPath(path);
|
|
35
|
+
setPathParams(notification.options?.data?.params || {});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}, []);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
// Update notification options when path or params change
|
|
41
|
+
if (selectedPath) {
|
|
42
|
+
const newOptions = {
|
|
43
|
+
...(notification.options || {}),
|
|
44
|
+
id: notification.options?.id || Date.now().toString(),
|
|
45
|
+
body: notification.body || '',
|
|
46
|
+
icon: 'default',
|
|
47
|
+
type: notification.type || 'order_notifications',
|
|
48
|
+
data: {
|
|
49
|
+
...(notification.options?.data || {}),
|
|
50
|
+
id: notification.options?.data?.id || Date.now().toString(),
|
|
51
|
+
player_id: notification.options?.data?.player_id || '',
|
|
52
|
+
pageStack: 'MainStack',
|
|
53
|
+
page: selectedPath.path_name,
|
|
54
|
+
pageParams: pathParams,
|
|
55
|
+
path_name: selectedPath.path_name === 'custom' ? '' : selectedPath.path_name,
|
|
56
|
+
params: pathParams
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
onChange({
|
|
60
|
+
...notification,
|
|
61
|
+
options: newOptions
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}, [selectedPath, pathParams]);
|
|
65
|
+
const filteredPaths = useMemo(() => {
|
|
66
|
+
if (!pathSearch) return [];
|
|
67
|
+
const search = pathSearch.toLowerCase();
|
|
68
|
+
return NotificationHelpers.app_paths.filter(path => path.label.toLowerCase().includes(search) || path.path_name.toLowerCase().includes(search));
|
|
69
|
+
}, [pathSearch]);
|
|
70
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
transparent: true,
|
|
72
|
+
style: {
|
|
73
|
+
flex: 1
|
|
74
|
+
}
|
|
75
|
+
}, showPreview && /*#__PURE__*/React.createElement(View, {
|
|
76
|
+
float: true,
|
|
77
|
+
style: {
|
|
78
|
+
margin: 5
|
|
79
|
+
}
|
|
80
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
81
|
+
type: "header",
|
|
82
|
+
style: {
|
|
83
|
+
flexDirection: 'row',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
padding: 10,
|
|
86
|
+
borderTopRightRadius: 8,
|
|
87
|
+
borderTopLeftRadius: 8
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
90
|
+
transparent: true,
|
|
91
|
+
style: {
|
|
92
|
+
flex: 1
|
|
93
|
+
}
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
95
|
+
theme: "h1"
|
|
96
|
+
}, "Preview"), /*#__PURE__*/React.createElement(Text, {
|
|
97
|
+
theme: "description",
|
|
98
|
+
style: {
|
|
99
|
+
marginTop: 3
|
|
100
|
+
}
|
|
101
|
+
}, "What will this notification look like?"))), /*#__PURE__*/React.createElement(View, {
|
|
102
|
+
float: true,
|
|
103
|
+
style: {
|
|
104
|
+
padding: 15,
|
|
105
|
+
margin: 10,
|
|
106
|
+
borderRadius: 8,
|
|
107
|
+
borderWidth: 1,
|
|
108
|
+
borderColor: Colors.borders.light
|
|
109
|
+
}
|
|
110
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
111
|
+
transparent: true,
|
|
112
|
+
style: {
|
|
113
|
+
flexDirection: 'row',
|
|
114
|
+
alignItems: 'center'
|
|
115
|
+
}
|
|
116
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
117
|
+
style: {
|
|
118
|
+
width: 40,
|
|
119
|
+
height: 40,
|
|
120
|
+
borderRadius: 8,
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
marginRight: 12
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Icons.NotificationIcon, {
|
|
126
|
+
size: 20,
|
|
127
|
+
color: Colors.text.h1
|
|
128
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
129
|
+
transparent: true,
|
|
130
|
+
style: {
|
|
131
|
+
flex: 1
|
|
132
|
+
}
|
|
133
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
134
|
+
theme: "h1"
|
|
135
|
+
}, notification.title || 'Notification Title'), /*#__PURE__*/React.createElement(Text, {
|
|
136
|
+
theme: "description",
|
|
137
|
+
style: {
|
|
138
|
+
marginTop: 4
|
|
139
|
+
}
|
|
140
|
+
}, notification.body || 'Notification message will appear here'))))), /*#__PURE__*/React.createElement(View, {
|
|
141
|
+
style: {
|
|
142
|
+
flexDirection: 'row',
|
|
143
|
+
flexWrap: 'wrap'
|
|
144
|
+
}
|
|
145
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
146
|
+
float: true,
|
|
147
|
+
style: {
|
|
148
|
+
minWidth: 300,
|
|
149
|
+
flexGrow: 1,
|
|
150
|
+
margin: 5
|
|
151
|
+
}
|
|
152
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
153
|
+
type: "header",
|
|
154
|
+
style: {
|
|
155
|
+
flexDirection: 'row',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
padding: 10,
|
|
158
|
+
borderTopRightRadius: 8,
|
|
159
|
+
borderTopLeftRadius: 8
|
|
160
|
+
}
|
|
161
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
162
|
+
transparent: true,
|
|
163
|
+
style: {
|
|
164
|
+
flex: 1
|
|
165
|
+
}
|
|
166
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
167
|
+
theme: "h1"
|
|
168
|
+
}, "Notification Message"), /*#__PURE__*/React.createElement(Text, {
|
|
169
|
+
theme: "description",
|
|
170
|
+
style: {
|
|
171
|
+
marginTop: 3
|
|
172
|
+
}
|
|
173
|
+
}, "Update notification message below"))), /*#__PURE__*/React.createElement(View, {
|
|
174
|
+
transparent: true,
|
|
175
|
+
type: "body"
|
|
176
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
177
|
+
transparent: true,
|
|
178
|
+
style: {
|
|
179
|
+
padding: 10
|
|
180
|
+
}
|
|
181
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
182
|
+
theme: "h2",
|
|
183
|
+
style: {
|
|
184
|
+
marginBottom: 10
|
|
185
|
+
}
|
|
186
|
+
}, "Notification Title"), /*#__PURE__*/React.createElement(TextInput, {
|
|
187
|
+
value: notification.title,
|
|
188
|
+
onFocusPosition: onFocusPosition,
|
|
189
|
+
placeholder: "Enter notification title",
|
|
190
|
+
onChangeText: title => onChange({
|
|
191
|
+
...notification,
|
|
192
|
+
title
|
|
193
|
+
})
|
|
194
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
195
|
+
transparent: true,
|
|
196
|
+
style: {
|
|
197
|
+
padding: 10
|
|
198
|
+
}
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
200
|
+
theme: "h2",
|
|
201
|
+
style: {
|
|
202
|
+
marginBottom: 10
|
|
203
|
+
}
|
|
204
|
+
}, "Notification Body"), /*#__PURE__*/React.createElement(TextInput, {
|
|
205
|
+
value: notification.body,
|
|
206
|
+
onFocusPosition: onFocusPosition,
|
|
207
|
+
placeholder: "Enter notification message",
|
|
208
|
+
onChangeText: body => onChange({
|
|
209
|
+
...notification,
|
|
210
|
+
body
|
|
211
|
+
}),
|
|
212
|
+
multiline: true,
|
|
213
|
+
numberOfLines: 6,
|
|
214
|
+
style: {
|
|
215
|
+
padding: 12,
|
|
216
|
+
borderRadius: 8,
|
|
217
|
+
minHeight: 120
|
|
218
|
+
}
|
|
219
|
+
})))), /*#__PURE__*/React.createElement(View, {
|
|
220
|
+
float: true,
|
|
221
|
+
style: {
|
|
222
|
+
flexGrow: 1,
|
|
223
|
+
minWidth: 300,
|
|
224
|
+
margin: 5
|
|
225
|
+
}
|
|
226
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
227
|
+
type: "header",
|
|
228
|
+
style: {
|
|
229
|
+
flexDirection: 'row',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
padding: 10,
|
|
232
|
+
borderTopRightRadius: 8,
|
|
233
|
+
borderTopLeftRadius: 8
|
|
234
|
+
}
|
|
235
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
236
|
+
transparent: true,
|
|
237
|
+
style: {
|
|
238
|
+
flex: 1
|
|
239
|
+
}
|
|
240
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
241
|
+
theme: "h1"
|
|
242
|
+
}, "Notification Settings"), /*#__PURE__*/React.createElement(Text, {
|
|
243
|
+
theme: "description",
|
|
244
|
+
style: {
|
|
245
|
+
marginTop: 3
|
|
246
|
+
}
|
|
247
|
+
}, "Manage settings below"))), /*#__PURE__*/React.createElement(View, {
|
|
248
|
+
transparent: true,
|
|
249
|
+
type: "body"
|
|
250
|
+
}, showType === true && /*#__PURE__*/React.createElement(View, {
|
|
251
|
+
type: "row",
|
|
252
|
+
style: {
|
|
253
|
+
padding: 10
|
|
254
|
+
}
|
|
255
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
256
|
+
theme: "h2",
|
|
257
|
+
style: {
|
|
258
|
+
flex: 1
|
|
259
|
+
}
|
|
260
|
+
}, "Notification Type"), /*#__PURE__*/React.createElement(DropDown, {
|
|
261
|
+
selected_value: notification_types.find(t => t.value === notification.type)?.label ?? '',
|
|
262
|
+
dropdown_options: [{
|
|
263
|
+
value: 'type',
|
|
264
|
+
eligible_options: notification_types.map(t => t.label)
|
|
265
|
+
}],
|
|
266
|
+
onOptionSelect: selected => {
|
|
267
|
+
const type = notification_types.find(t => t.label === selected)?.value;
|
|
268
|
+
onChange({
|
|
269
|
+
...notification,
|
|
270
|
+
type: type
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
274
|
+
transparent: true,
|
|
275
|
+
style: {
|
|
276
|
+
padding: 10
|
|
277
|
+
}
|
|
278
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
279
|
+
theme: "h2",
|
|
280
|
+
style: {
|
|
281
|
+
marginBottom: 10
|
|
282
|
+
}
|
|
283
|
+
}, "Link Override (Optional)"), /*#__PURE__*/React.createElement(TextInput, {
|
|
284
|
+
value: notification.link_override || '',
|
|
285
|
+
onFocusPosition: onFocusPosition,
|
|
286
|
+
placeholder: "https://example.com",
|
|
287
|
+
onChangeText: link_override => onChange({
|
|
288
|
+
...notification,
|
|
289
|
+
link_override
|
|
290
|
+
}),
|
|
291
|
+
style: {
|
|
292
|
+
padding: 12,
|
|
293
|
+
borderRadius: 8
|
|
294
|
+
}
|
|
295
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
296
|
+
transparent: true,
|
|
297
|
+
style: {
|
|
298
|
+
padding: 10
|
|
299
|
+
}
|
|
300
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
301
|
+
theme: "h2",
|
|
302
|
+
style: {
|
|
303
|
+
marginBottom: 10
|
|
304
|
+
}
|
|
305
|
+
}, "Deep Link Path"), /*#__PURE__*/React.createElement(View, {
|
|
306
|
+
type: "header",
|
|
307
|
+
style: {
|
|
308
|
+
padding: 12,
|
|
309
|
+
borderRadius: 8,
|
|
310
|
+
marginBottom: 8,
|
|
311
|
+
flexDirection: 'row',
|
|
312
|
+
alignItems: 'center',
|
|
313
|
+
justifyContent: 'space-between'
|
|
314
|
+
}
|
|
315
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
316
|
+
transparent: true,
|
|
317
|
+
style: {
|
|
318
|
+
flex: 1
|
|
319
|
+
}
|
|
320
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
321
|
+
theme: "h1",
|
|
322
|
+
style: {
|
|
323
|
+
marginBottom: 2
|
|
324
|
+
}
|
|
325
|
+
}, selectedPath?.label), /*#__PURE__*/React.createElement(Text, {
|
|
326
|
+
theme: "description",
|
|
327
|
+
style: {
|
|
328
|
+
fontSize: 12
|
|
329
|
+
}
|
|
330
|
+
}, selectedPath?.path_name)), selectedPath?.primary === true && /*#__PURE__*/React.createElement(View, {
|
|
331
|
+
transparent: true,
|
|
332
|
+
style: {
|
|
333
|
+
paddingHorizontal: 8,
|
|
334
|
+
paddingVertical: 4,
|
|
335
|
+
borderRadius: 4
|
|
336
|
+
}
|
|
337
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
338
|
+
theme: "description",
|
|
339
|
+
color: Colors.text.white,
|
|
340
|
+
style: {
|
|
341
|
+
fontSize: 10
|
|
342
|
+
}
|
|
343
|
+
}, "Primary"))), /*#__PURE__*/React.createElement(TextInput, {
|
|
344
|
+
value: pathSearch,
|
|
345
|
+
placeholder: "Search paths to change...",
|
|
346
|
+
onFocusPosition: onFocusPosition,
|
|
347
|
+
onChangeText: setPathSearch,
|
|
348
|
+
style: {
|
|
349
|
+
padding: 12,
|
|
350
|
+
borderRadius: 8,
|
|
351
|
+
marginBottom: 8
|
|
352
|
+
}
|
|
353
|
+
}), pathSearch ? /*#__PURE__*/React.createElement(View, {
|
|
354
|
+
float: true,
|
|
355
|
+
style: {
|
|
356
|
+
maxHeight: 300,
|
|
357
|
+
borderRadius: 8,
|
|
358
|
+
borderWidth: 1,
|
|
359
|
+
borderColor: Colors.borders.light
|
|
360
|
+
}
|
|
361
|
+
}, /*#__PURE__*/React.createElement(FlatList, {
|
|
362
|
+
data: filteredPaths,
|
|
363
|
+
keyExtractor: item => item.path_name,
|
|
364
|
+
renderItem: ({
|
|
365
|
+
item
|
|
366
|
+
}) => /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
367
|
+
onPress: () => {
|
|
368
|
+
setSelectedPath(item);
|
|
369
|
+
setPathParams(item.params);
|
|
370
|
+
setPathSearch('');
|
|
371
|
+
},
|
|
372
|
+
style: {
|
|
373
|
+
padding: 12,
|
|
374
|
+
borderBottomWidth: 1,
|
|
375
|
+
borderColor: Colors.borders.light
|
|
376
|
+
}
|
|
377
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
378
|
+
transparent: true,
|
|
379
|
+
style: {
|
|
380
|
+
flexDirection: 'row',
|
|
381
|
+
alignItems: 'center',
|
|
382
|
+
justifyContent: 'space-between'
|
|
383
|
+
}
|
|
384
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
385
|
+
transparent: true,
|
|
386
|
+
style: {
|
|
387
|
+
flex: 1
|
|
388
|
+
}
|
|
389
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
390
|
+
theme: "h2",
|
|
391
|
+
style: {
|
|
392
|
+
marginBottom: 2
|
|
393
|
+
}
|
|
394
|
+
}, item.label), /*#__PURE__*/React.createElement(Text, {
|
|
395
|
+
theme: "description",
|
|
396
|
+
style: {
|
|
397
|
+
fontSize: 11
|
|
398
|
+
}
|
|
399
|
+
}, item.path_name)), item.primary === true && /*#__PURE__*/React.createElement(View, {
|
|
400
|
+
transparent: true,
|
|
401
|
+
style: {
|
|
402
|
+
paddingHorizontal: 6,
|
|
403
|
+
paddingVertical: 2,
|
|
404
|
+
borderRadius: 4,
|
|
405
|
+
marginLeft: 8
|
|
406
|
+
}
|
|
407
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
408
|
+
theme: "description",
|
|
409
|
+
color: Colors.text.white,
|
|
410
|
+
style: {
|
|
411
|
+
fontSize: 9
|
|
412
|
+
}
|
|
413
|
+
}, "Primary")))),
|
|
414
|
+
ListEmptyComponent: /*#__PURE__*/React.createElement(View, {
|
|
415
|
+
style: {
|
|
416
|
+
padding: 20,
|
|
417
|
+
alignItems: 'center'
|
|
418
|
+
}
|
|
419
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
420
|
+
theme: "description"
|
|
421
|
+
}, "No paths found"))
|
|
422
|
+
})) : null), Object.keys(selectedPath?.params ?? {}).length > 0 ? /*#__PURE__*/React.createElement(View, {
|
|
423
|
+
style: {
|
|
424
|
+
padding: 10
|
|
425
|
+
}
|
|
426
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
427
|
+
theme: "h2",
|
|
428
|
+
style: {
|
|
429
|
+
marginBottom: 8
|
|
430
|
+
}
|
|
431
|
+
}, "Path Parameters"), /*#__PURE__*/React.createElement(View, {
|
|
432
|
+
type: "header",
|
|
433
|
+
style: {
|
|
434
|
+
padding: 12,
|
|
435
|
+
borderRadius: 8
|
|
436
|
+
}
|
|
437
|
+
}, Object.keys(selectedPath?.params ?? {}).map(paramKey => {
|
|
438
|
+
const isRequired = selectedPath?.requiredParams.includes(paramKey);
|
|
439
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
440
|
+
key: paramKey,
|
|
441
|
+
transparent: true,
|
|
442
|
+
style: {
|
|
443
|
+
marginBottom: 12
|
|
444
|
+
}
|
|
445
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
446
|
+
transparent: true,
|
|
447
|
+
style: {
|
|
448
|
+
flexDirection: 'row',
|
|
449
|
+
alignItems: 'center',
|
|
450
|
+
marginBottom: 4
|
|
451
|
+
}
|
|
452
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
453
|
+
theme: "description"
|
|
454
|
+
}, paramKey), isRequired ? /*#__PURE__*/React.createElement(View, {
|
|
455
|
+
transparent: true,
|
|
456
|
+
style: {
|
|
457
|
+
marginLeft: 4,
|
|
458
|
+
paddingHorizontal: 6,
|
|
459
|
+
paddingVertical: 2,
|
|
460
|
+
backgroundColor: Colors.text.error,
|
|
461
|
+
borderRadius: 4
|
|
462
|
+
}
|
|
463
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
464
|
+
theme: "description",
|
|
465
|
+
color: Colors.text.white,
|
|
466
|
+
style: {
|
|
467
|
+
fontSize: 10
|
|
468
|
+
}
|
|
469
|
+
}, "Required")) : /*#__PURE__*/React.createElement(View, {
|
|
470
|
+
transparent: true,
|
|
471
|
+
style: {
|
|
472
|
+
marginLeft: 4,
|
|
473
|
+
paddingHorizontal: 6,
|
|
474
|
+
paddingVertical: 2,
|
|
475
|
+
backgroundColor: Colors.borders.light,
|
|
476
|
+
borderRadius: 4
|
|
477
|
+
}
|
|
478
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
479
|
+
theme: "description",
|
|
480
|
+
style: {
|
|
481
|
+
fontSize: 10
|
|
482
|
+
}
|
|
483
|
+
}, "Optional"))), /*#__PURE__*/React.createElement(TextInput, {
|
|
484
|
+
value: pathParams[paramKey] || '',
|
|
485
|
+
onFocusPosition: onFocusPosition,
|
|
486
|
+
placeholder: `Enter ${paramKey}${isRequired ? ' (required)' : ' (optional)'}`,
|
|
487
|
+
onChangeText: value => setPathParams({
|
|
488
|
+
...pathParams,
|
|
489
|
+
[paramKey]: value
|
|
490
|
+
}),
|
|
491
|
+
style: {
|
|
492
|
+
padding: 10,
|
|
493
|
+
borderRadius: 8,
|
|
494
|
+
borderWidth: isRequired ? 1 : 0,
|
|
495
|
+
borderColor: isRequired ? Colors.text.error : 'transparent'
|
|
496
|
+
}
|
|
497
|
+
}));
|
|
498
|
+
}))) : null))));
|
|
499
|
+
};
|
|
500
|
+
export default NotificationBuilderForm;
|
|
501
|
+
//# sourceMappingURL=NotificationBuilderForm.js.map
|