@plusscommunities/pluss-feature-builder-app-d 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 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","SPACING","Platform","View","ScrollView","Animated","Dimensions","StatusBar","Text","TouchableOpacity","Linking","StyleSheet","KeyboardAvoidingView","Image","Icon","connect","_","LinearGradient","Services","Components","Colours","COLOUR_TRANSPARENT","TEXT_DARK","TEXT_MID","LINEGREY","FileDownload","values","selectFeatureDefinition","Constants","InlineButton","FIELD_TYPES","SCREEN_HEIGHT","get","height","CARD_IMAGE_HEIGHT","SCREEN_WIDTH","width","StatusBarHeight","size","getStatusBarHeight","OS","statusBarHeight","currentHeight","FeatureDetailScreen","constructor","props","_defineProperty","navigation","goBack","listing","featureDefinition","fields","allImages","fieldDefinitions","primaryImage","mandatoryFields","featureImage","imageObj","normalizeImageField","push","fieldId","fieldLabel","labels","forEach","fieldDef","type","IMAGE","GALLERY","id","fieldValue","Array","isArray","item","label","imageField","uri","url","imageIndex","state","length","setState","showImagePopup","selectedImageIndex","openURL","catch","err","file","isHomeTab","componentDidMount","getParentRoute","collectAllImages","componentDidUpdate","prevProps","componentWillUnmount","setBarStyle","processFields","excludedFieldIds","Set","title","filteredFields","Object","keys","filter","has","hasDefinition","some","f","map","fieldDefinition","find","fieldType","TEXT","sortBy","field","_field$fieldDefinitio","order","renderField","colourBrandingMain","safeFieldDef","CTA","btnLabel","btnUrl","createElement","style","styles","ctaContainer","large","color","onPress","handleLinkPress","EMAIL","linkContainer","name","fieldIcon","linkText","DATE","dateContainer","bodyText","FILE","files","filesContainer","sectionTitle","attachments","index","key","handleFilePress","DESCRIPTION","descriptionText","imgUri","findIndex","img","caption","openImagePopup","activeOpacity","source","inlineImage","resizeMode","imageCaption","marginVertical","flexDirection","flexWrap","marginHorizontal","imgItem","globalIndex","padding","TITLE","titleText","NUMBER","numberText","JSON","stringify","renderFields","processedFields","_index","_field$fieldDefinitio2","_field$fieldDefinitio3","fieldContainer","getImageSource","getTitle","defaultTitle","render","imageSource","centerContainer","errorText","behavior","position","flex","backgroundColor","BACKGROUND_WHITE","backButton","headerContent","BackButton","onPressBack","marginLeft","keyboardShouldPersistTaps","ref","scrollView","mainHeader","AutoOffsetImage","grayPlaceholder","gradientOverlay","colors","start","x","y","end","locations","paddingHorizontal","titleContainer","eventTitle","minHeight","ImagePopup","visible","images","onClose","closeImagePopup","create","left","top","zIndex","elevation","alignSelf","paddingTop","image","undefined","fontFamily","fontSize","marginBottom","textTransform","letterSpacing","textAlign","paddingVertical","borderRadius","maxWidth","lineHeight","fontWeight","alignItems","textDecorationLine","fontStyle","marginTop","justifyContent","SM","marginRight","section","divider","facilityDetailTitle","facilityDetailContent","facilityDetailsContainer","facilityDetailsTextContainer","facilityDetailContainer","facilityDetailTitleContainer","textLink","mapStateToProps","ownProps","getMainBrandingColourFromState","colourBrandingHeader","user","forwardRef"],"sources":["FeatureDetailScreen.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { SPACING } from \"../js/spacing\";\nimport {\n\tPlatform,\n\tView,\n\tScrollView,\n\tAnimated,\n\tDimensions,\n\tStatusBar,\n\tText,\n\tTouchableOpacity,\n\tLinking,\n\tStyleSheet,\n\tKeyboardAvoidingView,\n\tImage,\n} from \"react-native\";\nimport { Icon } from \"react-native-elements\";\nimport { connect } from \"react-redux\";\nimport _ from \"lodash\";\nimport { LinearGradient } from \"expo-linear-gradient\";\nimport { Services } from \"../feature.config\";\nimport {\n\tComponents,\n\tColours,\n\tCOLOUR_TRANSPARENT,\n\tTEXT_DARK,\n} from \"../core.config\";\nimport { TEXT_MID, LINEGREY } from \"../js/Colors\";\nimport FileDownload from \"./FileDownload\";\nimport { values } from \"../values.config\";\nimport { selectFeatureDefinition } from \"../reducers/featureBuilderReducer\";\n\nimport Constants from \"expo-constants\";\nimport { InlineButton } from \"./common\";\nimport { FIELD_TYPES } from \"../js/FieldTypes\";\n\nconst SCREEN_HEIGHT = Dimensions.get(\"window\").height;\nconst CARD_IMAGE_HEIGHT = SCREEN_HEIGHT * 0.3;\nconst SCREEN_WIDTH = Dimensions.get(\"window\").width;\n\n// StatusBarHeight function copied to avoid import from outside extension\nconst StatusBarHeight = (size) => {\n\treturn getStatusBarHeight() + size;\n};\n\nconst getStatusBarHeight = () => {\n\treturn Platform.OS === \"ios\"\n\t\t? Constants.statusBarHeight\n\t\t: StatusBar.currentHeight;\n};\n\nclass FeatureDetailScreen extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tisHomeTab: false,\n\t\t\tshowImagePopup: false,\n\t\t\tselectedImageIndex: 0,\n\t\t\tallImages: [],\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.setState({\n\t\t\tisHomeTab: !Services.navigation.getParentRoute(),\n\t\t\tallImages: this.collectAllImages(),\n\t\t});\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\t// Recalculate allImages when listing or featureDefinition changes\n\t\tif (\n\t\t\tprevProps.listing !== this.props.listing ||\n\t\t\tprevProps.featureDefinition !== this.props.featureDefinition\n\t\t) {\n\t\t\tthis.setState({ allImages: this.collectAllImages() });\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (Platform.OS === \"ios\") StatusBar.setBarStyle(\"dark-content\");\n\t}\n\n\tonPressBack = () => {\n\t\tServices.navigation.goBack();\n\t};\n\n\t/**\n\t * Collect all images from listing fields\n\t */\n\tcollectAllImages = () => {\n\t\tconst { listing, featureDefinition } = this.props;\n\t\tif (!listing || !listing.fields || !featureDefinition) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst allImages = [];\n\t\tconst fieldDefinitions = featureDefinition.fields || [];\n\n\t\t// Add primary feature image first\n\t\tconst primaryImage = listing.fields[values.mandatoryFields.featureImage];\n\t\tif (primaryImage) {\n\t\t\tconst imageObj = this.normalizeImageField(primaryImage);\n\t\t\tif (imageObj) {\n\t\t\t\tallImages.push({\n\t\t\t\t\t...imageObj,\n\t\t\t\t\tfieldId: values.mandatoryFields.featureImage,\n\t\t\t\t\tfieldLabel: values.labels.featureImage,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Add additional image fields\n\t\tfieldDefinitions.forEach((fieldDef) => {\n\t\t\tif (\n\t\t\t\t(fieldDef.type === FIELD_TYPES.IMAGE ||\n\t\t\t\t\tfieldDef.type === FIELD_TYPES.GALLERY) &&\n\t\t\t\tfieldDef.id !== values.mandatoryFields.featureImage\n\t\t\t) {\n\t\t\t\tconst fieldValue = listing.fields[fieldDef.id];\n\n\t\t\t\tif (fieldValue) {\n\t\t\t\t\tif (fieldDef.type === FIELD_TYPES.GALLERY) {\n\t\t\t\t\t\t// Handle Gallery (Array of images)\n\t\t\t\t\t\tif (Array.isArray(fieldValue)) {\n\t\t\t\t\t\t\tfieldValue.forEach((item) => {\n\t\t\t\t\t\t\t\tconst imageObj = this.normalizeImageField(item);\n\t\t\t\t\t\t\t\tif (imageObj) {\n\t\t\t\t\t\t\t\t\tallImages.push({\n\t\t\t\t\t\t\t\t\t\t...imageObj,\n\t\t\t\t\t\t\t\t\t\tfieldId: fieldDef.id,\n\t\t\t\t\t\t\t\t\t\tfieldLabel: fieldDef.label || fieldDef.id,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Handle Single Image\n\t\t\t\t\t\tconst imageObj = this.normalizeImageField(fieldValue);\n\t\t\t\t\t\tif (imageObj) {\n\t\t\t\t\t\t\tallImages.push({\n\t\t\t\t\t\t\t\t...imageObj,\n\t\t\t\t\t\t\t\tfieldId: fieldDef.id,\n\t\t\t\t\t\t\t\tfieldLabel: fieldDef.label || fieldDef.id,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn allImages;\n\t};\n\n\t/**\n\t * Normalize image field to object format\n\t */\n\tnormalizeImageField = (imageField) => {\n\t\tif (!imageField) return null;\n\n\t\tif (typeof imageField === \"string\") {\n\t\t\treturn { uri: imageField, url: imageField };\n\t\t}\n\n\t\tif (typeof imageField === \"object\") {\n\t\t\tif (imageField.uri) {\n\t\t\t\treturn { uri: imageField.uri, url: imageField.uri, ...imageField };\n\t\t\t}\n\t\t\tif (imageField.url) {\n\t\t\t\treturn { uri: imageField.url, url: imageField.url, ...imageField };\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t/**\n\t * Open image popup with all images\n\t */\n\topenImagePopup = (imageIndex = 0) => {\n\t\tconst { allImages } = this.state;\n\t\tif (allImages.length > 0) {\n\t\t\tthis.setState({\n\t\t\t\tshowImagePopup: true,\n\t\t\t\tselectedImageIndex: imageIndex,\n\t\t\t});\n\t\t}\n\t};\n\n\t/**\n\t * Close image popup\n\t */\n\tcloseImagePopup = () => {\n\t\tthis.setState({\n\t\t\tshowImagePopup: false,\n\t\t\tselectedImageIndex: 0,\n\t\t});\n\t};\n\n\t/**\n\t * Process fields: filter out mandatory fields and sort by order\n\t */\n\tprocessFields() {\n\t\tconst { listing, featureDefinition } = this.props;\n\t\tif (!listing || !listing.fields || !featureDefinition) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst fieldDefinitions = featureDefinition.fields || [];\n\t\tconst excludedFieldIds = new Set([\n\t\t\tvalues.mandatoryFields.title,\n\t\t\tvalues.mandatoryFields.featureImage,\n\t\t]);\n\n\t\t// Filter and map fields with their definitions\n\t\tconst filteredFields = Object.keys(listing.fields)\n\t\t\t.filter((fieldId) => {\n\t\t\t\tif (!fieldId || excludedFieldIds.has(fieldId)) return false;\n\t\t\t\tif (listing.fields[fieldId] == null) return false;\n\n\t\t\t\t// Only include fields that have definitions\n\t\t\t\tconst hasDefinition = fieldDefinitions.some((f) => f.id === fieldId);\n\t\t\t\tif (!hasDefinition) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t.map((fieldId) => {\n\t\t\t\tconst fieldDefinition = fieldDefinitions.find(\n\t\t\t\t\t(fieldDef) => fieldDef.id === fieldId,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\tfieldId,\n\t\t\t\t\tfieldValue: listing.fields[fieldId],\n\t\t\t\t\tfieldDefinition,\n\t\t\t\t\tfieldType: fieldDefinition?.type || FIELD_TYPES.TEXT,\n\t\t\t\t};\n\t\t\t});\n\n\t\t// Sort by order property if available\n\t\treturn _.sortBy(\n\t\t\tfilteredFields,\n\t\t\t(field) => field.fieldDefinition?.order || 999,\n\t\t);\n\t}\n\n\t/**\n\t * Handle link opening for various field types\n\t */\n\thandleLinkPress = (url) => {\n\t\tif (url) {\n\t\t\tLinking.openURL(url).catch((err) => {\n\t\t\t\t// Silently handle URL open errors\n\t\t\t});\n\t\t}\n\t};\n\n\thandleFilePress = (file) => {\n\t\tif (file?.url) {\n\t\t\tLinking.openURL(file.url).catch((err) => {\n\t\t\t\t// Silently handle URL open errors\n\t\t\t});\n\t\t}\n\t};\n\n\t/**\n\t * Render individual field based on its type\n\t */\n\trenderField(fieldDef, fieldValue) {\n\t\tconst { colourBrandingMain } = this.props;\n\n\t\t// Defensive: ensure fieldDef is always an object\n\t\tconst safeFieldDef = fieldDef || {};\n\t\tconst type = safeFieldDef.type || FIELD_TYPES.TEXT;\n\t\tconst label = safeFieldDef.label || safeFieldDef.id || \"Unknown Field\";\n\n\t\tswitch (type) {\n\t\t\tcase FIELD_TYPES.CTA: {\n\t\t\t\tconst btnLabel = fieldValue?.label || label;\n\t\t\t\tconst btnUrl = fieldValue?.url;\n\t\t\t\treturn (\n\t\t\t\t\t<View style={styles.ctaContainer}>\n\t\t\t\t\t\t<InlineButton\n\t\t\t\t\t\t\tlarge\n\t\t\t\t\t\t\tcolor={colourBrandingMain}\n\t\t\t\t\t\t\tonPress={() => this.handleLinkPress(btnUrl)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{btnLabel}\n\t\t\t\t\t\t</InlineButton>\n\t\t\t\t\t</View>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcase FIELD_TYPES.EMAIL:\n\t\t\t\treturn (\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tstyle={styles.linkContainer}\n\t\t\t\t\t\tonPress={() => this.handleLinkPress(`mailto:${fieldValue}`)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\tname=\"envelope\"\n\t\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\t\tcolor={colourBrandingMain}\n\t\t\t\t\t\t\tstyle={styles.fieldIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Text style={[styles.linkText, { color: colourBrandingMain }]}>\n\t\t\t\t\t\t\t{fieldValue}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t);\n\n\t\t\tcase FIELD_TYPES.DATE:\n\t\t\t\treturn (\n\t\t\t\t\t<View style={styles.dateContainer}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\tname=\"calendar\"\n\t\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\t\tcolor={TEXT_DARK}\n\t\t\t\t\t\t\tstyle={styles.fieldIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Text style={styles.bodyText}>{fieldValue}</Text>\n\t\t\t\t\t</View>\n\t\t\t\t);\n\n\t\t\tcase FIELD_TYPES.FILE: {\n\t\t\t\t// Handle both single file and multiple files (array)\n\t\t\t\tconst files = Array.isArray(fieldValue) ? fieldValue : [fieldValue];\n\t\t\t\treturn (\n\t\t\t\t\t<View style={styles.filesContainer}>\n\t\t\t\t\t\t<Text style={styles.sectionTitle}>{values.labels.attachments}</Text>\n\t\t\t\t\t\t{files.map((file, index) => {\n\t\t\t\t\t\t\t// Skip null/undefined files\n\t\t\t\t\t\t\tif (!file) return null;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<FileDownload\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\tfile={file}\n\t\t\t\t\t\t\t\t\tonPress={this.handleFilePress}\n\t\t\t\t\t\t\t\t\tcolor={this.props.colourBrandingMain}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</View>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcase FIELD_TYPES.DESCRIPTION:\n\t\t\t\treturn <Text style={styles.descriptionText}>{fieldValue}</Text>;\n\n\t\t\tcase FIELD_TYPES.IMAGE: {\n\t\t\t\t// Render secondary images inline with click handler\n\t\t\t\tconst imgUri =\n\t\t\t\t\tfieldValue?.url ||\n\t\t\t\t\tfieldValue?.uri ||\n\t\t\t\t\t(typeof fieldValue === \"string\" ? fieldValue : null);\n\t\t\t\tif (!imgUri) return null;\n\n\t\t\t\t// Find this image's index for popup\n\t\t\t\tconst { allImages } = this.state;\n\t\t\t\tconst imageIndex = allImages.findIndex(\n\t\t\t\t\t(img) => img.uri === imgUri || img.url === imgUri,\n\t\t\t\t);\n\n\t\t\t\tconst caption = fieldValue?.caption;\n\n\t\t\t\treturn (\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tonPress={() => this.openImagePopup(imageIndex)}\n\t\t\t\t\t\tactiveOpacity={0.8}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\tsource={{ uri: imgUri }}\n\t\t\t\t\t\t\tstyle={styles.inlineImage}\n\t\t\t\t\t\t\tresizeMode=\"cover\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{caption && <Text style={styles.imageCaption}>{caption}</Text>}\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcase FIELD_TYPES.GALLERY: {\n\t\t\t\t// Handle Gallery Fields (arrays of images)\n\t\t\t\tif (!Array.isArray(fieldValue)) return null;\n\n\t\t\t\treturn (\n\t\t\t\t\t<View style={{ marginVertical: 16 }}>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tflexDirection: \"row\",\n\t\t\t\t\t\t\t\tflexWrap: \"wrap\",\n\t\t\t\t\t\t\t\tmarginHorizontal: -4,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{fieldValue.map((imgItem, index) => {\n\t\t\t\t\t\t\t\tconst imgUri =\n\t\t\t\t\t\t\t\t\timgItem?.url ||\n\t\t\t\t\t\t\t\t\timgItem?.uri ||\n\t\t\t\t\t\t\t\t\t(typeof imgItem === \"string\" ? imgItem : null);\n\t\t\t\t\t\t\t\tif (!imgUri) return null;\n\n\t\t\t\t\t\t\t\t// Find global index for the popup\n\t\t\t\t\t\t\t\tconst { allImages } = this.state;\n\t\t\t\t\t\t\t\tconst globalIndex = allImages.findIndex(\n\t\t\t\t\t\t\t\t\t(img) => img.uri === imgUri || img.url === imgUri,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\tonPress={() =>\n\t\t\t\t\t\t\t\t\t\t\tthis.openImagePopup(globalIndex !== -1 ? globalIndex : 0)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tactiveOpacity={0.8}\n\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"50%\", padding: 4 }} // 2 column grid\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\t\t\tsource={{ uri: imgUri }}\n\t\t\t\t\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\t\t\t\t\tstyles.inlineImage,\n\t\t\t\t\t\t\t\t\t\t\t\t{ height: 150, marginVertical: 0 },\n\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\tresizeMode=\"cover\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t);\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);\n\t\t\t}\n\n\t\t\tcase FIELD_TYPES.TITLE:\n\t\t\t\treturn <Text style={styles.titleText}>{fieldValue}</Text>;\n\n\t\t\tcase FIELD_TYPES.NUMBER:\n\t\t\t\treturn <Text style={styles.numberText}>{fieldValue}</Text>;\n\n\t\t\tdefault:\n\t\t\t\t// Default text fallback\n\t\t\t\treturn (\n\t\t\t\t\t<Text style={styles.bodyText}>\n\t\t\t\t\t\t{typeof fieldValue === \"object\"\n\t\t\t\t\t\t\t? JSON.stringify(fieldValue)\n\t\t\t\t\t\t\t: fieldValue}\n\t\t\t\t\t</Text>\n\t\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Render all fields with proper spacing and structure\n\t */\n\trenderFields() {\n\t\tconst processedFields = this.processFields();\n\n\t\treturn processedFields.map((field, _index) => {\n\t\t\treturn (\n\t\t\t\t<View key={field.fieldId} style={styles.fieldContainer}>\n\t\t\t\t\t{field.fieldType !== FIELD_TYPES.CTA &&\n\t\t\t\t\t\tfield.fieldType !== FIELD_TYPES.IMAGE &&\n\t\t\t\t\t\tfield.fieldDefinition?.label && (\n\t\t\t\t\t\t\t<Text style={styles.fieldLabel}>\n\t\t\t\t\t\t\t\t{field.fieldDefinition?.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t{this.renderField(field.fieldDefinition, field.fieldValue)}\n\t\t\t\t</View>\n\t\t\t);\n\t\t});\n\t}\n\n\tgetImageSource() {\n\t\tconst { listing } = this.props;\n\t\tif (!listing || !listing.fields) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst imageField = listing.fields[values.mandatoryFields.featureImage];\n\t\tif (!imageField) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Parse the image field value\n\t\tif (typeof imageField === \"string\") {\n\t\t\treturn imageField;\n\t\t}\n\n\t\treturn imageField?.uri || imageField?.url || null;\n\t}\n\n\tgetTitle() {\n\t\tconst { listing } = this.props;\n\t\tif (!listing || !listing.fields) {\n\t\t\treturn values.labels.defaultTitle;\n\t\t}\n\n\t\treturn (\n\t\t\tlisting.fields[values.mandatoryFields.title] || values.labels.defaultTitle\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { listing } = this.props;\n\t\tconst imageSource = this.getImageSource();\n\t\tconst title = this.getTitle();\n\n\t\tif (!listing || !listing.fields) {\n\t\t\treturn (\n\t\t\t\t<View style={styles.centerContainer}>\n\t\t\t\t\t<Text style={styles.errorText}>Item not found</Text>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<KeyboardAvoidingView\n\t\t\t\tbehavior={Platform.OS === \"ios\" && \"padding\"}\n\t\t\t\tstyle={{\n\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\tflex: 1,\n\t\t\t\t\tbackgroundColor: Colours.BACKGROUND_WHITE || \"#fff\",\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<View style={styles.backButton}>\n\t\t\t\t\t<View style={styles.headerContent}>\n\t\t\t\t\t\t<Components.BackButton\n\t\t\t\t\t\t\tonPress={this.onPressBack}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tmarginLeft: 16,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\n\t\t\t\t<ScrollView\n\t\t\t\t\tstyle={{ backgroundColor: Colours.BACKGROUND_WHITE || \"#fff\" }}\n\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\tref={(ref) => {\n\t\t\t\t\t\tthis.scrollView = ref;\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<View style={[styles.mainHeader]}>\n\t\t\t\t\t\t{imageSource ? (\n\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\tonPress={() => this.openImagePopup(0)}\n\t\t\t\t\t\t\t\tactiveOpacity={0.9}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Components.AutoOffsetImage\n\t\t\t\t\t\t\t\t\turi={imageSource}\n\t\t\t\t\t\t\t\t\theight={CARD_IMAGE_HEIGHT}\n\t\t\t\t\t\t\t\t\twidth={SCREEN_WIDTH}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\t\tstyles.grayPlaceholder,\n\t\t\t\t\t\t\t\t\t{ height: CARD_IMAGE_HEIGHT, width: SCREEN_WIDTH },\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<LinearGradient\n\t\t\t\t\t\t\tstyle={styles.gradientOverlay}\n\t\t\t\t\t\t\tcolors={[\"rgba(0,0,0,0.7)\", COLOUR_TRANSPARENT]}\n\t\t\t\t\t\t\tstart={{ x: 0, y: 0 }}\n\t\t\t\t\t\t\tend={{ x: 0, y: 1 }}\n\t\t\t\t\t\t\tlocations={[0, 0.5]}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t\t<View style={{ paddingHorizontal: 16 }}>\n\t\t\t\t\t\t<View style={styles.titleContainer}>\n\t\t\t\t\t\t\t<Text style={styles.eventTitle}>{title}</Text>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t\t<View style={{ minHeight: SCREEN_HEIGHT - CARD_IMAGE_HEIGHT - 56 }}>\n\t\t\t\t\t\t{this.renderFields()}\n\t\t\t\t\t</View>\n\t\t\t\t</ScrollView>\n\n\t\t\t\t{/* Image Popup */}\n\t\t\t\t{this.state.showImagePopup && (\n\t\t\t\t\t<Components.ImagePopup\n\t\t\t\t\t\tvisible={this.state.showImagePopup}\n\t\t\t\t\t\timages={this.state.allImages}\n\t\t\t\t\t\tindex={this.state.selectedImageIndex}\n\t\t\t\t\t\tonClose={this.closeImagePopup}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</KeyboardAvoidingView>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tbackButton: {\n\t\tposition: \"absolute\",\n\t\tleft: 0,\n\t\ttop: 0,\n\t\tzIndex: 10,\n\t\televation: 10,\n\t\theight: StatusBarHeight(70),\n\t},\n\theaderContent: {\n\t\talignSelf: \"stretch\",\n\t\tflexDirection: \"row\",\n\t\tflex: 1,\n\t\tpaddingTop: StatusBarHeight(12),\n\t},\n\timage: {\n\t\tbackgroundColor: Colours.BACKGROUND_WHITE || \"#fff\",\n\t\tposition: \"relative\",\n\t\twidth: undefined,\n\t\theight: undefined,\n\t\tflex: 1,\n\t},\n\tmainHeader: {\n\t\tposition: \"relative\",\n\t\theight: CARD_IMAGE_HEIGHT,\n\t\twidth: SCREEN_WIDTH,\n\t},\n\n\tgradientOverlay: {\n\t\tflex: 1,\n\t},\n\n\t// Field container and spacing\n\tfieldContainer: {\n\t\tpaddingHorizontal: 16,\n\t\tmarginVertical: 12,\n\t},\n\n\t// Field labels/captions\n\tfieldLabel: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 11,\n\t\tcolor: TEXT_MID,\n\t\tmarginBottom: 6,\n\t\ttextTransform: \"uppercase\",\n\t\tletterSpacing: 1.2,\n\t\talignSelf: \"center\",\n\t\ttextAlign: \"center\",\n\t\tpaddingHorizontal: 8,\n\t\tpaddingVertical: 4,\n\t\tbackgroundColor: \"rgba(0,0,0,0.03)\",\n\t\tborderRadius: 12,\n\t\tmaxWidth: \"80%\",\n\t},\n\n\t// Field type styles\n\tbodyText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_DARK,\n\t\tlineHeight: 22,\n\t},\n\ttitleText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"600\",\n\t\tcolor: TEXT_DARK,\n\t},\n\tdescriptionText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_DARK,\n\t\tlineHeight: 24,\n\t},\n\tnumberText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"500\",\n\t\tcolor: TEXT_DARK,\n\t},\n\n\t// Link styles\n\tlinkContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tpaddingVertical: 4,\n\t},\n\tlinkText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\ttextDecorationLine: \"underline\",\n\t},\n\n\t// Date styles\n\tdateContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tpaddingVertical: 4,\n\t},\n\n\t// Image styles\n\tinlineImage: {\n\t\twidth: \"100%\",\n\t\theight: 200,\n\t\tborderRadius: 8,\n\t\tmarginVertical: 8,\n\t},\n\timageCaption: {\n\t\tfontFamily: \"sf-italic\",\n\t\tfontSize: 14,\n\t\tfontStyle: \"italic\",\n\t\tcolor: TEXT_MID,\n\t\tmarginTop: 4,\n\t\ttextAlign: \"center\",\n\t},\n\n\t// CTA styles\n\tctaContainer: {\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tpaddingVertical: 8,\n\t},\n\n\t// Section title styles\n\tsectionTitle: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 14,\n\t\tfontWeight: \"700\",\n\t\tcolor: TEXT_DARK,\n\t\tmarginBottom: SPACING.SM,\n\t},\n\n\t// Icon styles\n\tfieldIcon: {\n\t\tmarginRight: 8,\n\t},\n\n\t// Legacy styles (kept for compatibility)\n\tsection: {\n\t\tpaddingVertical: 16,\n\t},\n\tdivider: {\n\t\theight: 1,\n\t\tbackgroundColor: LINEGREY,\n\t\tmarginVertical: 8,\n\t\tmarginHorizontal: 16,\n\t},\n\tfacilityDetailTitle: {\n\t\tfontFamily: \"sf-bold\",\n\t\tcolor: TEXT_DARK,\n\t\tfontSize: 14,\n\t},\n\tfacilityDetailContent: {\n\t\tfontFamily: \"sf-regular\",\n\t\tcolor: TEXT_DARK,\n\t\tfontSize: 16,\n\t\tlineHeight: 22,\n\t},\n\tfacilityDetailsContainer: {\n\t\tflex: 1,\n\t},\n\tfacilityDetailsTextContainer: {\n\t\tflex: 1,\n\t\tjustifyContent: \"center\",\n\t},\n\tfacilityDetailContainer: {\n\t\tmarginTop: 16,\n\t\tflexDirection: \"row\",\n\t},\n\tfacilityDetailTitleContainer: {\n\t\twidth: 100,\n\t\tmarginRight: 10,\n\t},\n\ttitleContainer: {\n\t\tpaddingVertical: 16,\n\t\tpaddingTop: 20,\n\t},\n\teventTitle: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 24,\n\t\tlineHeight: 32,\n\t\tcolor: TEXT_DARK,\n\t\tbackgroundColor: \"transparent\",\n\t\tflex: 1,\n\t},\n\ttextLink: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\tlineHeight: 22,\n\t},\n\tgrayPlaceholder: {\n\t\tbackgroundColor: LINEGREY,\n\t},\n\tcenterContainer: {\n\t\tflex: 1,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t\tpaddingHorizontal: 20,\n\t},\n\terrorText: {\n\t\tfontSize: 16,\n\t\tcolor: TEXT_MID,\n\t\ttextAlign: \"center\",\n\t},\n\tfilesContainer: {\n\t\tmarginVertical: 8,\n\t},\n});\n\nconst mapStateToProps = (state, ownProps) => {\n\treturn {\n\t\tcolourBrandingMain: Colours.getMainBrandingColourFromState(state),\n\t\tcolourBrandingHeader: Colours.getMainBrandingColourFromState(state),\n\t\tfeatureDefinition: selectFeatureDefinition(state),\n\t\tuser: state.user,\n\t};\n};\n\nexport default connect(mapStateToProps, null, null, { forwardRef: true })(\n\tFeatureDetailScreen,\n);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,OAAO,QAAQ,eAAe;AACvC,SACCC,QAAQ,EACRC,IAAI,EACJC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,IAAI,EACJC,gBAAgB,EAChBC,OAAO,EACPC,UAAU,EACVC,oBAAoB,EACpBC,KAAK,QACC,cAAc;AACrB,SAASC,IAAI,QAAQ,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;IACvBC,QAAQ,EAAE,EAAE;IACZQ,UAAU,EAAE;EACb,CAAC;EACDnC,eAAe,EAAE;IAChBZ,eAAe,EAAEnK;EAClB,CAAC;EACD8J,eAAe,EAAE;IAChBI,IAAI,EAAE,CAAC;IACPsD,cAAc,EAAE,QAAQ;IACxBJ,UAAU,EAAE,QAAQ;IACpB7B,iBAAiB,EAAE;EACpB,CAAC;EACDxB,SAAS,EAAE;IACV2C,QAAQ,EAAE,EAAE;IACZnG,KAAK,EAAExG,QAAQ;IACf+M,SAAS,EAAE;EACZ,CAAC;EACD1F,cAAc,EAAE;IACfkB,cAAc,EAAE;EACjB;AACD,CAAC,CAAC;AAEF,MAAM8F,eAAe,GAAGA,CAAC9K,KAAK,EAAE+K,QAAQ,KAAK;EAC5C,OAAO;IACNxI,kBAAkB,EAAEjG,OAAO,CAAC0O,8BAA8B,CAAChL,KAAK,CAAC;IACjEiL,oBAAoB,EAAE3O,OAAO,CAAC0O,8BAA8B,CAAChL,KAAK,CAAC;IACnE5B,iBAAiB,EAAEvB,uBAAuB,CAACmD,KAAK,CAAC;IACjDkL,IAAI,EAAElL,KAAK,CAACkL;EACb,CAAC;AACF,CAAC;AAED,eAAejP,OAAO,CAAC6O,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE;EAAEK,UAAU,EAAE;AAAK,CAAC,CAAC,CACxEtN,mBACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text, TouchableOpacity, View, StyleSheet, Image } from "react-native";
|
|
3
|
+
import { Icon } from "react-native-elements";
|
|
4
|
+
import _ from "lodash";
|
|
5
|
+
import { Helper, Colours } from "../core.config";
|
|
6
|
+
import { values } from "../values.config";
|
|
7
|
+
import FieldRenderer from "./FieldRenderer";
|
|
8
|
+
const FeatureListItem = ({
|
|
9
|
+
listing,
|
|
10
|
+
onItemPress,
|
|
11
|
+
colourBrandingMain,
|
|
12
|
+
style,
|
|
13
|
+
featureDefinition
|
|
14
|
+
}) => {
|
|
15
|
+
var _listing$fields, _listing$fields2, _listing$fields3;
|
|
16
|
+
const getImageSource = imageField => {
|
|
17
|
+
if (!imageField) return null;
|
|
18
|
+
if (typeof imageField === "string") {
|
|
19
|
+
return {
|
|
20
|
+
uri: imageField
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (typeof imageField === "object" && imageField.uri) {
|
|
24
|
+
return imageField;
|
|
25
|
+
}
|
|
26
|
+
if (typeof imageField === "object" && imageField.url) {
|
|
27
|
+
return {
|
|
28
|
+
uri: imageField.url
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
const onPress = () => {
|
|
34
|
+
if (onItemPress) {
|
|
35
|
+
onItemPress(listing);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Get data from feature builder fields
|
|
40
|
+
const title = ((_listing$fields = listing.fields) === null || _listing$fields === void 0 ? void 0 : _listing$fields[values.mandatoryFields.title]) || values.labels.defaultTitle;
|
|
41
|
+
const description = ((_listing$fields2 = listing.fields) === null || _listing$fields2 === void 0 ? void 0 : _listing$fields2.description) || "";
|
|
42
|
+
const imageField = (_listing$fields3 = listing.fields) === null || _listing$fields3 === void 0 ? void 0 : _listing$fields3[values.mandatoryFields.featureImage];
|
|
43
|
+
const imageSource = getImageSource(imageField);
|
|
44
|
+
|
|
45
|
+
// Get field definitions for type-aware rendering
|
|
46
|
+
const fieldDefinitions = (featureDefinition === null || featureDefinition === void 0 ? void 0 : featureDefinition.fields) || [];
|
|
47
|
+
|
|
48
|
+
// Use featureDefinitionId to determine the feature type, fallback to featureName
|
|
49
|
+
const getFeatureType = () => {
|
|
50
|
+
if (listing.featureDefinitionId) {
|
|
51
|
+
// Convert kebab-case to title case for display
|
|
52
|
+
return listing.featureDefinitionId.split("-").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
53
|
+
}
|
|
54
|
+
return values.featureName || "Feature";
|
|
55
|
+
};
|
|
56
|
+
const featureType = getFeatureType();
|
|
57
|
+
|
|
58
|
+
// Render field content based on field definitions
|
|
59
|
+
const renderFieldContent = () => {
|
|
60
|
+
// Get non-mandatory fields to render
|
|
61
|
+
const nonMandatoryFields = fieldDefinitions.filter(fieldDef => fieldDef.id !== values.mandatoryFields.title && fieldDef.id !== values.mandatoryFields.featureImage);
|
|
62
|
+
if (nonMandatoryFields.length === 0) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return nonMandatoryFields.map(fieldDef => {
|
|
66
|
+
const fieldValue = listing.fields[fieldDef.id];
|
|
67
|
+
if (!fieldValue) return null;
|
|
68
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
key: fieldDef.id,
|
|
70
|
+
style: styles.fieldContainer
|
|
71
|
+
}, /*#__PURE__*/React.createElement(FieldRenderer, {
|
|
72
|
+
fieldId: fieldDef.id,
|
|
73
|
+
fieldValue: fieldValue,
|
|
74
|
+
fieldDefinition: fieldDef,
|
|
75
|
+
color: colourBrandingMain
|
|
76
|
+
}));
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
80
|
+
onPress: onPress
|
|
81
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
82
|
+
style: [styles.container, style]
|
|
83
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
84
|
+
style: styles.innerContainer
|
|
85
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
style: styles.textContainer
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
88
|
+
style: styles.titleText
|
|
89
|
+
}, title), !_.isEmpty(description) && /*#__PURE__*/React.createElement(Text, {
|
|
90
|
+
numberOfLines: 3,
|
|
91
|
+
style: styles.descriptionText
|
|
92
|
+
}, description), renderFieldContent())), /*#__PURE__*/React.createElement(View, {
|
|
93
|
+
style: styles.imageContainer
|
|
94
|
+
}, imageSource ? /*#__PURE__*/React.createElement(Image, {
|
|
95
|
+
source: imageSource,
|
|
96
|
+
style: styles.image,
|
|
97
|
+
resizeMode: "cover"
|
|
98
|
+
}) : /*#__PURE__*/React.createElement(View, {
|
|
99
|
+
style: [styles.image, styles.placeholderImage]
|
|
100
|
+
}))));
|
|
101
|
+
};
|
|
102
|
+
const styles = StyleSheet.create({
|
|
103
|
+
container: {
|
|
104
|
+
marginVertical: 8,
|
|
105
|
+
paddingHorizontal: 16
|
|
106
|
+
},
|
|
107
|
+
innerContainer: {
|
|
108
|
+
height: values.dimensions.cardHeight,
|
|
109
|
+
marginLeft: 50,
|
|
110
|
+
...Helper.getShadowStyle(),
|
|
111
|
+
shadowOpacity: 0.25,
|
|
112
|
+
shadowRadius: 12,
|
|
113
|
+
elevation: 10
|
|
114
|
+
},
|
|
115
|
+
textContainer: {
|
|
116
|
+
flex: 1,
|
|
117
|
+
marginLeft: 60,
|
|
118
|
+
marginVertical: 15,
|
|
119
|
+
paddingRight: 15,
|
|
120
|
+
justifyContent: "space-between"
|
|
121
|
+
},
|
|
122
|
+
titleText: {
|
|
123
|
+
fontFamily: "sf-semibold",
|
|
124
|
+
fontSize: 16,
|
|
125
|
+
color: Colours.TEXT_DARK
|
|
126
|
+
},
|
|
127
|
+
descriptionText: {
|
|
128
|
+
fontFamily: "sf-regular",
|
|
129
|
+
fontSize: 12,
|
|
130
|
+
color: Colours.TEXT_LIGHT,
|
|
131
|
+
minHeight: 30
|
|
132
|
+
},
|
|
133
|
+
typeContainer: {
|
|
134
|
+
flexDirection: "row",
|
|
135
|
+
alignItems: "center"
|
|
136
|
+
},
|
|
137
|
+
typeIcon: {
|
|
138
|
+
fontSize: 16,
|
|
139
|
+
color: Colours.TEXT_DARK,
|
|
140
|
+
marginRight: 6
|
|
141
|
+
},
|
|
142
|
+
typeText: {
|
|
143
|
+
fontFamily: "sf-semibold",
|
|
144
|
+
fontSize: 12,
|
|
145
|
+
color: "#007AFF" // TODO: Add colour main here
|
|
146
|
+
},
|
|
147
|
+
imageContainer: {
|
|
148
|
+
position: "absolute",
|
|
149
|
+
top: 0,
|
|
150
|
+
left: 16,
|
|
151
|
+
bottom: 0,
|
|
152
|
+
justifyContent: "center",
|
|
153
|
+
elevation: 8
|
|
154
|
+
},
|
|
155
|
+
image: {
|
|
156
|
+
width: values.dimensions.imageSize,
|
|
157
|
+
height: values.dimensions.imageSize,
|
|
158
|
+
resizeMode: "cover",
|
|
159
|
+
borderRadius: values.dimensions.imageBorderRadius
|
|
160
|
+
},
|
|
161
|
+
placeholderImage: {
|
|
162
|
+
backgroundColor: "#808080",
|
|
163
|
+
justifyContent: "center",
|
|
164
|
+
alignItems: "center"
|
|
165
|
+
},
|
|
166
|
+
placeholderText: {
|
|
167
|
+
fontSize: 24
|
|
168
|
+
},
|
|
169
|
+
fieldContainer: {
|
|
170
|
+
marginTop: 8
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
export default FeatureListItem;
|
|
174
|
+
//# sourceMappingURL=FeatureListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","TouchableOpacity","View","StyleSheet","Image","Icon","_","Helper","Colours","values","FieldRenderer","FeatureListItem","listing","onItemPress","colourBrandingMain","style","featureDefinition","_listing$fields","_listing$fields2","_listing$fields3","getImageSource","imageField","uri","url","onPress","title","fields","mandatoryFields","labels","defaultTitle","description","featureImage","imageSource","fieldDefinitions","getFeatureType","featureDefinitionId","split","map","word","charAt","toUpperCase","slice","join","featureName","featureType","renderFieldContent","nonMandatoryFields","filter","fieldDef","id","length","fieldValue","createElement","key","styles","fieldContainer","fieldId","fieldDefinition","color","container","innerContainer","textContainer","titleText","isEmpty","numberOfLines","descriptionText","imageContainer","source","image","resizeMode","placeholderImage","create","marginVertical","paddingHorizontal","height","dimensions","cardHeight","marginLeft","getShadowStyle","shadowOpacity","shadowRadius","elevation","flex","paddingRight","justifyContent","fontFamily","fontSize","TEXT_DARK","TEXT_LIGHT","minHeight","typeContainer","flexDirection","alignItems","typeIcon","marginRight","typeText","position","top","left","bottom","width","imageSize","borderRadius","imageBorderRadius","backgroundColor","placeholderText","marginTop"],"sources":["FeatureListItem.js"],"sourcesContent":["import React from \"react\";\nimport { Text, TouchableOpacity, View, StyleSheet, Image } from \"react-native\";\nimport { Icon } from \"react-native-elements\";\nimport _ from \"lodash\";\nimport { Helper, Colours } from \"../core.config\";\nimport { values } from \"../values.config\";\n\nimport FieldRenderer from \"./FieldRenderer\";\n\nconst FeatureListItem = ({\n\tlisting,\n\tonItemPress,\n\tcolourBrandingMain,\n\tstyle,\n\tfeatureDefinition,\n}) => {\n\tconst getImageSource = (imageField) => {\n\t\tif (!imageField) return null;\n\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 onPress = () => {\n\t\tif (onItemPress) {\n\t\t\tonItemPress(listing);\n\t\t}\n\t};\n\n\t// Get data from feature builder fields\n\tconst title =\n\t\tlisting.fields?.[values.mandatoryFields.title] ||\n\t\tvalues.labels.defaultTitle;\n\tconst description = listing.fields?.description || \"\";\n\tconst imageField = listing.fields?.[values.mandatoryFields.featureImage];\n\tconst imageSource = getImageSource(imageField);\n\n\t// Get field definitions for type-aware rendering\n\tconst fieldDefinitions = featureDefinition?.fields || [];\n\n\t// Use featureDefinitionId to determine the feature type, fallback to featureName\n\tconst getFeatureType = () => {\n\t\tif (listing.featureDefinitionId) {\n\t\t\t// Convert kebab-case to title case for display\n\t\t\treturn listing.featureDefinitionId\n\t\t\t\t.split(\"-\")\n\t\t\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t\t\t.join(\" \");\n\t\t}\n\t\treturn values.featureName || \"Feature\";\n\t};\n\n\tconst featureType = getFeatureType();\n\n\t// Render field content based on field definitions\n\tconst renderFieldContent = () => {\n\t\t// Get non-mandatory fields to render\n\t\tconst nonMandatoryFields = fieldDefinitions.filter(\n\t\t\t(fieldDef) =>\n\t\t\t\tfieldDef.id !== values.mandatoryFields.title &&\n\t\t\t\tfieldDef.id !== values.mandatoryFields.featureImage,\n\t\t);\n\n\t\tif (nonMandatoryFields.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn nonMandatoryFields.map((fieldDef) => {\n\t\t\tconst fieldValue = listing.fields[fieldDef.id];\n\t\t\tif (!fieldValue) return null;\n\n\t\t\treturn (\n\t\t\t\t<View key={fieldDef.id} style={styles.fieldContainer}>\n\t\t\t\t\t<FieldRenderer\n\t\t\t\t\t\tfieldId={fieldDef.id}\n\t\t\t\t\t\tfieldValue={fieldValue}\n\t\t\t\t\t\tfieldDefinition={fieldDef}\n\t\t\t\t\t\tcolor={colourBrandingMain}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t);\n\t\t});\n\t};\n\n\treturn (\n\t\t<TouchableOpacity onPress={onPress}>\n\t\t\t<View style={[styles.container, style]}>\n\t\t\t\t<View style={styles.innerContainer}>\n\t\t\t\t\t<View style={styles.textContainer}>\n\t\t\t\t\t\t<Text style={styles.titleText}>{title}</Text>\n\t\t\t\t\t\t{!_.isEmpty(description) && (\n\t\t\t\t\t\t\t<Text numberOfLines={3} style={styles.descriptionText}>\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{renderFieldContent()}\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t\t<View style={styles.imageContainer}>\n\t\t\t\t\t{imageSource ? (\n\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\tsource={imageSource}\n\t\t\t\t\t\t\tstyle={styles.image}\n\t\t\t\t\t\t\tresizeMode=\"cover\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<View style={[styles.image, styles.placeholderImage]}></View>\n\t\t\t\t\t)}\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n};\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tmarginVertical: 8,\n\t\tpaddingHorizontal: 16,\n\t},\n\tinnerContainer: {\n\t\theight: values.dimensions.cardHeight,\n\t\tmarginLeft: 50,\n\t\t...Helper.getShadowStyle(),\n\t\tshadowOpacity: 0.25,\n\t\tshadowRadius: 12,\n\t\televation: 10,\n\t},\n\ttextContainer: {\n\t\tflex: 1,\n\t\tmarginLeft: 60,\n\t\tmarginVertical: 15,\n\t\tpaddingRight: 15,\n\t\tjustifyContent: \"space-between\",\n\t},\n\ttitleText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 16,\n\t\tcolor: Colours.TEXT_DARK,\n\t},\n\tdescriptionText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 12,\n\t\tcolor: Colours.TEXT_LIGHT,\n\t\tminHeight: 30,\n\t},\n\ttypeContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t},\n\ttypeIcon: {\n\t\tfontSize: 16,\n\t\tcolor: Colours.TEXT_DARK,\n\t\tmarginRight: 6,\n\t},\n\ttypeText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 12,\n\t\tcolor: \"#007AFF\", // TODO: Add colour main here\n\t},\n\timageContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tleft: 16,\n\t\tbottom: 0,\n\t\tjustifyContent: \"center\",\n\t\televation: 8,\n\t},\n\timage: {\n\t\twidth: values.dimensions.imageSize,\n\t\theight: values.dimensions.imageSize,\n\t\tresizeMode: \"cover\",\n\t\tborderRadius: values.dimensions.imageBorderRadius,\n\t},\n\tplaceholderImage: {\n\t\tbackgroundColor: \"#808080\",\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n\tplaceholderText: {\n\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,EAAE;IACZ5B,KAAK,EAAElD,OAAO,CAAC+E,SAAS;IACxBO,WAAW,EAAE;EACd,CAAC;EACDC,QAAQ,EAAE;IACTV,UAAU,EAAE,aAAa;IACzBC,QAAQ,EAAE,EAAE;IACZ5B,KAAK,EAAE,SAAS,CAAE;EACnB,CAAC;EACDQ,cAAc,EAAE;IACf8B,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,EAAE;IACRC,MAAM,EAAE,CAAC;IACTf,cAAc,EAAE,QAAQ;IACxBH,SAAS,EAAE;EACZ,CAAC;EACDb,KAAK,EAAE;IACNgC,KAAK,EAAE3F,MAAM,CAACkE,UAAU,CAAC0B,SAAS;IAClC3B,MAAM,EAAEjE,MAAM,CAACkE,UAAU,CAAC0B,SAAS;IACnChC,UAAU,EAAE,OAAO;IACnBiC,YAAY,EAAE7F,MAAM,CAACkE,UAAU,CAAC4B;EACjC,CAAC;EACDjC,gBAAgB,EAAE;IACjBkC,eAAe,EAAE,SAAS;IAC1BpB,cAAc,EAAE,QAAQ;IACxBQ,UAAU,EAAE;EACb,CAAC;EACDa,eAAe,EAAE;IAChBnB,QAAQ,EAAE;EACX,CAAC;EACD/B,cAAc,EAAE;IACfmD,SAAS,EAAE;EACZ;AACD,CAAC,CAAC;AAEF,eAAe/F,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
6
|
+
import { connect } from "react-redux";
|
|
7
|
+
import { Components, Colours } from "../core.config";
|
|
8
|
+
import { values } from "../values.config";
|
|
9
|
+
import { loadTargetFeature } from "../actions/featureBuilderActions";
|
|
10
|
+
|
|
11
|
+
// Helper function to title case a string
|
|
12
|
+
const toTitleCase = str => {
|
|
13
|
+
if (!str) return str;
|
|
14
|
+
return str.toLowerCase().split(" ").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Layouts
|
|
18
|
+
import RoundImageList from "./layouts/RoundImageList";
|
|
19
|
+
import CondensedList from "./layouts/CondensedList";
|
|
20
|
+
import SquareImageList from "./layouts/SquareImageList";
|
|
21
|
+
import FeatureImageList from "./layouts/FeatureImageList";
|
|
22
|
+
class FeatureListScreen extends Component {
|
|
23
|
+
constructor(...args) {
|
|
24
|
+
super(...args);
|
|
25
|
+
_defineProperty(this, "getLayoutComponent", layoutType => {
|
|
26
|
+
switch (layoutType) {
|
|
27
|
+
case values.layoutTypes.round:
|
|
28
|
+
return RoundImageList;
|
|
29
|
+
case values.layoutTypes.square:
|
|
30
|
+
return SquareImageList;
|
|
31
|
+
case values.layoutTypes.feature:
|
|
32
|
+
return FeatureImageList;
|
|
33
|
+
default:
|
|
34
|
+
return CondensedList;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
componentDidMount() {
|
|
39
|
+
// Trigger the fetch sequence
|
|
40
|
+
this.props.loadTargetFeature();
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
const {
|
|
44
|
+
definition,
|
|
45
|
+
listings,
|
|
46
|
+
loading,
|
|
47
|
+
error,
|
|
48
|
+
navigation,
|
|
49
|
+
mainColor
|
|
50
|
+
} = this.props;
|
|
51
|
+
|
|
52
|
+
// 1. Error
|
|
53
|
+
if (error) {
|
|
54
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
55
|
+
style: styles.container
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Components.Header, {
|
|
57
|
+
text: "Error",
|
|
58
|
+
leftIcon: "angle-left",
|
|
59
|
+
onPressLeft: () => navigation.goBack()
|
|
60
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
61
|
+
style: styles.center
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
63
|
+
style: styles.errorText
|
|
64
|
+
}, error), /*#__PURE__*/React.createElement(Components.InlineButton, {
|
|
65
|
+
onPress: this.props.loadTargetFeature
|
|
66
|
+
}, "Retry")));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 2. Loading state with header
|
|
70
|
+
if (loading && !definition) {
|
|
71
|
+
const title = toTitleCase(values.featureName);
|
|
72
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
73
|
+
style: styles.container
|
|
74
|
+
}, /*#__PURE__*/React.createElement(Components.Header, {
|
|
75
|
+
text: title,
|
|
76
|
+
leftIcon: "angle-left",
|
|
77
|
+
onPressLeft: () => navigation.goBack()
|
|
78
|
+
}), /*#__PURE__*/React.createElement(Components.LoadingIndicator, {
|
|
79
|
+
visible: true
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 3. Render List
|
|
84
|
+
if (definition) {
|
|
85
|
+
var _definition$layout;
|
|
86
|
+
// Since we flattened the data, definition.layout is now available directly
|
|
87
|
+
const layoutType = ((_definition$layout = definition.layout) === null || _definition$layout === void 0 ? void 0 : _definition$layout.type) || "condensed";
|
|
88
|
+
const LayoutComponent = this.getLayoutComponent(layoutType);
|
|
89
|
+
const title = toTitleCase(definition.title || values.featureName);
|
|
90
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
91
|
+
style: styles.container
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Components.Header, {
|
|
93
|
+
text: title,
|
|
94
|
+
leftIcon: "angle-left",
|
|
95
|
+
onPressLeft: () => navigation.goBack()
|
|
96
|
+
}), /*#__PURE__*/React.createElement(LayoutComponent, {
|
|
97
|
+
listings: listings,
|
|
98
|
+
featureDefinition: definition,
|
|
99
|
+
colourBrandingMain: mainColor,
|
|
100
|
+
title: title,
|
|
101
|
+
onItemPress: item => {
|
|
102
|
+
navigation.navigate(values.screens.featureDetail, {
|
|
103
|
+
listing: item,
|
|
104
|
+
featureDefinition: definition,
|
|
105
|
+
featureTitle: title
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
refreshing: loading,
|
|
109
|
+
onRefresh: this.props.loadTargetFeature
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// 4. Default empty state - should not reach here if logic is correct
|
|
114
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
115
|
+
style: styles.container
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Components.Header, {
|
|
117
|
+
text: toTitleCase(values.featureName),
|
|
118
|
+
leftIcon: "angle-left",
|
|
119
|
+
onPressLeft: () => navigation.goBack()
|
|
120
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
121
|
+
style: styles.center
|
|
122
|
+
}, /*#__PURE__*/React.createElement(Components.EmptyStateWidget, {
|
|
123
|
+
title: "Feature not available",
|
|
124
|
+
height: 120
|
|
125
|
+
})));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const styles = StyleSheet.create({
|
|
129
|
+
container: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
backgroundColor: "#fff"
|
|
132
|
+
},
|
|
133
|
+
center: {
|
|
134
|
+
flex: 1,
|
|
135
|
+
justifyContent: "center",
|
|
136
|
+
alignItems: "center",
|
|
137
|
+
padding: 20
|
|
138
|
+
},
|
|
139
|
+
errorText: {
|
|
140
|
+
marginBottom: 10,
|
|
141
|
+
fontSize: 16,
|
|
142
|
+
color: "#666",
|
|
143
|
+
textAlign: "center"
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
const mapStateToProps = state => {
|
|
147
|
+
var _state$values$reducer, _state$values$reducer2, _state$values$reducer3, _state$values$reducer4;
|
|
148
|
+
return {
|
|
149
|
+
definition: (_state$values$reducer = state[values.reducerKey]) === null || _state$values$reducer === void 0 ? void 0 : _state$values$reducer.feature,
|
|
150
|
+
listings: (_state$values$reducer2 = state[values.reducerKey]) === null || _state$values$reducer2 === void 0 ? void 0 : _state$values$reducer2.listings,
|
|
151
|
+
loading: (_state$values$reducer3 = state[values.reducerKey]) === null || _state$values$reducer3 === void 0 ? void 0 : _state$values$reducer3.loading,
|
|
152
|
+
error: (_state$values$reducer4 = state[values.reducerKey]) === null || _state$values$reducer4 === void 0 ? void 0 : _state$values$reducer4.error,
|
|
153
|
+
mainColor: Colours.getMainBrandingColourFromState(state)
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export default connect(mapStateToProps, {
|
|
157
|
+
loadTargetFeature
|
|
158
|
+
})(FeatureListScreen);
|
|
159
|
+
//# sourceMappingURL=FeatureListScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","StyleSheet","connect","Components","Colours","values","loadTargetFeature","toTitleCase","str","toLowerCase","split","map","word","charAt","toUpperCase","slice","join","RoundImageList","CondensedList","SquareImageList","FeatureImageList","FeatureListScreen","constructor","args","_defineProperty","layoutType","layoutTypes","round","square","feature","componentDidMount","props","render","definition","listings","loading","error","navigation","mainColor","createElement","style","styles","container","Header","text","leftIcon","onPressLeft","goBack","center","errorText","InlineButton","onPress","title","featureName","LoadingIndicator","visible","_definition$layout","layout","type","LayoutComponent","getLayoutComponent","featureDefinition","colourBrandingMain","onItemPress","item","navigate","screens","featureDetail","listing","featureTitle","refreshing","onRefresh","EmptyStateWidget","height","create","flex","backgroundColor","justifyContent","alignItems","padding","marginBottom","fontSize","color","textAlign","mapStateToProps","state","_state$values$reducer","_state$values$reducer2","_state$values$reducer3","_state$values$reducer4","reducerKey","getMainBrandingColourFromState"],"sources":["FeatureListScreen.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, Text, StyleSheet } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport { Components, Colours } from \"../core.config\";\nimport { values } from \"../values.config\";\nimport { loadTargetFeature } from \"../actions/featureBuilderActions\";\n\n// Helper function to title case a string\nconst toTitleCase = (str) => {\n\tif (!str) return str;\n\treturn str\n\t\t.toLowerCase()\n\t\t.split(\" \")\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(\" \");\n};\n\n// Layouts\nimport RoundImageList from \"./layouts/RoundImageList\";\nimport CondensedList from \"./layouts/CondensedList\";\nimport SquareImageList from \"./layouts/SquareImageList\";\nimport FeatureImageList from \"./layouts/FeatureImageList\";\n\nclass FeatureListScreen extends Component {\n\tcomponentDidMount() {\n\t\t// Trigger the fetch sequence\n\t\tthis.props.loadTargetFeature();\n\t}\n\n\tgetLayoutComponent = (layoutType) => {\n\t\tswitch (layoutType) {\n\t\t\tcase values.layoutTypes.round:\n\t\t\t\treturn RoundImageList;\n\t\t\tcase values.layoutTypes.square:\n\t\t\t\treturn SquareImageList;\n\t\t\tcase values.layoutTypes.feature:\n\t\t\t\treturn FeatureImageList;\n\t\t\tdefault:\n\t\t\t\treturn CondensedList;\n\t\t}\n\t};\n\n\trender() {\n\t\tconst { definition, listings, loading, error, navigation, mainColor } =\n\t\t\tthis.props;\n\n\t\t// 1. Error\n\t\tif (error) {\n\t\t\treturn (\n\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t<Components.Header\n\t\t\t\t\t\ttext=\"Error\"\n\t\t\t\t\t\tleftIcon=\"angle-left\"\n\t\t\t\t\t\tonPressLeft={() => navigation.goBack()}\n\t\t\t\t\t/>\n\t\t\t\t\t<View style={styles.center}>\n\t\t\t\t\t\t<Text style={styles.errorText}>{error}</Text>\n\t\t\t\t\t\t<Components.InlineButton onPress={this.props.loadTargetFeature}>\n\t\t\t\t\t\t\tRetry\n\t\t\t\t\t\t</Components.InlineButton>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\t// 2. Loading state with header\n\t\tif (loading && !definition) {\n\t\t\tconst title = toTitleCase(values.featureName);\n\t\t\treturn (\n\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t<Components.Header\n\t\t\t\t\t\ttext={title}\n\t\t\t\t\t\tleftIcon=\"angle-left\"\n\t\t\t\t\t\tonPressLeft={() => navigation.goBack()}\n\t\t\t\t\t/>\n\t\t\t\t\t<Components.LoadingIndicator visible={true} />\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\t// 3. Render List\n\t\tif (definition) {\n\t\t\t// Since we flattened the data, definition.layout is now available directly\n\t\t\tconst layoutType = definition.layout?.type || \"condensed\";\n\t\t\tconst LayoutComponent = this.getLayoutComponent(layoutType);\n\t\t\tconst title = toTitleCase(definition.title || values.featureName);\n\n\t\t\treturn (\n\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t<Components.Header\n\t\t\t\t\t\ttext={title}\n\t\t\t\t\t\tleftIcon=\"angle-left\"\n\t\t\t\t\t\tonPressLeft={() => navigation.goBack()}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<LayoutComponent\n\t\t\t\t\t\tlistings={listings}\n\t\t\t\t\t\tfeatureDefinition={definition}\n\t\t\t\t\t\tcolourBrandingMain={mainColor}\n\t\t\t\t\t\ttitle={title}\n\t\t\t\t\t\tonItemPress={(item) => {\n\t\t\t\t\t\t\tnavigation.navigate(values.screens.featureDetail, {\n\t\t\t\t\t\t\t\tlisting: item,\n\t\t\t\t\t\t\t\tfeatureDefinition: definition,\n\t\t\t\t\t\t\t\tfeatureTitle: title,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t\trefreshing={loading}\n\t\t\t\t\t\tonRefresh={this.props.loadTargetFeature}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\t// 4. Default empty state - should not reach here if logic is correct\n\t\treturn (\n\t\t\t<View style={styles.container}>\n\t\t\t\t<Components.Header\n\t\t\t\t\ttext={toTitleCase(values.featureName)}\n\t\t\t\t\tleftIcon=\"angle-left\"\n\t\t\t\t\tonPressLeft={() => navigation.goBack()}\n\t\t\t\t/>\n\t\t\t\t<View style={styles.center}>\n\t\t\t\t\t<Components.EmptyStateWidget\n\t\t\t\t\t\ttitle=\"Feature not available\"\n\t\t\t\t\t\theight={120}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: { flex: 1, backgroundColor: \"#fff\" },\n\tcenter: {\n\t\tflex: 1,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t\tpadding: 20,\n\t},\n\terrorText: {\n\t\tmarginBottom: 10,\n\t\tfontSize: 16,\n\t\tcolor: \"#666\",\n\t\ttextAlign: \"center\",\n\t},\n});\n\nconst mapStateToProps = (state) => ({\n\tdefinition: state[values.reducerKey]?.feature,\n\tlistings: state[values.reducerKey]?.listings,\n\tloading: state[values.reducerKey]?.loading,\n\terror: state[values.reducerKey]?.error,\n\tmainColor: Colours.getMainBrandingColourFromState(state),\n});\n\nexport default connect(mapStateToProps, { loadTargetFeature })(\n\tFeatureListScreen,\n);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,UAAU,EAAEC,OAAO,QAAQ,gBAAgB;AACpD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,iBAAiB,QAAQ,kCAAkC;;AAEpE;AACA,MAAMC,WAAW,GAAIC,GAAG,IAAK;EAC5B,IAAI,CAACA,GAAG,EAAE,OAAOA,GAAG;EACpB,OAAOA,GAAG,CACRC,WAAW,CAAC,CAAC,CACbC,KAAK,CAAC,GAAG,CAAC,CACVC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