@plusscommunities/pluss-feature-builder-app-c 1.0.1-beta.3
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/dist/module/actions/featureBuilderActions.js +106 -0
- package/dist/module/actions/featureBuilderActions.js.map +1 -0
- package/dist/module/actions/featureBuilderStringsActions.js +106 -0
- package/dist/module/actions/featureBuilderStringsActions.js.map +1 -0
- package/dist/module/actions/index.js +12 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +7 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/components/FeatureDetailScreen.js +725 -0
- package/dist/module/components/FeatureDetailScreen.js.map +1 -0
- package/dist/module/components/FeatureListItem.js +174 -0
- package/dist/module/components/FeatureListItem.js.map +1 -0
- package/dist/module/components/FeatureListScreen.js +159 -0
- package/dist/module/components/FeatureListScreen.js.map +1 -0
- package/dist/module/components/FieldRenderer.js +218 -0
- package/dist/module/components/FieldRenderer.js.map +1 -0
- package/dist/module/components/FileDownload.js +74 -0
- package/dist/module/components/FileDownload.js.map +1 -0
- package/dist/module/components/WidgetGrid.js +158 -0
- package/dist/module/components/WidgetGrid.js.map +1 -0
- package/dist/module/components/WidgetLarge.js +274 -0
- package/dist/module/components/WidgetLarge.js.map +1 -0
- package/dist/module/components/WidgetSmall.js +315 -0
- package/dist/module/components/WidgetSmall.js.map +1 -0
- package/dist/module/components/common/index.js +25 -0
- package/dist/module/components/common/index.js.map +1 -0
- package/dist/module/components/layouts/CondensedList.js +195 -0
- package/dist/module/components/layouts/CondensedList.js.map +1 -0
- package/dist/module/components/layouts/FeatureImageList.js +172 -0
- package/dist/module/components/layouts/FeatureImageList.js.map +1 -0
- package/dist/module/components/layouts/RoundImageList.js +198 -0
- package/dist/module/components/layouts/RoundImageList.js.map +1 -0
- package/dist/module/components/layouts/SquareImageList.js +185 -0
- package/dist/module/components/layouts/SquareImageList.js.map +1 -0
- package/dist/module/config/index.js +10 -0
- package/dist/module/config/index.js.map +1 -0
- package/dist/module/core.config.js +17 -0
- package/dist/module/core.config.js.map +1 -0
- package/dist/module/feature.config.js +113 -0
- package/dist/module/feature.config.js.map +1 -0
- package/dist/module/index.js +24 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/js/Colors.js +25 -0
- package/dist/module/js/Colors.js.map +1 -0
- package/dist/module/js/FieldTypes.js +123 -0
- package/dist/module/js/FieldTypes.js.map +1 -0
- package/dist/module/js/NavigationService.js +10 -0
- package/dist/module/js/NavigationService.js.map +1 -0
- package/dist/module/js/Styles.js +3 -0
- package/dist/module/js/Styles.js.map +1 -0
- package/dist/module/js/helpers.js +29 -0
- package/dist/module/js/helpers.js.map +1 -0
- package/dist/module/js/index.js +24 -0
- package/dist/module/js/index.js.map +1 -0
- package/dist/module/js/spacing.js +29 -0
- package/dist/module/js/spacing.js.map +1 -0
- package/dist/module/js/types.js +254 -0
- package/dist/module/js/types.js.map +1 -0
- package/dist/module/reducers/featureBuilderReducer.js +75 -0
- package/dist/module/reducers/featureBuilderReducer.js.map +1 -0
- package/dist/module/utils/featureSelectors.js +9 -0
- package/dist/module/utils/featureSelectors.js.map +1 -0
- package/dist/module/values.config.a.js +96 -0
- package/dist/module/values.config.a.js.map +1 -0
- package/dist/module/values.config.b.js +96 -0
- package/dist/module/values.config.b.js.map +1 -0
- package/dist/module/values.config.c.js +96 -0
- package/dist/module/values.config.c.js.map +1 -0
- package/dist/module/values.config.d.js +96 -0
- package/dist/module/values.config.d.js.map +1 -0
- package/dist/module/values.config.js +96 -0
- package/dist/module/values.config.js.map +1 -0
- package/dist/module/webapi/featureBuilderAPI.js +59 -0
- package/dist/module/webapi/featureBuilderAPI.js.map +1 -0
- package/dist/module/webapi/helper.js +4 -0
- package/dist/module/webapi/helper.js.map +1 -0
- package/dist/module/webapi/index.js +8 -0
- package/dist/module/webapi/index.js.map +1 -0
- package/package.json +62 -0
- package/src/actions/featureBuilderActions.js +112 -0
- package/src/actions/featureBuilderStringsActions.js +114 -0
- package/src/actions/index.js +12 -0
- package/src/actions/types.js +7 -0
- package/src/components/FeatureDetailScreen.js +817 -0
- package/src/components/FeatureListItem.js +198 -0
- package/src/components/FeatureListScreen.js +160 -0
- package/src/components/FieldRenderer.js +272 -0
- package/src/components/FileDownload.js +79 -0
- package/src/components/WidgetGrid.js +181 -0
- package/src/components/WidgetLarge.js +305 -0
- package/src/components/WidgetSmall.js +344 -0
- package/src/components/common/index.js +25 -0
- package/src/components/layouts/CondensedList.js +230 -0
- package/src/components/layouts/FeatureImageList.js +193 -0
- package/src/components/layouts/RoundImageList.js +219 -0
- package/src/components/layouts/SquareImageList.js +205 -0
- package/src/config/index.js +10 -0
- package/src/core.config.js +29 -0
- package/src/feature.config.js +127 -0
- package/src/index.js +27 -0
- package/src/js/Colors.js +30 -0
- package/src/js/FieldTypes.js +131 -0
- package/src/js/NavigationService.js +12 -0
- package/src/js/Styles.js +3 -0
- package/src/js/helpers.js +30 -0
- package/src/js/index.js +24 -0
- package/src/js/spacing.js +30 -0
- package/src/js/types.js +253 -0
- package/src/reducers/featureBuilderReducer.js +64 -0
- package/src/utils/featureSelectors.js +8 -0
- package/src/values.config.a.js +104 -0
- package/src/values.config.b.js +104 -0
- package/src/values.config.c.js +104 -0
- package/src/values.config.d.js +104 -0
- package/src/values.config.js +104 -0
- package/src/webapi/featureBuilderAPI.js +65 -0
- package/src/webapi/helper.js +4 -0
- package/src/webapi/index.js +8 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, Text, Image, StyleSheet, TouchableOpacity, FlatList } from "react-native";
|
|
3
|
+
import { Icon } from "react-native-elements";
|
|
4
|
+
import { Components } from "../../core.config";
|
|
5
|
+
import { values } from "../../values.config";
|
|
6
|
+
import { SPACING } from "../../js/spacing";
|
|
7
|
+
import { getSummaryFieldValue } from "../../js/helpers";
|
|
8
|
+
const getEmptyStateMessage = title => {
|
|
9
|
+
const featureName = title || "Feature";
|
|
10
|
+
return `${featureName} listings will appear here once they're available.\nCome back soon to see what's new!`;
|
|
11
|
+
};
|
|
12
|
+
const RoundImageList = ({
|
|
13
|
+
listings,
|
|
14
|
+
onItemPress,
|
|
15
|
+
colourBrandingMain,
|
|
16
|
+
refreshing,
|
|
17
|
+
onRefresh,
|
|
18
|
+
title,
|
|
19
|
+
featureDefinition
|
|
20
|
+
}) => {
|
|
21
|
+
const getImageSource = imageField => {
|
|
22
|
+
if (!imageField) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Handle different image field formats
|
|
27
|
+
if (typeof imageField === "string") {
|
|
28
|
+
return {
|
|
29
|
+
uri: imageField
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (typeof imageField === "object" && imageField.uri) {
|
|
33
|
+
return imageField;
|
|
34
|
+
}
|
|
35
|
+
if (typeof imageField === "object" && imageField.url) {
|
|
36
|
+
return {
|
|
37
|
+
uri: imageField.url
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
const renderListingItem = ({
|
|
43
|
+
item: listing
|
|
44
|
+
}) => {
|
|
45
|
+
var _listing$fields, _listing$fields2;
|
|
46
|
+
const title = ((_listing$fields = listing.fields) === null || _listing$fields === void 0 ? void 0 : _listing$fields[values.mandatoryFields.title]) || "Untitled";
|
|
47
|
+
const summary = getSummaryFieldValue(listing, featureDefinition);
|
|
48
|
+
const imageField = (_listing$fields2 = listing.fields) === null || _listing$fields2 === void 0 ? void 0 : _listing$fields2[values.mandatoryFields.featureImage];
|
|
49
|
+
const imageSource = getImageSource(imageField);
|
|
50
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
51
|
+
style: styles.cardContainer,
|
|
52
|
+
onPress: () => onItemPress && onItemPress(listing)
|
|
53
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
54
|
+
style: styles.borderContainer
|
|
55
|
+
}, imageSource ? /*#__PURE__*/React.createElement(Image, {
|
|
56
|
+
source: imageSource,
|
|
57
|
+
style: styles.roundImage
|
|
58
|
+
}) : /*#__PURE__*/React.createElement(View, {
|
|
59
|
+
style: [styles.roundImage, styles.placeholderImage]
|
|
60
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
61
|
+
style: styles.contentContainer
|
|
62
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
63
|
+
style: styles.textContainer
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
65
|
+
style: styles.titleText,
|
|
66
|
+
numberOfLines: 1
|
|
67
|
+
}, title), /*#__PURE__*/React.createElement(Text, {
|
|
68
|
+
style: styles.descriptionText,
|
|
69
|
+
numberOfLines: 2
|
|
70
|
+
}, summary)), /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
style: styles.chevronContainer
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
73
|
+
type: "font-awesome",
|
|
74
|
+
name: "chevron-right",
|
|
75
|
+
size: 16,
|
|
76
|
+
color: "#ccc",
|
|
77
|
+
style: styles.chevron
|
|
78
|
+
})))));
|
|
79
|
+
};
|
|
80
|
+
if (!listings || listings.length === 0) {
|
|
81
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
82
|
+
style: styles.emptyContainer
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Components.EmptyStateWidget, {
|
|
84
|
+
title: getEmptyStateMessage(title),
|
|
85
|
+
height: 120
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
if (onRefresh) {
|
|
89
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
90
|
+
style: styles.container
|
|
91
|
+
}, /*#__PURE__*/React.createElement(Components.LoadingIndicator, {
|
|
92
|
+
visible: refreshing
|
|
93
|
+
}), /*#__PURE__*/React.createElement(FlatList, {
|
|
94
|
+
data: listings,
|
|
95
|
+
keyExtractor: item => item.id,
|
|
96
|
+
renderItem: renderListingItem,
|
|
97
|
+
contentContainerStyle: styles.scrollContainer,
|
|
98
|
+
showsVerticalScrollIndicator: false
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
return /*#__PURE__*/React.createElement(FlatList, {
|
|
102
|
+
data: listings,
|
|
103
|
+
keyExtractor: item => item.id,
|
|
104
|
+
renderItem: renderListingItem,
|
|
105
|
+
contentContainerStyle: styles.scrollContainer,
|
|
106
|
+
showsVerticalScrollIndicator: false
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
container: {
|
|
111
|
+
flex: 1
|
|
112
|
+
},
|
|
113
|
+
scrollContainer: {
|
|
114
|
+
paddingLeft: SPACING.XL + 16,
|
|
115
|
+
paddingRight: SPACING.MD,
|
|
116
|
+
paddingVertical: SPACING.SM
|
|
117
|
+
},
|
|
118
|
+
cardContainer: {
|
|
119
|
+
paddingHorizontal: SPACING.SM + 2,
|
|
120
|
+
paddingVertical: SPACING.SM
|
|
121
|
+
},
|
|
122
|
+
borderContainer: {
|
|
123
|
+
borderRadius: SPACING.SM * 1,
|
|
124
|
+
backgroundColor: "#ffffff",
|
|
125
|
+
shadowColor: "#000",
|
|
126
|
+
shadowOffset: {
|
|
127
|
+
width: 0,
|
|
128
|
+
height: 2
|
|
129
|
+
},
|
|
130
|
+
shadowOpacity: 0.1,
|
|
131
|
+
shadowRadius: 3.84,
|
|
132
|
+
elevation: 5,
|
|
133
|
+
position: "relative",
|
|
134
|
+
minHeight: 100,
|
|
135
|
+
justifyContent: "center",
|
|
136
|
+
paddingLeft: SPACING.XL + 8,
|
|
137
|
+
paddingRight: SPACING.SM
|
|
138
|
+
},
|
|
139
|
+
roundImage: {
|
|
140
|
+
width: 88,
|
|
141
|
+
height: 88,
|
|
142
|
+
borderRadius: 44,
|
|
143
|
+
backgroundColor: "#f0f0f0",
|
|
144
|
+
position: "absolute",
|
|
145
|
+
borderWidth: 2,
|
|
146
|
+
borderColor: "#fff",
|
|
147
|
+
left: -44,
|
|
148
|
+
top: "50%",
|
|
149
|
+
marginTop: -44,
|
|
150
|
+
shadowColor: "#000",
|
|
151
|
+
shadowOffset: {
|
|
152
|
+
width: 0,
|
|
153
|
+
height: 2
|
|
154
|
+
},
|
|
155
|
+
shadowOpacity: 0.1,
|
|
156
|
+
shadowRadius: 3.84,
|
|
157
|
+
elevation: 6
|
|
158
|
+
},
|
|
159
|
+
placeholderImage: {
|
|
160
|
+
backgroundColor: "#808080",
|
|
161
|
+
justifyContent: "center",
|
|
162
|
+
alignItems: "center"
|
|
163
|
+
},
|
|
164
|
+
contentContainer: {
|
|
165
|
+
flex: 1,
|
|
166
|
+
flexDirection: "row",
|
|
167
|
+
alignItems: "center"
|
|
168
|
+
},
|
|
169
|
+
textContainer: {
|
|
170
|
+
flex: 1,
|
|
171
|
+
paddingLeft: SPACING.MD,
|
|
172
|
+
paddingVertical: SPACING.SM + 4
|
|
173
|
+
},
|
|
174
|
+
titleText: {
|
|
175
|
+
fontSize: 20,
|
|
176
|
+
fontFamily: "sf-medium",
|
|
177
|
+
color: "#333",
|
|
178
|
+
marginBottom: SPACING.XS
|
|
179
|
+
},
|
|
180
|
+
descriptionText: {
|
|
181
|
+
fontFamily: "sf-regular",
|
|
182
|
+
fontSize: 14,
|
|
183
|
+
color: "#666",
|
|
184
|
+
lineHeight: 18
|
|
185
|
+
},
|
|
186
|
+
emptyContainer: {
|
|
187
|
+
paddingVertical: SPACING.MD
|
|
188
|
+
},
|
|
189
|
+
chevronContainer: {
|
|
190
|
+
justifyContent: "center",
|
|
191
|
+
paddingHorizontal: SPACING.SM
|
|
192
|
+
},
|
|
193
|
+
chevron: {
|
|
194
|
+
opacity: 0.6
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
export default RoundImageList;
|
|
198
|
+
//# sourceMappingURL=RoundImageList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","Image","StyleSheet","TouchableOpacity","FlatList","Icon","Components","values","SPACING","getSummaryFieldValue","getEmptyStateMessage","title","featureName","RoundImageList","listings","onItemPress","colourBrandingMain","refreshing","onRefresh","featureDefinition","getImageSource","imageField","uri","url","renderListingItem","item","listing","_listing$fields","_listing$fields2","fields","mandatoryFields","summary","featureImage","imageSource","createElement","style","styles","cardContainer","onPress","borderContainer","source","roundImage","placeholderImage","contentContainer","textContainer","titleText","numberOfLines","descriptionText","chevronContainer","type","name","size","color","chevron","length","emptyContainer","EmptyStateWidget","height","container","LoadingIndicator","visible","data","keyExtractor","id","renderItem","contentContainerStyle","scrollContainer","showsVerticalScrollIndicator","create","flex","paddingLeft","XL","paddingRight","MD","paddingVertical","SM","paddingHorizontal","borderRadius","backgroundColor","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","elevation","position","minHeight","justifyContent","borderWidth","borderColor","left","top","marginTop","alignItems","flexDirection","fontSize","fontFamily","marginBottom","XS","lineHeight","opacity"],"sources":["RoundImageList.js"],"sourcesContent":["import React from \"react\";\nimport {\n\tView,\n\tText,\n\tImage,\n\tStyleSheet,\n\tTouchableOpacity,\n\tFlatList,\n} from \"react-native\";\nimport { Icon } from \"react-native-elements\";\nimport { Components } from \"../../core.config\";\nimport { values } from \"../../values.config\";\nimport { SPACING } from \"../../js/spacing\";\nimport { getSummaryFieldValue } from \"../../js/helpers\";\n\nconst getEmptyStateMessage = (title) => {\n\tconst featureName = title || \"Feature\";\n\treturn `${featureName} listings will appear here once they're available.\\nCome back soon to see what's new!`;\n};\n\nconst RoundImageList = ({\n\tlistings,\n\tonItemPress,\n\tcolourBrandingMain,\n\trefreshing,\n\tonRefresh,\n\ttitle,\n\tfeatureDefinition,\n}) => {\n\tconst getImageSource = (imageField) => {\n\t\tif (!imageField) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Handle different image field formats\n\t\tif (typeof imageField === \"string\") {\n\t\t\treturn { uri: imageField };\n\t\t}\n\n\t\tif (typeof imageField === \"object\" && imageField.uri) {\n\t\t\treturn imageField;\n\t\t}\n\n\t\tif (typeof imageField === \"object\" && imageField.url) {\n\t\t\treturn { uri: imageField.url };\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tconst renderListingItem = ({ item: listing }) => {\n\t\tconst title = listing.fields?.[values.mandatoryFields.title] || \"Untitled\";\n\t\tconst summary = getSummaryFieldValue(listing, featureDefinition);\n\t\tconst imageField = listing.fields?.[values.mandatoryFields.featureImage];\n\n\t\tconst imageSource = getImageSource(imageField);\n\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={styles.cardContainer}\n\t\t\t\tonPress={() => onItemPress && onItemPress(listing)}\n\t\t\t>\n\t\t\t\t<View style={styles.borderContainer}>\n\t\t\t\t\t{imageSource ? (\n\t\t\t\t\t\t<Image source={imageSource} style={styles.roundImage} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<View style={[styles.roundImage, styles.placeholderImage]}></View>\n\t\t\t\t\t)}\n\t\t\t\t\t<View style={styles.contentContainer}>\n\t\t\t\t\t\t<View style={styles.textContainer}>\n\t\t\t\t\t\t\t<Text style={styles.titleText} numberOfLines={1}>\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text style={styles.descriptionText} numberOfLines={2}>\n\t\t\t\t\t\t\t\t{summary}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<View style={styles.chevronContainer}>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\t\tname=\"chevron-right\"\n\t\t\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\t\t\tcolor=\"#ccc\"\n\t\t\t\t\t\t\t\tstyle={styles.chevron}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t};\n\n\tif (!listings || listings.length === 0) {\n\t\treturn (\n\t\t\t<View style={styles.emptyContainer}>\n\t\t\t\t<Components.EmptyStateWidget\n\t\t\t\t\ttitle={getEmptyStateMessage(title)}\n\t\t\t\t\theight={120}\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\tif (onRefresh) {\n\t\treturn (\n\t\t\t<View style={styles.container}>\n\t\t\t\t<Components.LoadingIndicator visible={refreshing} />\n\t\t\t\t<FlatList\n\t\t\t\t\tdata={listings}\n\t\t\t\t\tkeyExtractor={(item) => item.id}\n\t\t\t\t\trenderItem={renderListingItem}\n\t\t\t\t\tcontentContainerStyle={styles.scrollContainer}\n\t\t\t\t\tshowsVerticalScrollIndicator={false}\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FlatList\n\t\t\tdata={listings}\n\t\t\tkeyExtractor={(item) => item.id}\n\t\t\trenderItem={renderListingItem}\n\t\t\tcontentContainerStyle={styles.scrollContainer}\n\t\t\tshowsVerticalScrollIndicator={false}\n\t\t/>\n\t);\n};\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1,\n\t},\n\tscrollContainer: {\n\t\tpaddingLeft: SPACING.XL + 16,\n\t\tpaddingRight: SPACING.MD,\n\t\tpaddingVertical: SPACING.SM,\n\t},\n\tcardContainer: {\n\t\tpaddingHorizontal: SPACING.SM + 2,\n\t\tpaddingVertical: SPACING.SM,\n\t},\n\tborderContainer: {\n\t\tborderRadius: SPACING.SM * 1,\n\t\tbackgroundColor: \"#ffffff\",\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: {\n\t\t\twidth: 0,\n\t\t\theight: 2,\n\t\t},\n\t\tshadowOpacity: 0.1,\n\t\tshadowRadius: 3.84,\n\t\televation: 5,\n\t\tposition: \"relative\",\n\t\tminHeight: 100,\n\t\tjustifyContent: \"center\",\n\t\tpaddingLeft: SPACING.XL + 8,\n\t\tpaddingRight: SPACING.SM,\n\t},\n\troundImage: {\n\t\twidth: 88,\n\t\theight: 88,\n\t\tborderRadius: 44,\n\t\tbackgroundColor: \"#f0f0f0\",\n\t\tposition: \"absolute\",\n\t\tborderWidth: 2,\n\t\tborderColor: \"#fff\",\n\t\tleft: -44,\n\t\ttop: \"50%\",\n\t\tmarginTop: -44,\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: {\n\t\t\twidth: 0,\n\t\t\theight: 2,\n\t\t},\n\t\tshadowOpacity: 0.1,\n\t\tshadowRadius: 3.84,\n\t\televation: 6,\n\t},\n\tplaceholderImage: {\n\t\tbackgroundColor: \"#808080\",\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n\tcontentContainer: {\n\t\tflex: 1,\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t},\n\ttextContainer: {\n\t\tflex: 1,\n\t\tpaddingLeft: SPACING.MD,\n\t\tpaddingVertical: SPACING.SM + 4,\n\t},\n\ttitleText: {\n\t\tfontSize: 20,\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: \"#333\",\n\t\tmarginBottom: SPACING.XS,\n\t},\n\tdescriptionText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 14,\n\t\tcolor: \"#666\",\n\t\tlineHeight: 18,\n\t},\n\temptyContainer: {\n\t\tpaddingVertical: SPACING.MD,\n\t},\n\tchevronContainer: {\n\t\tjustifyContent: \"center\",\n\t\tpaddingHorizontal: SPACING.SM,\n\t},\n\tchevron: {\n\t\topacity: 0.6,\n\t},\n});\n\nexport default RoundImageList;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACCC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,gBAAgB,EAChBC,QAAQ,QACF,cAAc;AACrB,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,oBAAoB,QAAQ,kBAAkB;AAEvD,MAAMC,oBAAoB,GAAIC,KAAK,IAAK;EACvC,MAA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aAAa,EAAE,KAAK;IACpBD,UAAU,EAAE;EACb,CAAC;EACDjD,aAAa,EAAE;IACdyB,IAAI,EAAE,CAAC;IACPC,WAAW,EAAE9D,OAAO,CAACiE,EAAE;IACvBC,eAAe,EAAElE,OAAO,CAACmE,EAAE,GAAG;EAC/B,CAAC;EACD9B,SAAS,EAAE;IACVkD,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,WAAW;IACvB5C,KAAK,EAAE,MAAM;IACb6C,YAAY,EAAEzF,OAAO,CAAC0F;EACvB,CAAC;EACDnD,eAAe,EAAE;IAChBiD,UAAU,EAAE,YAAY;IACxBD,QAAQ,EAAE,EAAE;IACZ3C,KAAK,EAAE,MAAM;IACb+C,UAAU,EAAE;EACb,CAAC;EACD5C,cAAc,EAAE;IACfmB,eAAe,EAAElE,OAAO,CAACiE;EAC1B,CAAC;EACDzB,gBAAgB,EAAE;IACjBuC,cAAc,EAAE,QAAQ;IACxBX,iBAAiB,EAAEpE,OAAO,CAACmE;EAC5B,CAAC;EACDtB,OAAO,EAAE;IACR+C,OAAO,EAAE;EACV;AACD,CAAC,CAAC;AAEF,eAAevF,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, Text, Image, StyleSheet, TouchableOpacity, FlatList } from "react-native";
|
|
3
|
+
import { Icon } from "react-native-elements";
|
|
4
|
+
import { Components } from "../../core.config";
|
|
5
|
+
import { values } from "../../values.config";
|
|
6
|
+
import { SPACING } from "../../js/spacing";
|
|
7
|
+
import { getSummaryFieldValue } from "../../js/helpers";
|
|
8
|
+
const getEmptyStateMessage = title => {
|
|
9
|
+
const featureName = title || "Feature";
|
|
10
|
+
return `${featureName} listings will appear here once they're available.\nCome back soon to see what's new!`;
|
|
11
|
+
};
|
|
12
|
+
const SquareImageList = ({
|
|
13
|
+
listings,
|
|
14
|
+
onItemPress,
|
|
15
|
+
colourBrandingMain,
|
|
16
|
+
refreshing,
|
|
17
|
+
onRefresh,
|
|
18
|
+
title,
|
|
19
|
+
featureDefinition
|
|
20
|
+
}) => {
|
|
21
|
+
const getImageSource = imageField => {
|
|
22
|
+
if (!imageField) return null;
|
|
23
|
+
|
|
24
|
+
// Handle different image field formats
|
|
25
|
+
if (typeof imageField === "string") {
|
|
26
|
+
return {
|
|
27
|
+
uri: imageField
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (typeof imageField === "object" && imageField.uri) {
|
|
31
|
+
return imageField;
|
|
32
|
+
}
|
|
33
|
+
if (typeof imageField === "object" && imageField.url) {
|
|
34
|
+
return {
|
|
35
|
+
uri: imageField.url
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
};
|
|
40
|
+
const renderListingItem = ({
|
|
41
|
+
item: listing
|
|
42
|
+
}) => {
|
|
43
|
+
var _listing$fields, _listing$fields2;
|
|
44
|
+
const title = ((_listing$fields = listing.fields) === null || _listing$fields === void 0 ? void 0 : _listing$fields[values.mandatoryFields.title]) || "Untitled";
|
|
45
|
+
const summary = getSummaryFieldValue(listing, featureDefinition);
|
|
46
|
+
const imageField = (_listing$fields2 = listing.fields) === null || _listing$fields2 === void 0 ? void 0 : _listing$fields2[values.mandatoryFields.featureImage];
|
|
47
|
+
const imageSource = getImageSource(imageField);
|
|
48
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
49
|
+
style: styles.cardContainer,
|
|
50
|
+
onPress: () => onItemPress && onItemPress(listing)
|
|
51
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: styles.borderContainer
|
|
53
|
+
}, imageSource ? /*#__PURE__*/React.createElement(Image, {
|
|
54
|
+
source: imageSource,
|
|
55
|
+
style: styles.squareImage
|
|
56
|
+
}) : /*#__PURE__*/React.createElement(View, {
|
|
57
|
+
style: [styles.squareImage, styles.placeholderImage]
|
|
58
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
59
|
+
style: styles.contentContainer
|
|
60
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
61
|
+
style: styles.textContainer
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
63
|
+
style: styles.titleText,
|
|
64
|
+
numberOfLines: 1
|
|
65
|
+
}, title), /*#__PURE__*/React.createElement(Text, {
|
|
66
|
+
style: styles.descriptionText,
|
|
67
|
+
numberOfLines: 2
|
|
68
|
+
}, summary)), /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: styles.chevronContainer
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
+
type: "font-awesome",
|
|
72
|
+
name: "chevron-right",
|
|
73
|
+
size: 16,
|
|
74
|
+
color: "#ccc",
|
|
75
|
+
style: styles.chevron
|
|
76
|
+
})))));
|
|
77
|
+
};
|
|
78
|
+
if (!listings || listings.length === 0) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
80
|
+
style: styles.emptyContainer
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Components.EmptyStateWidget, {
|
|
82
|
+
title: getEmptyStateMessage(title),
|
|
83
|
+
height: 120
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
if (onRefresh) {
|
|
87
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
style: styles.container
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Components.LoadingIndicator, {
|
|
90
|
+
visible: refreshing
|
|
91
|
+
}), /*#__PURE__*/React.createElement(FlatList, {
|
|
92
|
+
data: listings,
|
|
93
|
+
keyExtractor: item => item.id,
|
|
94
|
+
renderItem: renderListingItem,
|
|
95
|
+
contentContainerStyle: styles.scrollContainer,
|
|
96
|
+
showsVerticalScrollIndicator: false
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
return /*#__PURE__*/React.createElement(FlatList, {
|
|
100
|
+
data: listings,
|
|
101
|
+
keyExtractor: item => item.id,
|
|
102
|
+
renderItem: renderListingItem,
|
|
103
|
+
contentContainerStyle: styles.scrollContainer,
|
|
104
|
+
showsVerticalScrollIndicator: false
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
container: {
|
|
109
|
+
flex: 1
|
|
110
|
+
},
|
|
111
|
+
scrollContainer: {
|
|
112
|
+
paddingHorizontal: SPACING.MD,
|
|
113
|
+
paddingVertical: SPACING.MD
|
|
114
|
+
},
|
|
115
|
+
cardContainer: {
|
|
116
|
+
marginBottom: SPACING.MD,
|
|
117
|
+
backgroundColor: "#ffffff",
|
|
118
|
+
shadowColor: "#000",
|
|
119
|
+
shadowOffset: {
|
|
120
|
+
width: 0,
|
|
121
|
+
height: 2
|
|
122
|
+
},
|
|
123
|
+
shadowOpacity: 0.1,
|
|
124
|
+
shadowRadius: 3.84
|
|
125
|
+
},
|
|
126
|
+
borderContainer: {
|
|
127
|
+
borderRadius: SPACING.XS,
|
|
128
|
+
backgroundColor: "#ffffff",
|
|
129
|
+
shadowColor: "#000",
|
|
130
|
+
shadowOffset: {
|
|
131
|
+
width: 0,
|
|
132
|
+
height: 4
|
|
133
|
+
},
|
|
134
|
+
shadowOpacity: 0.15,
|
|
135
|
+
shadowRadius: 8,
|
|
136
|
+
elevation: 4,
|
|
137
|
+
flexDirection: "row",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
overflow: "hidden",
|
|
140
|
+
minHeight: 100,
|
|
141
|
+
paddingRight: SPACING.SM
|
|
142
|
+
},
|
|
143
|
+
squareImage: {
|
|
144
|
+
height: 100,
|
|
145
|
+
aspectRatio: 1,
|
|
146
|
+
backgroundColor: "#f0f0f0",
|
|
147
|
+
marginRight: SPACING.MD
|
|
148
|
+
},
|
|
149
|
+
placeholderImage: {
|
|
150
|
+
backgroundColor: "#808080",
|
|
151
|
+
justifyContent: "center"
|
|
152
|
+
},
|
|
153
|
+
contentContainer: {
|
|
154
|
+
flex: 1,
|
|
155
|
+
flexDirection: "row",
|
|
156
|
+
alignItems: "center"
|
|
157
|
+
},
|
|
158
|
+
textContainer: {
|
|
159
|
+
flex: 1
|
|
160
|
+
},
|
|
161
|
+
titleText: {
|
|
162
|
+
fontSize: 18,
|
|
163
|
+
fontFamily: "sf-medium",
|
|
164
|
+
color: "#333",
|
|
165
|
+
marginBottom: SPACING.XS
|
|
166
|
+
},
|
|
167
|
+
descriptionText: {
|
|
168
|
+
fontFamily: "sf-regular",
|
|
169
|
+
fontSize: 14,
|
|
170
|
+
color: "#666",
|
|
171
|
+
lineHeight: 18
|
|
172
|
+
},
|
|
173
|
+
emptyContainer: {
|
|
174
|
+
paddingVertical: SPACING.MD
|
|
175
|
+
},
|
|
176
|
+
chevronContainer: {
|
|
177
|
+
justifyContent: "center",
|
|
178
|
+
paddingHorizontal: SPACING.SM
|
|
179
|
+
},
|
|
180
|
+
chevron: {
|
|
181
|
+
opacity: 0.6
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
export default SquareImageList;
|
|
185
|
+
//# sourceMappingURL=SquareImageList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","Image","StyleSheet","TouchableOpacity","FlatList","Icon","Components","values","SPACING","getSummaryFieldValue","getEmptyStateMessage","title","featureName","SquareImageList","listings","onItemPress","colourBrandingMain","refreshing","onRefresh","featureDefinition","getImageSource","imageField","uri","url","renderListingItem","item","listing","_listing$fields","_listing$fields2","fields","mandatoryFields","summary","featureImage","imageSource","createElement","style","styles","cardContainer","onPress","borderContainer","source","squareImage","placeholderImage","contentContainer","textContainer","titleText","numberOfLines","descriptionText","chevronContainer","type","name","size","color","chevron","length","emptyContainer","EmptyStateWidget","height","container","LoadingIndicator","visible","data","keyExtractor","id","renderItem","contentContainerStyle","scrollContainer","showsVerticalScrollIndicator","create","flex","paddingHorizontal","MD","paddingVertical","marginBottom","backgroundColor","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","borderRadius","XS","elevation","flexDirection","alignItems","overflow","minHeight","paddingRight","SM","aspectRatio","marginRight","justifyContent","fontSize","fontFamily","lineHeight","opacity"],"sources":["SquareImageList.js"],"sourcesContent":["import React from \"react\";\nimport {\n\tView,\n\tText,\n\tImage,\n\tStyleSheet,\n\tTouchableOpacity,\n\tFlatList,\n} from \"react-native\";\nimport { Icon } from \"react-native-elements\";\nimport { Components } from \"../../core.config\";\nimport { values } from \"../../values.config\";\nimport { SPACING } from \"../../js/spacing\";\nimport { getSummaryFieldValue } from \"../../js/helpers\";\n\nconst getEmptyStateMessage = (title) => {\n\tconst featureName = title || \"Feature\";\n\treturn `${featureName} listings will appear here once they're available.\\nCome back soon to see what's new!`;\n};\n\nconst SquareImageList = ({\n\tlistings,\n\tonItemPress,\n\tcolourBrandingMain,\n\trefreshing,\n\tonRefresh,\n\ttitle,\n\tfeatureDefinition,\n}) => {\n\tconst getImageSource = (imageField) => {\n\t\tif (!imageField) return null;\n\n\t\t// Handle different image field formats\n\t\tif (typeof imageField === \"string\") {\n\t\t\treturn { uri: imageField };\n\t\t}\n\n\t\tif (typeof imageField === \"object\" && imageField.uri) {\n\t\t\treturn imageField;\n\t\t}\n\n\t\tif (typeof imageField === \"object\" && imageField.url) {\n\t\t\treturn { uri: imageField.url };\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tconst renderListingItem = ({ item: listing }) => {\n\t\tconst title = listing.fields?.[values.mandatoryFields.title] || \"Untitled\";\n\t\tconst summary = getSummaryFieldValue(listing, featureDefinition);\n\t\tconst imageField = listing.fields?.[values.mandatoryFields.featureImage];\n\t\tconst imageSource = getImageSource(imageField);\n\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={styles.cardContainer}\n\t\t\t\tonPress={() => onItemPress && onItemPress(listing)}\n\t\t\t>\n\t\t\t\t<View style={styles.borderContainer}>\n\t\t\t\t\t{imageSource ? (\n\t\t\t\t\t\t<Image source={imageSource} style={styles.squareImage} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<View style={[styles.squareImage, styles.placeholderImage]}></View>\n\t\t\t\t\t)}\n\t\t\t\t\t<View style={styles.contentContainer}>\n\t\t\t\t\t\t<View style={styles.textContainer}>\n\t\t\t\t\t\t\t<Text style={styles.titleText} numberOfLines={1}>\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text style={styles.descriptionText} numberOfLines={2}>\n\t\t\t\t\t\t\t\t{summary}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<View style={styles.chevronContainer}>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\t\tname=\"chevron-right\"\n\t\t\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\t\t\tcolor=\"#ccc\"\n\t\t\t\t\t\t\t\tstyle={styles.chevron}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t};\n\n\tif (!listings || listings.length === 0) {\n\t\treturn (\n\t\t\t<View style={styles.emptyContainer}>\n\t\t\t\t<Components.EmptyStateWidget\n\t\t\t\t\ttitle={getEmptyStateMessage(title)}\n\t\t\t\t\theight={120}\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\tif (onRefresh) {\n\t\treturn (\n\t\t\t<View style={styles.container}>\n\t\t\t\t<Components.LoadingIndicator visible={refreshing} />\n\t\t\t\t<FlatList\n\t\t\t\t\tdata={listings}\n\t\t\t\t\tkeyExtractor={(item) => item.id}\n\t\t\t\t\trenderItem={renderListingItem}\n\t\t\t\t\tcontentContainerStyle={styles.scrollContainer}\n\t\t\t\t\tshowsVerticalScrollIndicator={false}\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FlatList\n\t\t\tdata={listings}\n\t\t\tkeyExtractor={(item) => item.id}\n\t\t\trenderItem={renderListingItem}\n\t\t\tcontentContainerStyle={styles.scrollContainer}\n\t\t\tshowsVerticalScrollIndicator={false}\n\t\t/>\n\t);\n};\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1,\n\t},\n\tscrollContainer: {\n\t\tpaddingHorizontal: SPACING.MD,\n\t\tpaddingVertical: SPACING.MD,\n\t},\n\tcardContainer: {\n\t\tmarginBottom: SPACING.MD,\n\t\tbackgroundColor: \"#ffffff\",\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: {\n\t\t\twidth: 0,\n\t\t\theight: 2,\n\t\t},\n\t\tshadowOpacity: 0.1,\n\t\tshadowRadius: 3.84,\n\t},\n\tborderContainer: {\n\t\tborderRadius: SPACING.XS,\n\t\tbackgroundColor: \"#ffffff\",\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: {\n\t\t\twidth: 0,\n\t\t\theight: 4,\n\t\t},\n\t\tshadowOpacity: 0.15,\n\t\tshadowRadius: 8,\n\t\televation: 4,\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\toverflow: \"hidden\",\n\t\tminHeight: 100,\n\t\tpaddingRight: SPACING.SM,\n\t},\n\tsquareImage: {\n\t\theight: 100,\n\t\taspectRatio: 1,\n\t\tbackgroundColor: \"#f0f0f0\",\n\t\tmarginRight: SPACING.MD,\n\t},\n\tplaceholderImage: {\n\t\tbackgroundColor: \"#808080\",\n\t\tjustifyContent: \"center\",\n\t},\n\tcontentContainer: {\n\t\tflex: 1,\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t},\n\ttextContainer: {\n\t\tflex: 1,\n\t},\n\ttitleText: {\n\t\tfontSize: 18,\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: \"#333\",\n\t\tmarginBottom: SPACING.XS,\n\t},\n\tdescriptionText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 14,\n\t\tcolor: \"#666\",\n\t\tlineHeight: 18,\n\t},\n\temptyContainer: {\n\t\tpaddingVertical: SPACING.MD,\n\t},\n\tchevronContainer: {\n\t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B,CAAC;EACD7B,gBAAgB,EAAE;IACjBgC,eAAe,EAAE,SAAS;IAC1BiB,cAAc,EAAE;EACjB,CAAC;EACDhD,gBAAgB,EAAE;IACjB0B,IAAI,EAAE,CAAC;IACPc,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACb,CAAC;EACDxC,aAAa,EAAE;IACdyB,IAAI,EAAE;EACP,CAAC;EACDxB,SAAS,EAAE;IACV+C,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,WAAW;IACvBzC,KAAK,EAAE,MAAM;IACbqB,YAAY,EAAEjE,OAAO,CAACyE;EACvB,CAAC;EACDlC,eAAe,EAAE;IAChB8C,UAAU,EAAE,YAAY;IACxBD,QAAQ,EAAE,EAAE;IACZxC,KAAK,EAAE,MAAM;IACb0C,UAAU,EAAE;EACb,CAAC;EACDvC,cAAc,EAAE;IACfiB,eAAe,EAAEhE,OAAO,CAAC+D;EAC1B,CAAC;EACDvB,gBAAgB,EAAE;IACjB2C,cAAc,EAAE,QAAQ;IACxBrB,iBAAiB,EAAE9D,OAAO,CAACgF;EAC5B,CAAC;EACDnC,OAAO,EAAE;IACR0C,OAAO,EAAE;EACV;AACD,CAAC,CAAC;AAEF,eAAelF,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Config } from "../core.config";
|
|
2
|
+
export const CONST_STRINGS = {
|
|
3
|
+
EMPTY_GROUPS: "You aren't in any Circles",
|
|
4
|
+
EMPTY_PEOPLE: "Contacts will show here"
|
|
5
|
+
};
|
|
6
|
+
export const getTinyChatDefault = () => Config.env.tinyChatDefault;
|
|
7
|
+
export const getNewEventDefaults = () => Config.env.newEventDefaults;
|
|
8
|
+
|
|
9
|
+
// TODO: Add configurations as required
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Config","CONST_STRINGS","EMPTY_GROUPS","EMPTY_PEOPLE","getTinyChatDefault","env","tinyChatDefault","getNewEventDefaults","newEventDefaults"],"sources":["index.js"],"sourcesContent":["import { Config } from \"../core.config\";\n\nexport const CONST_STRINGS = {\n\tEMPTY_GROUPS: \"You aren't in any Circles\",\n\tEMPTY_PEOPLE: \"Contacts will show here\",\n};\nexport const getTinyChatDefault = () => Config.env.tinyChatDefault;\nexport const getNewEventDefaults = () => Config.env.newEventDefaults;\n\n// TODO: Add configurations as required\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,gBAAgB;AAEvC,OAAO,MAAMC,aAAa,GAAG;EAC5BC,YAAY,EAAE,2BAA2B;EACzCC,YAAY,EAAE;AACf,CAAC;AACD,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAMJ,MAAM,CAACK,GAAG,CAACC,eAAe;AAClE,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAMP,MAAM,CAACK,GAAG,CAACG,gBAAgB;;AAEpE","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
+
import * as PlussCore from "@plusscommunities/pluss-core-app";
|
|
3
|
+
const {
|
|
4
|
+
Apis,
|
|
5
|
+
Fonts,
|
|
6
|
+
Actions,
|
|
7
|
+
ActionTypes,
|
|
8
|
+
Config,
|
|
9
|
+
Components,
|
|
10
|
+
Styles,
|
|
11
|
+
Session,
|
|
12
|
+
Helper,
|
|
13
|
+
Constants,
|
|
14
|
+
Colours
|
|
15
|
+
} = PlussCore;
|
|
16
|
+
export { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours };
|
|
17
|
+
//# sourceMappingURL=core.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PlussCore","Apis","Fonts","Actions","ActionTypes","Config","Components","Styles","Session","Helper","Constants","Colours"],"sources":["core.config.js"],"sourcesContent":["// import * as PlussCore from '../../pluss-core/src';\nimport * as PlussCore from \"@plusscommunities/pluss-core-app\";\n\nconst {\n\tApis,\n\tFonts,\n\tActions,\n\tActionTypes,\n\tConfig,\n\tComponents,\n\tStyles,\n\tSession,\n\tHelper,\n\tConstants,\n\tColours,\n} = PlussCore;\nexport {\n\tApis,\n\tFonts,\n\tActions,\n\tActionTypes,\n\tConfig,\n\tComponents,\n\tStyles,\n\tSession,\n\tHelper,\n\tConstants,\n\tColours,\n};\n"],"mappings":"AAAA;AACA,OAAO,KAAKA,SAAS,MAAM,kCAAkC;AAE7D,MAAM;EACLC,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,WAAW;EACXC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC,MAAM;EACNC,SAAS;EACTC;AACD,CAAC,GAAGX,SAAS;AACb,SACCC,IAAI,EACJC,KAAK,EACLC,OAAO,EACPC,WAAW,EACXC,MAAM,EACNC,UAAU,EACVC,MAAM,EACNC,OAAO,EACPC,MAAM,EACNC,SAAS,EACTC,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
// import * as PlussCore from '../../pluss-core/src';
|
|
3
|
+
import * as PlussCore from "@plusscommunities/pluss-core-app";
|
|
4
|
+
import { values } from "./values.config";
|
|
5
|
+
export { PlussCore };
|
|
6
|
+
export const Services = {
|
|
7
|
+
navigation: null
|
|
8
|
+
};
|
|
9
|
+
export const BaseComponents = {
|
|
10
|
+
NotificationBell: null
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// These will be set when the components are imported in index.js
|
|
14
|
+
export const setWidgets = (small, large, grid) => {
|
|
15
|
+
WidgetSmall = small;
|
|
16
|
+
WidgetLarge = large;
|
|
17
|
+
WidgetGrid = grid;
|
|
18
|
+
};
|
|
19
|
+
const fetchFeatured = async (site, store, props) => {
|
|
20
|
+
// No-op: listings are already loaded by loadTargetFeature()
|
|
21
|
+
return [];
|
|
22
|
+
};
|
|
23
|
+
const getFeatured = (state, features) => {
|
|
24
|
+
var _state$values$reducer;
|
|
25
|
+
if (!_.includes(features, values.featureKey)) return null;
|
|
26
|
+
const listings = ((_state$values$reducer = state[values.reducerKey]) === null || _state$values$reducer === void 0 ? void 0 : _state$values$reducer.listings) || [];
|
|
27
|
+
if (!listings || listings.length === 0) return [];
|
|
28
|
+
|
|
29
|
+
// Get latest 3-4 listings, sorted by createdAt or updatedAt
|
|
30
|
+
const latestListings = _.orderBy(listings, [item => item.createdAt || item.updatedAt], ["desc"]).slice(0, 4);
|
|
31
|
+
return latestListings.map(listing => {
|
|
32
|
+
var _listing$fields, _listing$fields2;
|
|
33
|
+
const title = ((_listing$fields = listing.fields) === null || _listing$fields === void 0 ? void 0 : _listing$fields[values.mandatoryFields.title]) || values.labels.defaultTitle;
|
|
34
|
+
const imageField = (_listing$fields2 = listing.fields) === null || _listing$fields2 === void 0 ? void 0 : _listing$fields2[values.mandatoryFields.featureImage];
|
|
35
|
+
let imageSource = null;
|
|
36
|
+
if (imageField) {
|
|
37
|
+
if (typeof imageField === "string") {
|
|
38
|
+
imageSource = imageField;
|
|
39
|
+
} else if (imageField !== null && imageField !== void 0 && imageField.url) {
|
|
40
|
+
imageSource = imageField.url;
|
|
41
|
+
} else if (imageField !== null && imageField !== void 0 && imageField.uri) {
|
|
42
|
+
imageSource = imageField.uri;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
id: listing.id,
|
|
47
|
+
type: values.featureKey,
|
|
48
|
+
title: title,
|
|
49
|
+
description: "",
|
|
50
|
+
image: imageSource,
|
|
51
|
+
date: listing.createdAt || listing.updatedAt || 0,
|
|
52
|
+
data: listing
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const FeatureConfig = {
|
|
57
|
+
key: values.featureKey,
|
|
58
|
+
aliases: ["feature-builder", "custom-features"],
|
|
59
|
+
title: values.featureName,
|
|
60
|
+
gridMenu: {
|
|
61
|
+
icon: values.navigation.gridMenu.icon,
|
|
62
|
+
viewBox: values.navigation.gridMenu.viewBox,
|
|
63
|
+
navigate: values.navigation.gridMenu.navigate,
|
|
64
|
+
options: values.navigation.gridMenu.options
|
|
65
|
+
},
|
|
66
|
+
// For now, keep other menus minimal since this is primarily a display feature
|
|
67
|
+
addMenu: null,
|
|
68
|
+
moreMenu: null,
|
|
69
|
+
kioskAction: null,
|
|
70
|
+
notification: null,
|
|
71
|
+
// No notifications for MVP
|
|
72
|
+
submission: null,
|
|
73
|
+
// No submissions for MVP
|
|
74
|
+
|
|
75
|
+
featured: {
|
|
76
|
+
type: values.featureKey,
|
|
77
|
+
prop: values.featureKey,
|
|
78
|
+
reducer: {
|
|
79
|
+
key: values.featureKey,
|
|
80
|
+
prop: "list"
|
|
81
|
+
},
|
|
82
|
+
updateKey: values.featureKey,
|
|
83
|
+
fetch: fetchFeatured,
|
|
84
|
+
get: getFeatured
|
|
85
|
+
},
|
|
86
|
+
hideTabBar: [],
|
|
87
|
+
// No special tab bar hiding needed
|
|
88
|
+
|
|
89
|
+
env: {
|
|
90
|
+
baseStage: "",
|
|
91
|
+
baseAPIUrl: "",
|
|
92
|
+
hasGradientHeader: false,
|
|
93
|
+
defaultProfileImage: "",
|
|
94
|
+
tinyChatDefault: "",
|
|
95
|
+
baseUploadsUrl: "",
|
|
96
|
+
allowMediaDownload: false,
|
|
97
|
+
allowMediaSharing: false,
|
|
98
|
+
awsUploadsBucket: "",
|
|
99
|
+
awsStorageBucket: "",
|
|
100
|
+
preferredSite: "",
|
|
101
|
+
strings: {},
|
|
102
|
+
newEventDefaults: "",
|
|
103
|
+
defaultAllowComments: true
|
|
104
|
+
},
|
|
105
|
+
init: (environment, navigation, notificationBell) => {
|
|
106
|
+
FeatureConfig.env = environment;
|
|
107
|
+
Services.navigation = navigation;
|
|
108
|
+
BaseComponents.NotificationBell = notificationBell;
|
|
109
|
+
PlussCore.Config.init(environment, navigation);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
export default FeatureConfig;
|
|
113
|
+
//# sourceMappingURL=feature.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_","PlussCore","values","Services","navigation","BaseComponents","NotificationBell","setWidgets","small","large","grid","WidgetSmall","WidgetLarge","WidgetGrid","fetchFeatured","site","store","props","getFeatured","state","features","_state$values$reducer","includes","featureKey","listings","reducerKey","length","latestListings","orderBy","item","createdAt","updatedAt","slice","map","listing","_listing$fields","_listing$fields2","title","fields","mandatoryFields","labels","defaultTitle","imageField","featureImage","imageSource","url","uri","id","type","description","image","date","data","FeatureConfig","key","aliases","featureName","gridMenu","icon","viewBox","navigate","options","addMenu","moreMenu","kioskAction","notification","submission","featured","prop","reducer","updateKey","fetch","get","hideTabBar","env","baseStage","baseAPIUrl","hasGradientHeader","defaultProfileImage","tinyChatDefault","baseUploadsUrl","allowMediaDownload","allowMediaSharing","awsUploadsBucket","awsStorageBucket","preferredSite","strings","newEventDefaults","defaultAllowComments","init","environment","notificationBell","Config"],"sources":["feature.config.js"],"sourcesContent":["import _ from \"lodash\";\n// import * as PlussCore from '../../pluss-core/src';\nimport * as PlussCore from \"@plusscommunities/pluss-core-app\";\nimport { values } from \"./values.config\";\n\nexport { PlussCore };\n\nexport const Services = {\n\tnavigation: null,\n};\n\nexport const BaseComponents = {\n\tNotificationBell: null,\n};\n\n// These will be set when the components are imported in index.js\nexport const setWidgets = (small, large, grid) => {\n\tWidgetSmall = small;\n\tWidgetLarge = large;\n\tWidgetGrid = grid;\n};\n\nconst fetchFeatured = async (site, store, props) => {\n\t// No-op: listings are already loaded by loadTargetFeature()\n\treturn [];\n};\n\nconst getFeatured = (state, features) => {\n\tif (!_.includes(features, values.featureKey)) return null;\n\n\tconst listings = state[values.reducerKey]?.listings || [];\n\tif (!listings || listings.length === 0) return [];\n\n\t// Get latest 3-4 listings, sorted by createdAt or updatedAt\n\tconst latestListings = _.orderBy(\n\t\tlistings,\n\t\t[(item) => item.createdAt || item.updatedAt],\n\t\t[\"desc\"]\n\t).slice(0, 4);\n\n\treturn latestListings.map((listing) => {\n\t\tconst title = listing.fields?.[values.mandatoryFields.title] || values.labels.defaultTitle;\n\t\tconst imageField = listing.fields?.[values.mandatoryFields.featureImage];\n\t\tlet imageSource = null;\n\n\t\tif (imageField) {\n\t\t\tif (typeof imageField === \"string\") {\n\t\t\t\timageSource = imageField;\n\t\t\t} else if (imageField?.url) {\n\t\t\t\timageSource = imageField.url;\n\t\t\t} else if (imageField?.uri) {\n\t\t\t\timageSource = imageField.uri;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tid: listing.id,\n\t\t\ttype: values.featureKey,\n\t\t\ttitle: title,\n\t\t\tdescription: \"\",\n\t\t\timage: imageSource,\n\t\t\tdate: listing.createdAt || listing.updatedAt || 0,\n\t\t\tdata: listing,\n\t\t};\n\t});\n};\n\nconst FeatureConfig = {\n\tkey: values.featureKey,\n\taliases: [\"feature-builder\", \"custom-features\"],\n\ttitle: values.featureName,\n\n\tgridMenu: {\n\t\ticon: values.navigation.gridMenu.icon,\n\t\tviewBox: values.navigation.gridMenu.viewBox,\n\t\tnavigate: values.navigation.gridMenu.navigate,\n\t\toptions: values.navigation.gridMenu.options,\n\t},\n\n\t// For now, keep other menus minimal since this is primarily a display feature\n\taddMenu: null,\n\tmoreMenu: null,\n\tkioskAction: null,\n\n\tnotification: null, // No notifications for MVP\n\tsubmission: null, // No submissions for MVP\n\n\tfeatured: {\n\t\ttype: values.featureKey,\n\t\tprop: values.featureKey,\n\t\treducer: {\n\t\t\tkey: values.featureKey,\n\t\t\tprop: \"list\",\n\t\t},\n\t\tupdateKey: values.featureKey,\n\t\tfetch: fetchFeatured,\n\t\tget: getFeatured,\n\t},\n\n\thideTabBar: [], // No special tab bar hiding needed\n\n\tenv: {\n\t\tbaseStage: \"\",\n\t\tbaseAPIUrl: \"\",\n\t\thasGradientHeader: false,\n\t\tdefaultProfileImage: \"\",\n\t\ttinyChatDefault: \"\",\n\t\tbaseUploadsUrl: \"\",\n\t\tallowMediaDownload: false,\n\t\tallowMediaSharing: false,\n\t\tawsUploadsBucket: \"\",\n\t\tawsStorageBucket: \"\",\n\t\tpreferredSite: \"\",\n\t\tstrings: {},\n\t\tnewEventDefaults: \"\",\n\t\tdefaultAllowComments: true,\n\t},\n\n\tinit: (environment, navigation, notificationBell) => {\n\t\tFeatureConfig.env = environment;\n\t\tServices.navigation = navigation;\n\t\tBaseComponents.NotificationBell = notificationBell;\n\t\tPlussCore.Config.init(environment, navigation);\n\t},\n};\n\nexport default FeatureConfig;\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AACtB;AACA,OAAO,KAAKC,SAAS,MAAM,kCAAkC;AAC7D,SAASC,MAAM,QAAQ,iBAAiB;AAExC,SAASD,SAAS;AAElB,OAAO,MAAME,QAAQ,GAAG;EACvBC,UAAU,EAAE;AACb,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;EAC7BC,gBAAgB,EAAE;AACnB,CAAC;;AAED;AACA,OAAO,MAAMC,UAAU,GAAGA,CAACC,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAK;EACjDC,WAAW,GAAGH,KAAK;EACnBI,WAAW,GAAGH,KAAK;EACnBI,UAAU,GAAGH,IAAI;AAClB,CAAC;AAED,MAAMI,aAAa,GAAG,MAAAA,CAAOC,IAAI,EAAEC,KAAK,EAAEC,KAAK,KAAK;EACnD;EACA,OAAO,EAAE;AACV,CAAC;AAED,MAAMC,WAAW,GAAGA,CAACC,KAAK,EAAEC,QAAQ,KAAK;EAAA,IAAAC,qBAAA;EACxC,IAAI,CAACrB,CAAC,CAACsB,QAAQ,CAACF,QAAQ,EAAElB,MAAM,CAACqB,UAAU,CAAC,EAAE,OAAO,IAAI;EAEzD,MAAMC,QAAQ,GAAG,EAAAH,qBAAA,GAAAF,KAAK,CAACjB,MAAM,CAACuB,UAAU,CAAC,cAAAJ,qBAAA,uBAAxBA,qBAAA,CAA0BG,QAAQ,KAAI,EAAE;EACzD,IAAI,CAACA,QAAQ,IAAIA,QAAQ,CAACE,MAAM,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iBAAiB,EAAE,KAAK;IACxBC,gBAAgB,EAAE,EAAE;IACpBC,gBAAgB,EAAE,EAAE;IACpBC,aAAa,EAAE,EAAE;IACjBC,OAAO,EAAE,CAAC,CAAC;IACXC,gBAAgB,EAAE,EAAE;IACpBC,oBAAoB,EAAE;EACvB,CAAC;EAEDC,IAAI,EAAEA,CAACC,WAAW,EAAEtF,UAAU,EAAEuF,gBAAgB,KAAK;IACpDtC,aAAa,CAACqB,GAAG,GAAGgB,WAAW;IAC/BvF,QAAQ,CAACC,UAAU,GAAGA,UAAU;IAChCC,cAAc,CAACC,gBAAgB,GAAGqF,gBAAgB;IAClD1F,SAAS,CAAC2F,MAAM,CAACH,IAAI,CAACC,WAAW,EAAEtF,UAAU,CAAC;EAC/C;AACD,CAAC;AAED,eAAeiD,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import FeatureConfig, { setWidgets } from "./feature.config";
|
|
2
|
+
import featureBuilderReducer from "./reducers/featureBuilderReducer";
|
|
3
|
+
import FeatureListScreen from "./components/FeatureListScreen";
|
|
4
|
+
import FeatureDetailScreen from "./components/FeatureDetailScreen";
|
|
5
|
+
import WidgetSmall from "./components/WidgetSmall";
|
|
6
|
+
import WidgetLarge from "./components/WidgetLarge";
|
|
7
|
+
import WidgetGrid from "./components/WidgetGrid";
|
|
8
|
+
import { values } from "./values.config";
|
|
9
|
+
|
|
10
|
+
// Set widgets in the config to avoid circular dependencies
|
|
11
|
+
setWidgets(WidgetSmall, WidgetLarge, WidgetGrid);
|
|
12
|
+
export const Reducers = {
|
|
13
|
+
[values.reducerKey]: featureBuilderReducer
|
|
14
|
+
};
|
|
15
|
+
export const Screens = {
|
|
16
|
+
FeatureBuilderList: FeatureListScreen,
|
|
17
|
+
FeatureBuilderDetail: FeatureDetailScreen
|
|
18
|
+
};
|
|
19
|
+
export { default as Config } from "./feature.config";
|
|
20
|
+
export { default as WidgetSmall } from "./components/WidgetSmall";
|
|
21
|
+
export { default as WidgetLarge } from "./components/WidgetLarge";
|
|
22
|
+
export { default as WidgetGrid } from "./components/WidgetGrid";
|
|
23
|
+
export { FeatureConfig };
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FeatureConfig","setWidgets","featureBuilderReducer","FeatureListScreen","FeatureDetailScreen","WidgetSmall","WidgetLarge","WidgetGrid","values","Reducers","reducerKey","Screens","FeatureBuilderList","FeatureBuilderDetail","default","Config"],"sources":["index.js"],"sourcesContent":["import FeatureConfig, { setWidgets } from \"./feature.config\";\nimport featureBuilderReducer from \"./reducers/featureBuilderReducer\";\nimport FeatureListScreen from \"./components/FeatureListScreen\";\nimport FeatureDetailScreen from \"./components/FeatureDetailScreen\";\nimport WidgetSmall from \"./components/WidgetSmall\";\nimport WidgetLarge from \"./components/WidgetLarge\";\nimport WidgetGrid from \"./components/WidgetGrid\";\nimport { values } from \"./values.config\";\n\n// Set widgets in the config to avoid circular dependencies\nsetWidgets(WidgetSmall, WidgetLarge, WidgetGrid);\n\nexport const Reducers = {\n\t[values.reducerKey]: featureBuilderReducer,\n};\n\nexport const Screens = {\n\tFeatureBuilderList: FeatureListScreen,\n\tFeatureBuilderDetail: FeatureDetailScreen,\n};\n\nexport { default as Config } from \"./feature.config\";\nexport { default as WidgetSmall } from \"./components/WidgetSmall\";\nexport { default as WidgetLarge } from \"./components/WidgetLarge\";\nexport { default as WidgetGrid } from \"./components/WidgetGrid\";\n\nexport { FeatureConfig };\n"],"mappings":"AAAA,OAAOA,aAAa,IAAIC,UAAU,QAAQ,kBAAkB;AAC5D,OAAOC,qBAAqB,MAAM,kCAAkC;AACpE,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,WAAW,MAAM,0BAA0B;AAClD,OAAOC,WAAW,MAAM,0BAA0B;AAClD,OAAOC,UAAU,MAAM,yBAAyB;AAChD,SAASC,MAAM,QAAQ,iBAAiB;;AAExC;AACAP,UAAU,CAACI,WAAW,EAAEC,WAAW,EAAEC,UAAU,CAAC;AAEhD,OAAO,MAAME,QAAQ,GAAG;EACvB,CAACD,MAAM,CAACE,UAAU,GAAGR;AACtB,CAAC;AAED,OAAO,MAAMS,OAAO,GAAG;EACtBC,kBAAkB,EAAET,iBAAiB;EACrCU,oBAAoB,EAAET;AACvB,CAAC;AAED,SAASU,OAAO,IAAIC,MAAM,QAAQ,kBAAkB;AACpD,SAASD,OAAO,IAAIT,WAAW,QAAQ,0BAA0B;AACjE,SAASS,OAAO,IAAIR,WAAW,QAAQ,0BAA0B;AACjE,SAASQ,OAAO,IAAIP,UAAU,QAAQ,yBAAyB;AAE/D,SAASP,aAAa","ignoreList":[]}
|