@plusscommunities/pluss-core-app 8.0.0 → 8.0.1-auth.0
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/FollowerActions.js +4 -4
- package/dist/module/actions/FollowerActions.js.map +1 -1
- package/dist/module/actions/MediaActions.js +1 -1
- package/dist/module/actions/MediaActions.js.map +1 -1
- package/dist/module/actions/ResidentActions.js +1 -1
- package/dist/module/actions/ResidentActions.js.map +1 -1
- package/dist/module/actions/UserActions.js +1 -1
- package/dist/module/actions/UserActions.js.map +1 -1
- package/dist/module/actions/UserSettingsActions.js +1 -1
- package/dist/module/actions/UserSettingsActions.js.map +1 -1
- package/dist/module/actions/index.js +5 -5
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +16 -16
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/analyticsActions.js +5 -5
- package/dist/module/apis/analyticsActions.js.map +1 -1
- package/dist/module/apis/contactActions.js +6 -6
- package/dist/module/apis/contactActions.js.map +1 -1
- package/dist/module/apis/eventActions.js +28 -28
- package/dist/module/apis/eventActions.js.map +1 -1
- package/dist/module/apis/fileActions.js +15 -15
- package/dist/module/apis/fileActions.js.map +1 -1
- package/dist/module/apis/followerActions.js +8 -8
- package/dist/module/apis/followerActions.js.map +1 -1
- package/dist/module/apis/index.js +12 -12
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/notificationActions.js +17 -17
- package/dist/module/apis/notificationActions.js.map +1 -1
- package/dist/module/apis/profileActions.js +4 -4
- package/dist/module/apis/profileActions.js.map +1 -1
- package/dist/module/apis/reactionActions.js +15 -15
- package/dist/module/apis/reactionActions.js.map +1 -1
- package/dist/module/apis/settingActions.js +6 -6
- package/dist/module/apis/settingActions.js.map +1 -1
- package/dist/module/apis/stringActions.js +8 -8
- package/dist/module/apis/stringActions.js.map +1 -1
- package/dist/module/apis/typeActions.js +4 -4
- package/dist/module/apis/typeActions.js.map +1 -1
- package/dist/module/apis/userActions.js +8 -8
- package/dist/module/apis/userActions.js.map +1 -1
- package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/dist/module/colours.js +26 -29
- package/dist/module/colours.js.map +1 -1
- package/dist/module/components/AddButton.js +8 -8
- package/dist/module/components/AddButton.js.map +1 -1
- package/dist/module/components/AddToCalendarButton.js +30 -29
- package/dist/module/components/AddToCalendarButton.js.map +1 -1
- package/dist/module/components/Attachment.js +10 -9
- package/dist/module/components/Attachment.js.map +1 -1
- package/dist/module/components/AudienceSelectorLauncher.js +11 -11
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
- package/dist/module/components/AudienceSelectorPage.js +45 -44
- package/dist/module/components/AudienceSelectorPage.js.map +1 -1
- package/dist/module/components/AutoOffsetImage.js +13 -13
- package/dist/module/components/AutoOffsetImage.js.map +1 -1
- package/dist/module/components/BackButton.js +10 -10
- package/dist/module/components/BackButton.js.map +1 -1
- package/dist/module/components/CalendarPopup.js +21 -21
- package/dist/module/components/CalendarPopup.js.map +1 -1
- package/dist/module/components/CategoryTabs.js +30 -29
- package/dist/module/components/CategoryTabs.js.map +1 -1
- package/dist/module/components/CommentReply.js +43 -37
- package/dist/module/components/CommentReply.js.map +1 -1
- package/dist/module/components/CommentSection.js +74 -74
- package/dist/module/components/CommentSection.js.map +1 -1
- package/dist/module/components/ConfirmPopup.js +21 -20
- package/dist/module/components/ConfirmPopup.js.map +1 -1
- package/dist/module/components/ConfirmationPopup.js +11 -11
- package/dist/module/components/ConfirmationPopup.js.map +1 -1
- package/dist/module/components/DocumentUploader.js +50 -50
- package/dist/module/components/DocumentUploader.js.map +1 -1
- package/dist/module/components/DropDownItem.js +14 -13
- package/dist/module/components/DropDownItem.js.map +1 -1
- package/dist/module/components/DropDownMenu.js +5 -5
- package/dist/module/components/DropDownMenu.js.map +1 -1
- package/dist/module/components/EmptyStateMain.js +10 -9
- package/dist/module/components/EmptyStateMain.js.map +1 -1
- package/dist/module/components/EmptyStateWidget.js +7 -6
- package/dist/module/components/EmptyStateWidget.js.map +1 -1
- package/dist/module/components/FontScaleButton.js +5 -4
- package/dist/module/components/FontScaleButton.js.map +1 -1
- package/dist/module/components/FontScalePopup.js +11 -10
- package/dist/module/components/FontScalePopup.js.map +1 -1
- package/dist/module/components/Forbidden.js +13 -13
- package/dist/module/components/Forbidden.js.map +1 -1
- package/dist/module/components/FormCard.js +4 -4
- package/dist/module/components/FormCard.js.map +1 -1
- package/dist/module/components/FormCardSection.js +20 -18
- package/dist/module/components/FormCardSection.js.map +1 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js +13 -12
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
- package/dist/module/components/FormattedText.js +18 -16
- package/dist/module/components/FormattedText.js.map +1 -1
- package/dist/module/components/GenericInput.js +24 -21
- package/dist/module/components/GenericInput.js.map +1 -1
- package/dist/module/components/GenericInputSection.js +27 -26
- package/dist/module/components/GenericInputSection.js.map +1 -1
- package/dist/module/components/Header.js +70 -69
- package/dist/module/components/Header.js.map +1 -1
- package/dist/module/components/Icon.js +109 -0
- package/dist/module/components/Icon.js.map +1 -0
- package/dist/module/components/ImagePopup.js +211 -73
- package/dist/module/components/ImagePopup.js.map +1 -1
- package/dist/module/components/ImageUploadProgress.js +10 -9
- package/dist/module/components/ImageUploadProgress.js.map +1 -1
- package/dist/module/components/ImageUploader.js +116 -96
- package/dist/module/components/ImageUploader.js.map +1 -1
- package/dist/module/components/InlineButton.js +9 -8
- package/dist/module/components/InlineButton.js.map +1 -1
- package/dist/module/components/Input.js +28 -26
- package/dist/module/components/Input.js.map +1 -1
- package/dist/module/components/LoadingCircles.js +20 -20
- package/dist/module/components/LoadingCircles.js.map +1 -1
- package/dist/module/components/LoadingIndicator.js +11 -11
- package/dist/module/components/LoadingIndicator.js.map +1 -1
- package/dist/module/components/LoadingStateWidget.js +5 -5
- package/dist/module/components/LoadingStateWidget.js.map +1 -1
- package/dist/module/components/MediaPlayer.js +31 -31
- package/dist/module/components/MediaPlayer.js.map +1 -1
- package/dist/module/components/MiddlePopup.js +17 -11
- package/dist/module/components/MiddlePopup.js.map +1 -1
- package/dist/module/components/PDFPopup.js +52 -39
- package/dist/module/components/PDFPopup.js.map +1 -1
- package/dist/module/components/PlussChat.js +168 -149
- package/dist/module/components/PlussChat.js.map +1 -1
- package/dist/module/components/PlussChatMessage.js +42 -42
- package/dist/module/components/PlussChatMessage.js.map +1 -1
- package/dist/module/components/PlussChatTime.js +18 -17
- package/dist/module/components/PlussChatTime.js.map +1 -1
- package/dist/module/components/Popup.js +20 -19
- package/dist/module/components/Popup.js.map +1 -1
- package/dist/module/components/PopupMenu.js +15 -14
- package/dist/module/components/PopupMenu.js.map +1 -1
- package/dist/module/components/PositionedImage.js +20 -20
- package/dist/module/components/PositionedImage.js.map +1 -1
- package/dist/module/components/ProfilePic.js +10 -10
- package/dist/module/components/ProfilePic.js.map +1 -1
- package/dist/module/components/RadioButton.js +10 -9
- package/dist/module/components/RadioButton.js.map +1 -1
- package/dist/module/components/Reaction.js +18 -17
- package/dist/module/components/Reaction.js.map +1 -1
- package/dist/module/components/Reactions.js +7 -7
- package/dist/module/components/Reactions.js.map +1 -1
- package/dist/module/components/SharingTools.js +78 -43
- package/dist/module/components/SharingTools.js.map +1 -1
- package/dist/module/components/Spinner.js +5 -5
- package/dist/module/components/Spinner.js.map +1 -1
- package/dist/module/components/StickyFooter.js +6 -6
- package/dist/module/components/StickyFooter.js.map +1 -1
- package/dist/module/components/Text.js +57 -0
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TickIcon.js +6 -6
- package/dist/module/components/TickIcon.js.map +1 -1
- package/dist/module/components/Toggle.js +10 -9
- package/dist/module/components/Toggle.js.map +1 -1
- package/dist/module/components/TouchableSearchBar.js +18 -17
- package/dist/module/components/TouchableSearchBar.js.map +1 -1
- package/dist/module/components/UserListPopup.js +20 -19
- package/dist/module/components/UserListPopup.js.map +1 -1
- package/dist/module/components/UserListing.js +41 -40
- package/dist/module/components/UserListing.js.map +1 -1
- package/dist/module/components/VideoPopup.js +20 -20
- package/dist/module/components/VideoPopup.js.map +1 -1
- package/dist/module/components/WarningPopup.js +21 -20
- package/dist/module/components/WarningPopup.js.map +1 -1
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +13 -13
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +24 -23
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
- package/dist/module/components/index.js +59 -58
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +94 -64
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +64 -64
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
- package/dist/module/config.js +15 -10
- package/dist/module/config.js.map +1 -1
- package/dist/module/constants.js +3 -4
- package/dist/module/constants.js.map +1 -1
- package/dist/module/helper.js +83 -82
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js +12 -12
- package/dist/module/index.js.map +1 -1
- package/dist/module/js/images/detectFaces.js +11 -10
- package/dist/module/js/images/detectFaces.js.map +1 -1
- package/dist/module/js/images/findLandmarkRange.js +8 -8
- package/dist/module/js/images/findLandmarkRange.js.map +1 -1
- package/dist/module/js/images/getScaledOffset.js.map +1 -1
- package/dist/module/js/site/getSiteLevelFromState.js +2 -2
- package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
- package/dist/module/js/site/isTVEnabled.js +2 -2
- package/dist/module/js/site/isTVEnabled.js.map +1 -1
- package/dist/module/session.js +6 -6
- package/dist/module/session.js.map +1 -1
- package/dist/module/styles.js +17 -17
- package/dist/module/styles.js.map +1 -1
- package/dist/module/withNavigationFocus.js +30 -0
- package/dist/module/withNavigationFocus.js.map +1 -0
- package/package.json +71 -68
- package/src/actions/FollowerActions.js +36 -32
- package/src/actions/MediaActions.js +25 -20
- package/src/actions/ResidentActions.js +26 -21
- package/src/actions/UserActions.js +22 -22
- package/src/actions/UserSettingsActions.js +11 -11
- package/src/actions/index.js +5 -5
- package/src/actions/types.js +16 -16
- package/src/apis/analyticsActions.js +17 -17
- package/src/apis/contactActions.js +20 -20
- package/src/apis/eventActions.js +153 -144
- package/src/apis/fileActions.js +96 -86
- package/src/apis/followerActions.js +29 -29
- package/src/apis/index.js +12 -12
- package/src/apis/notificationActions.js +44 -44
- package/src/apis/profileActions.js +8 -8
- package/src/apis/reactionActions.js +81 -73
- package/src/apis/settingActions.js +15 -15
- package/src/apis/stringActions.js +29 -25
- package/src/apis/typeActions.js +10 -10
- package/src/apis/userActions.js +93 -93
- package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/src/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/src/colours.js +116 -96
- package/src/components/AddButton.js +32 -27
- package/src/components/AddToCalendarButton.js +236 -202
- package/src/components/Attachment.js +59 -36
- package/src/components/AudienceSelectorLauncher.js +52 -48
- package/src/components/AudienceSelectorPage.js +353 -311
- package/src/components/AutoOffsetImage.js +237 -196
- package/src/components/BackButton.js +57 -41
- package/src/components/CalendarPopup.js +127 -97
- package/src/components/CategoryTabs.js +208 -163
- package/src/components/CommentReply.js +370 -309
- package/src/components/CommentSection.js +974 -781
- package/src/components/ConfirmPopup.js +141 -110
- package/src/components/ConfirmationPopup.js +80 -69
- package/src/components/DocumentUploader.js +245 -215
- package/src/components/DropDownItem.js +70 -60
- package/src/components/DropDownMenu.js +31 -27
- package/src/components/EmptyStateMain.js +51 -44
- package/src/components/EmptyStateWidget.js +47 -38
- package/src/components/FontScaleButton.js +29 -25
- package/src/components/FontScalePopup.js +67 -56
- package/src/components/Forbidden.js +48 -46
- package/src/components/FormCard.js +21 -17
- package/src/components/FormCardSection.js +284 -233
- package/src/components/FormCardSectionOptionLauncher.js +72 -46
- package/src/components/FormattedText.js +128 -111
- package/src/components/GenericInput.js +168 -136
- package/src/components/GenericInputSection.js +209 -161
- package/src/components/Header.js +620 -474
- package/src/components/Icon.js +119 -0
- package/src/components/ImagePopup.js +425 -221
- package/src/components/ImageUploadProgress.js +49 -41
- package/src/components/ImageUploader.js +968 -797
- package/src/components/InlineButton.js +79 -69
- package/src/components/Input.js +190 -156
- package/src/components/LoadingCircles.js +233 -233
- package/src/components/LoadingIndicator.js +87 -76
- package/src/components/LoadingStateWidget.js +47 -37
- package/src/components/MediaPlayer.js +416 -387
- package/src/components/MiddlePopup.js +62 -33
- package/src/components/PDFPopup.js +212 -159
- package/src/components/PlussChat.js +1224 -1025
- package/src/components/PlussChatMessage.js +329 -298
- package/src/components/PlussChatTime.js +57 -53
- package/src/components/Popup.js +138 -116
- package/src/components/PopupMenu.js +140 -110
- package/src/components/PositionedImage.js +281 -237
- package/src/components/ProfilePic.js +122 -113
- package/src/components/RadioButton.js +76 -52
- package/src/components/Reaction.js +134 -96
- package/src/components/Reactions.js +65 -63
- package/src/components/SharingTools.js +185 -134
- package/src/components/Spinner.js +13 -13
- package/src/components/StickyFooter.js +36 -26
- package/src/components/Text.js +62 -0
- package/src/components/TickIcon.js +20 -20
- package/src/components/Toggle.js +74 -73
- package/src/components/TouchableSearchBar.js +68 -50
- package/src/components/UserListPopup.js +161 -124
- package/src/components/UserListing.js +273 -238
- package/src/components/VideoPopup.js +110 -96
- package/src/components/WarningPopup.js +92 -71
- package/src/components/expo-image-picker-multiple/ImageBrowser.js +288 -256
- package/src/components/expo-image-picker-multiple/ImageTile.js +108 -84
- package/src/components/index.js +59 -58
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +444 -359
- package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
- package/src/config.js +26 -21
- package/src/constants.js +8 -10
- package/src/helper.js +469 -438
- package/src/index.js +24 -12
- package/src/js/images/detectFaces.js +28 -21
- package/src/js/images/findLandmarkRange.js +97 -90
- package/src/js/images/getScaledOffset.js +80 -75
- package/src/js/site/getSiteLevelFromState.js +26 -26
- package/src/js/site/isTVEnabled.js +10 -10
- package/src/session.js +32 -32
- package/src/styles.js +61 -61
- package/src/withNavigationFocus.js +28 -0
- package/dist/module/components/TextStyle.js +0 -45
- package/dist/module/components/TextStyle.js.map +0 -1
- package/dist/module/fonts/index.js +0 -2
- package/dist/module/fonts/index.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.js +0 -5
- package/dist/module/fonts/pluss60-icons.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.json +0 -1097
- package/src/components/TextStyle.js +0 -48
- package/src/fonts/index.js +0 -1
- package/src/fonts/pluss60-icons.js +0 -7
- package/src/fonts/pluss60-icons.json +0 -1097
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","Animated","PanResponder","Image","StyleSheet","Icon","BOXGREY","TEXT_LIGHT","PositionedImage","constructor","props","_defineProperty","getSize","source","uri","imageWidth","imageHeight","newWidth","width","newHeight","height","setState","isVertical","showGuide","onPositionEnd","onDimensionAvailable","offset","state","actual","x","y","imagePosition","setValue","setTimeout","timing","animatedOpacity","toValue","duration","useNativeDriver","start","lastPos","ValueXY","addListener","value","imagePanResponder","create","onStartShouldSetPanResponder","startPos","onPositionStart","panning","onPanResponderMove","event","gesture","newPos","dy","dx","onPanResponderTerminationRequest","onPanResponderRelease","endPos","endY","limitY","endX","limitX","spring","onPanResponderTerminate","Value","componentDidMount","calculateDimensions","componentDidUpdate","prevProps","renderGrid","createElement","style","styles","gridContainer","gridHorizontal","gridVertical","renderGuide","guideContainer","opacity","guideIconContainer","flexDirection","name","type","iconStyle","guideIcon","guideIconDisabled","render","container","_extends","getLayout","panHandlers","overflow","backgroundColor","position","top","right","bottom","left","alignItems","justifyContent","color","fontSize","margin","borderBottomWidth","borderBottomColor","borderLeftWidth","borderLeftColor"],"sources":["PositionedImage.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Animated, PanResponder, Image, StyleSheet } from 'react-native';\nimport { Icon } from '@rneui/themed';\nimport { BOXGREY, TEXT_LIGHT } from '../colours';\n\nclass PositionedImage extends Component {\n constructor(props) {\n super(props);\n\n this.lastPos = { x: 0, y: 0 };\n this.imagePosition = new Animated.ValueXY(this.lastPos);\n this.imagePosition.addListener(value => {\n this.lastPos = value;\n });\n const imagePanResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => {\n this.startPos = this.lastPos;\n if (this.props.onPositionEnd) {\n if (this.props.onPositionStart) this.props.onPositionStart();\n this.setState({ panning: true });\n return true;\n }\n return false;\n },\n onPanResponderMove: (event, gesture) => {\n const newPos = this.state.isVertical ? { x: 0, y: this.startPos.y + gesture.dy } : { x: this.startPos.x + gesture.dx, y: 0 };\n this.imagePosition.setValue(newPos);\n },\n onPanResponderTerminationRequest: (event, gesture) => true,\n onPanResponderRelease: (event, gesture) => {\n let endPos = { x: 0, y: 0 };\n if (this.state.isVertical) {\n const endY = this.startPos.y + gesture.dy;\n const limitY = this.props.height - this.state.imageHeight;\n if (endY > 0) {\n // console.log('top reached', endY);\n endPos = { x: 0, y: 0 };\n } else if (endY < limitY) {\n // console.log('bottom reached', endY, limitY);\n endPos = { x: 0, y: limitY };\n } else {\n endPos = { x: 0, y: endY };\n }\n } else {\n const endX = this.startPos.x + gesture.dx;\n const limitX = this.props.width - this.state.imageWidth;\n if (endX > 0) {\n // console.log('left reached', endX);\n endPos = { x: 0, y: 0 };\n } else if (endX < limitX) {\n // console.log('right reached', endX, limitX);\n endPos = { x: limitX, y: 0 };\n } else {\n endPos = { x: endX, y: 0 };\n }\n }\n Animated.spring(this.imagePosition, { toValue: endPos, useNativeDriver: false }).start();\n\n if (this.props.onPositionEnd)\n this.props.onPositionEnd({\n x: endPos.x / this.state.imageWidth,\n y: endPos.y / this.state.imageHeight,\n });\n\n this.setState({ panning: false });\n },\n onPanResponderTerminate: (event, gesture) => {\n this.setState({ panning: false });\n },\n });\n\n this.state = {\n imageWidth: 0,\n imageHeight: 0,\n imagePanResponder,\n isVertical: true,\n showGuide: false,\n animatedOpacity: new Animated.Value(1),\n panning: false,\n };\n }\n\n componentDidMount() {\n this.calculateDimensions();\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.source.uri !== this.props.source.uri) {\n // console.log('componentDidUpdate', prevProps.source.uri, this.props.source.uri);\n this.calculateDimensions();\n }\n }\n\n calculateDimensions = () => {\n Image.getSize(this.props.source.uri, (imageWidth, imageHeight) => {\n // Default vertical positioning\n const newWidth = this.props.width;\n const newHeight = imageHeight * (this.props.width / imageWidth);\n\n if (newHeight < this.props.height) {\n // If vertical positioning isn't possible, enable horizontal positioning\n this.setState(\n {\n imageWidth: imageWidth * (this.props.height / imageHeight),\n imageHeight: this.props.height,\n isVertical: false,\n showGuide: this.props.onPositionEnd ? true : false,\n },\n this.onDimensionAvailable,\n );\n } else {\n this.setState(\n {\n imageWidth: newWidth,\n imageHeight: newHeight,\n isVertical: true,\n showGuide: this.props.onPositionEnd ? true : false,\n },\n this.onDimensionAvailable,\n );\n }\n });\n };\n\n onDimensionAvailable = () => {\n const { offset } = this.props;\n const { imageWidth, imageHeight, isVertical } = this.state;\n\n if (offset) {\n // Apply percentage offset\n const actual = {\n x: offset.x * imageWidth,\n y: offset.y * imageHeight,\n };\n this.imagePosition.setValue(actual);\n } else {\n // Centered by default\n this.imagePosition.setValue({\n x: isVertical ? 0 : -0.5 * imageWidth + 0.5 * this.props.width,\n y: isVertical ? -0.5 * imageHeight + 0.5 * this.props.height : 0,\n });\n }\n\n if (this.props.onPositionEnd) {\n setTimeout(() => {\n Animated.timing(this.state.animatedOpacity, {\n toValue: 0,\n duration: 900,\n useNativeDriver: false,\n }).start(() => {\n this.setState({ showGuide: false });\n });\n }, 1000);\n }\n };\n\n renderGrid() {\n if (!this.state.panning) return null;\n return (\n <View style={styles.gridContainer}>\n <View style={styles.gridHorizontal} />\n <View style={styles.gridVertical} />\n </View>\n );\n }\n\n renderGuide() {\n if (!this.state.showGuide) return null;\n const { animatedOpacity, isVertical } = this.state;\n return (\n <Animated.View style={[styles.guideContainer, { opacity: animatedOpacity }]}>\n <View style={[styles.guideIconContainer, { flexDirection: 'column' }]}>\n <Icon name=\"arrow-up\" type=\"font-awesome\" iconStyle={[styles.guideIcon, !isVertical && styles.guideIconDisabled]} />\n <Icon name=\"arrow-down\" type=\"font-awesome\" iconStyle={[styles.guideIcon, !isVertical && styles.guideIconDisabled]} />\n </View>\n <View style={[styles.guideIconContainer, { flexDirection: 'row' }]}>\n <Icon name=\"arrow-left\" type=\"font-awesome\" iconStyle={[styles.guideIcon, isVertical && styles.guideIconDisabled]} />\n <Icon name=\"arrow-right\" type=\"font-awesome\" iconStyle={[styles.guideIcon, isVertical && styles.guideIconDisabled]} />\n </View>\n </Animated.View>\n );\n }\n\n render() {\n const { imageWidth, imageHeight, imagePanResponder } = this.state;\n\n return (\n <View style={[styles.container, { width: this.props.width, height: this.props.height }, this.props.style]}>\n <Animated.Image\n source={this.props.source}\n style={[{ width: imageWidth, height: imageHeight }, this.imagePosition.getLayout()]}\n {...imagePanResponder.panHandlers}\n />\n {this.renderGrid()}\n {this.renderGuide()}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n backgroundColor: BOXGREY,\n },\n guideContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#0006',\n },\n guideIconContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n alignItems: 'center',\n justifyContent: 'center',\n },\n guideIcon: {\n color: '#fff',\n fontSize: 50,\n margin: 15,\n },\n guideIconDisabled: {\n color: TEXT_LIGHT,\n },\n gridContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n gridHorizontal: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n height: '50%',\n borderBottomWidth: 1,\n borderBottomColor: BOXGREY,\n },\n gridVertical: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n width: '50%',\n borderLeftWidth: 1,\n borderLeftColor: BOXGREY,\n },\n});\n\nexport default PositionedImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,UAAU,QAAQ,cAAc;AAC9E,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,OAAO,EAAEC,UAAU,QAAQ,YAAY;AAEhD,MAAMC,eAAe,SAAST,SAAS,CAAC;EACtCU,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,8BAsFO,MAAM;MAC1BR,KAAK,CAACS,OAAO,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,GAAG,EAAE,CAACC,UAAU,EAAEC,WAAW,KAAK;QAChE;QACA,MAAMC,QAAQ,GAAG,IAAI,CAACP,KAAK,CAACQ,KAAK;QACjC,MAAMC,SAAS,GAAGH,WAAW,IAAI,IAAI,CAACN,KAAK,CAACQ,KAAK,GAAGH,UAAU,CAAC;QAE/D,IAAII,SAAS,GAAG,IAAI,CAACT,KAAK,CAACU,MAAM,EAAE;UACjC;UACA,IAAI,CAACC,QAAQ,CACX;YACEN,UAAU,EAAEA,UA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E;EACR,CAAC;EACDvB,cAAc,EAAE;IACdmB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRE,IAAI,EAAE,CAAC;IACP9E,MAAM,EAAE,KAAK;IACboF,iBAAiB,EAAE,CAAC;IACpBC,iBAAiB,EAAEnG;EACrB,CAAC;EACDsE,YAAY,EAAE;IACZkB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACT/E,KAAK,EAAE,KAAK;IACZwF,eAAe,EAAE,CAAC;IAClBC,eAAe,EAAErG;EACnB;AACF,CAAC,CAAC;AAEF,eAAeE,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","View","Animated","PanResponder","Image","StyleSheet","Icon","BOXGREY","TEXT_LIGHT","PositionedImage","constructor","props","_defineProperty","getSize","source","uri","imageWidth","imageHeight","newWidth","width","newHeight","height","setState","isVertical","showGuide","onPositionEnd","onDimensionAvailable","offset","state","actual","x","y","imagePosition","setValue","setTimeout","timing","animatedOpacity","toValue","duration","useNativeDriver","start","lastPos","ValueXY","addListener","value","imagePanResponder","create","onStartShouldSetPanResponder","startPos","onPositionStart","panning","onPanResponderMove","event","gesture","newPos","dy","dx","onPanResponderTerminationRequest","onPanResponderRelease","endPos","endY","limitY","endX","limitX","spring","onPanResponderTerminate","Value","componentDidMount","calculateDimensions","componentDidUpdate","prevProps","renderGrid","createElement","style","styles","gridContainer","gridHorizontal","gridVertical","renderGuide","guideContainer","opacity","guideIconContainer","flexDirection","name","type","iconStyle","guideIcon","guideIconDisabled","render","container","_extends","getLayout","panHandlers","overflow","backgroundColor","position","top","right","bottom","left","alignItems","justifyContent","color","fontSize","margin","borderBottomWidth","borderBottomColor","borderLeftWidth","borderLeftColor"],"sources":["PositionedImage.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, Animated, PanResponder, Image, StyleSheet } from \"react-native\";\nimport { Icon } from \"@rneui/themed\";\nimport { BOXGREY, TEXT_LIGHT } from \"../colours\";\n\nclass PositionedImage extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.lastPos = { x: 0, y: 0 };\n\t\tthis.imagePosition = new Animated.ValueXY(this.lastPos);\n\t\tthis.imagePosition.addListener((value) => {\n\t\t\tthis.lastPos = value;\n\t\t});\n\t\tconst imagePanResponder = PanResponder.create({\n\t\t\tonStartShouldSetPanResponder: () => {\n\t\t\t\tthis.startPos = this.lastPos;\n\t\t\t\tif (this.props.onPositionEnd) {\n\t\t\t\t\tif (this.props.onPositionStart) this.props.onPositionStart();\n\t\t\t\t\tthis.setState({ panning: true });\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tonPanResponderMove: (event, gesture) => {\n\t\t\t\tconst newPos = this.state.isVertical\n\t\t\t\t\t? { x: 0, y: this.startPos.y + gesture.dy }\n\t\t\t\t\t: { x: this.startPos.x + gesture.dx, y: 0 };\n\t\t\t\tthis.imagePosition.setValue(newPos);\n\t\t\t},\n\t\t\tonPanResponderTerminationRequest: (event, gesture) => true,\n\t\t\tonPanResponderRelease: (event, gesture) => {\n\t\t\t\tlet endPos = { x: 0, y: 0 };\n\t\t\t\tif (this.state.isVertical) {\n\t\t\t\t\tconst endY = this.startPos.y + gesture.dy;\n\t\t\t\t\tconst limitY = this.props.height - this.state.imageHeight;\n\t\t\t\t\tif (endY > 0) {\n\t\t\t\t\t\t// console.log('top reached', endY);\n\t\t\t\t\t\tendPos = { x: 0, y: 0 };\n\t\t\t\t\t} else if (endY < limitY) {\n\t\t\t\t\t\t// console.log('bottom reached', endY, limitY);\n\t\t\t\t\t\tendPos = { x: 0, y: limitY };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendPos = { x: 0, y: endY };\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst endX = this.startPos.x + gesture.dx;\n\t\t\t\t\tconst limitX = this.props.width - this.state.imageWidth;\n\t\t\t\t\tif (endX > 0) {\n\t\t\t\t\t\t// console.log('left reached', endX);\n\t\t\t\t\t\tendPos = { x: 0, y: 0 };\n\t\t\t\t\t} else if (endX < limitX) {\n\t\t\t\t\t\t// console.log('right reached', endX, limitX);\n\t\t\t\t\t\tendPos = { x: limitX, y: 0 };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendPos = { x: endX, y: 0 };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAnimated.spring(this.imagePosition, {\n\t\t\t\t\ttoValue: endPos,\n\t\t\t\t\tuseNativeDriver: false,\n\t\t\t\t}).start();\n\n\t\t\t\tif (this.props.onPositionEnd)\n\t\t\t\t\tthis.props.onPositionEnd({\n\t\t\t\t\t\tx: endPos.x / this.state.imageWidth,\n\t\t\t\t\t\ty: endPos.y / this.state.imageHeight,\n\t\t\t\t\t});\n\n\t\t\t\tthis.setState({ panning: false });\n\t\t\t},\n\t\t\tonPanResponderTerminate: (event, gesture) => {\n\t\t\t\tthis.setState({ panning: false });\n\t\t\t},\n\t\t});\n\n\t\tthis.state = {\n\t\t\timageWidth: 0,\n\t\t\timageHeight: 0,\n\t\t\timagePanResponder,\n\t\t\tisVertical: true,\n\t\t\tshowGuide: false,\n\t\t\tanimatedOpacity: new Animated.Value(1),\n\t\t\tpanning: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.calculateDimensions();\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tif (prevProps.source.uri !== this.props.source.uri) {\n\t\t\t// console.log('componentDidUpdate', prevProps.source.uri, this.props.source.uri);\n\t\t\tthis.calculateDimensions();\n\t\t}\n\t}\n\n\tcalculateDimensions = () => {\n\t\tImage.getSize(this.props.source.uri, (imageWidth, imageHeight) => {\n\t\t\t// Default vertical positioning\n\t\t\tconst newWidth = this.props.width;\n\t\t\tconst newHeight = imageHeight * (this.props.width / imageWidth);\n\n\t\t\tif (newHeight < this.props.height) {\n\t\t\t\t// If vertical positioning isn't possible, enable horizontal positioning\n\t\t\t\tthis.setState(\n\t\t\t\t\t{\n\t\t\t\t\t\timageWidth: imageWidth * (this.props.height / imageHeight),\n\t\t\t\t\t\timageHeight: this.props.height,\n\t\t\t\t\t\tisVertical: false,\n\t\t\t\t\t\tshowGuide: this.props.onPositionEnd ? true : false,\n\t\t\t\t\t},\n\t\t\t\t\tthis.onDimensionAvailable,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.setState(\n\t\t\t\t\t{\n\t\t\t\t\t\timageWidth: newWidth,\n\t\t\t\t\t\timageHeight: newHeight,\n\t\t\t\t\t\tisVertical: true,\n\t\t\t\t\t\tshowGuide: this.props.onPositionEnd ? true : false,\n\t\t\t\t\t},\n\t\t\t\t\tthis.onDimensionAvailable,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t};\n\n\tonDimensionAvailable = () => {\n\t\tconst { offset } = this.props;\n\t\tconst { imageWidth, imageHeight, isVertical } = this.state;\n\n\t\tif (offset) {\n\t\t\t// Apply percentage offset\n\t\t\tconst actual = {\n\t\t\t\tx: offset.x * imageWidth,\n\t\t\t\ty: offset.y * imageHeight,\n\t\t\t};\n\t\t\tthis.imagePosition.setValue(actual);\n\t\t} else {\n\t\t\t// Centered by default\n\t\t\tthis.imagePosition.setValue({\n\t\t\t\tx: isVertical ? 0 : -0.5 * imageWidth + 0.5 * this.props.width,\n\t\t\t\ty: isVertical ? -0.5 * imageHeight + 0.5 * this.props.height : 0,\n\t\t\t});\n\t\t}\n\n\t\tif (this.props.onPositionEnd) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tAnimated.timing(this.state.animatedOpacity, {\n\t\t\t\t\ttoValue: 0,\n\t\t\t\t\tduration: 900,\n\t\t\t\t\tuseNativeDriver: false,\n\t\t\t\t}).start(() => {\n\t\t\t\t\tthis.setState({ showGuide: false });\n\t\t\t\t});\n\t\t\t}, 1000);\n\t\t}\n\t};\n\n\trenderGrid() {\n\t\tif (!this.state.panning) return null;\n\t\treturn (\n\t\t\t<View style={styles.gridContainer}>\n\t\t\t\t<View style={styles.gridHorizontal} />\n\t\t\t\t<View style={styles.gridVertical} />\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderGuide() {\n\t\tif (!this.state.showGuide) return null;\n\t\tconst { animatedOpacity, isVertical } = this.state;\n\t\treturn (\n\t\t\t<Animated.View\n\t\t\t\tstyle={[styles.guideContainer, { opacity: animatedOpacity }]}\n\t\t\t>\n\t\t\t\t<View style={[styles.guideIconContainer, { flexDirection: \"column\" }]}>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-up\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\t!isVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-down\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\t!isVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<View style={[styles.guideIconContainer, { flexDirection: \"row\" }]}>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-left\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\tisVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-right\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\tisVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</Animated.View>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { imageWidth, imageHeight, imagePanResponder } = this.state;\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.container,\n\t\t\t\t\t{ width: this.props.width, height: this.props.height },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<Animated.Image\n\t\t\t\t\tsource={this.props.source}\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\t{ width: imageWidth, height: imageHeight },\n\t\t\t\t\t\tthis.imagePosition.getLayout(),\n\t\t\t\t\t]}\n\t\t\t\t\t{...imagePanResponder.panHandlers}\n\t\t\t\t/>\n\t\t\t\t{this.renderGrid()}\n\t\t\t\t{this.renderGuide()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\toverflow: \"hidden\",\n\t\tbackgroundColor: BOXGREY,\n\t},\n\tguideContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tbackgroundColor: \"#0006\",\n\t},\n\tguideIconContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tguideIcon: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 50,\n\t\tmargin: 15,\n\t},\n\tguideIconDisabled: {\n\t\tcolor: TEXT_LIGHT,\n\t},\n\tgridContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t},\n\tgridHorizontal: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tleft: 0,\n\t\theight: \"50%\",\n\t\tborderBottomWidth: 1,\n\t\tborderBottomColor: BOXGREY,\n\t},\n\tgridVertical: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\twidth: \"50%\",\n\t\tborderLeftWidth: 1,\n\t\tborderLeftColor: BOXGREY,\n\t},\n});\n\nexport default PositionedImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,UAAU,QAAQ,cAAc;AAC9E,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,OAAO,EAAEC,UAAU,QAAQ,YAAY;AAEhD,MAAMC,eAAe,SAAST,SAAS,CAAC;EACvCU,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,8BA2FQ,MAAM;MAC3BR,KAAK,CAACS,OAAO,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,GAAG,EAAE,CAACC,UAAU,EAAEC,WAAW,KAAK;QACjE;QACA,MAAMC,QAAQ,GAAG,IAAI,CAACP,KAAK,CAACQ,KAAK;QACjC,MAAMC,SAAS,GAAGH,WAAW,IAAI,IAAI,CAACN,KAAK,CAACQ,KAAK,GAAGH,UAAU,CAAC;QAE/D,IAAII,SAAS,GAAG,IAAI,CAACT,KAAK,CAACU,MAAM,EAAE;UAClC;UACA,IAAI,CAACC,QAAQ,CACZ;YACCN,UAAU,EAAEA,UAAU,IAAI,IAAI,CAACL,KAAK,CAACU,MAAM,GAAGJ,WAAW,CAAC;YAC1DA,WAAW,EAAE,IAAI,CAACN,KAAK,CAACU,MAAM;YAC9BE,UAAU,EAAE,KAAK;YACjBC,SAAS,EAAE,IAAI,CAACb,KAAK,CAACc,aAAa,GAAG,IAAI,GAAG;UAC9C,CAAC,EACD,IAAI,CAACC,oBACN,CAAC;Q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AAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACT/E,KAAK,EAAE,KAAK;IACZwF,eAAe,EAAE,CAAC;IAClBC,eAAe,EAAErG;EAClB;AACD,CAAC,CAAC;AAEF,eAAeE,eAAe","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import { View, ImageBackground } from
|
|
3
|
-
import { connect } from
|
|
4
|
-
import Config from
|
|
5
|
-
import { Spinner } from
|
|
6
|
-
import { LINEGREY, getMainBrandingColourFromState } from
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import { View, ImageBackground } from "react-native";
|
|
3
|
+
import { connect } from "react-redux";
|
|
4
|
+
import Config from "../config";
|
|
5
|
+
import { Spinner } from "./Spinner";
|
|
6
|
+
import { LINEGREY, getMainBrandingColourFromState } from "../colours";
|
|
7
7
|
class ProfilePic extends Component {
|
|
8
8
|
constructor(props) {
|
|
9
9
|
super(props);
|
|
@@ -40,15 +40,15 @@ class ProfilePic extends Component {
|
|
|
40
40
|
if (this.state.imageUploading) {
|
|
41
41
|
return /*#__PURE__*/React.createElement(Spinner, {
|
|
42
42
|
style: {
|
|
43
|
-
backgroundColor:
|
|
43
|
+
backgroundColor: "white",
|
|
44
44
|
borderRadius: this.state.imageBorderRadius
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
let image = Config.env.defaultProfileImage;
|
|
49
49
|
let isDefault = true;
|
|
50
|
-
if (this.state.image !== null && typeof this.state.image ===
|
|
51
|
-
if (this.state.image !==
|
|
50
|
+
if (this.state.image !== null && typeof this.state.image === "string") {
|
|
51
|
+
if (this.state.image !== "https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg" && this.state.image !== "https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg" && this.state.image !== "https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg" && this.state.image !== "https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg") {
|
|
52
52
|
image = {
|
|
53
53
|
uri: this.state.image
|
|
54
54
|
};
|
|
@@ -92,7 +92,7 @@ const styles = {
|
|
|
92
92
|
},
|
|
93
93
|
bordered: {
|
|
94
94
|
borderWidth: 1,
|
|
95
|
-
borderColor:
|
|
95
|
+
borderColor: "#fff"
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
const mapStateToProps = state => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","ImageBackground","connect","Config","Spinner","LINEGREY","getMainBrandingColourFromState","ProfilePic","constructor","props","state","image","imageBorderRadius","imageUploading","backgroundFill","UNSAFE_componentWillMount","setState","env","defaultProfileImage","imageDiameterStyle","height","Diameter","width","ImageUploading","tinyChatDefault","UNSAFE_componentWillReceiveProps","nextProps","profPic","renderImage","createElement","style","backgroundColor","borderRadius","isDefault","uri","key","source","styles","profilePicImage","colourBrandingMain","imageStyle","children","render","profilePicOuter","bordered","id","zIndex","flex","borderWidth","borderColor","mapStateToProps","profilePic"],"sources":["ProfilePic.js"],"sourcesContent":["import React, { Component } from
|
|
1
|
+
{"version":3,"names":["React","Component","View","ImageBackground","connect","Config","Spinner","LINEGREY","getMainBrandingColourFromState","ProfilePic","constructor","props","state","image","imageBorderRadius","imageUploading","backgroundFill","UNSAFE_componentWillMount","setState","env","defaultProfileImage","imageDiameterStyle","height","Diameter","width","ImageUploading","tinyChatDefault","UNSAFE_componentWillReceiveProps","nextProps","profPic","renderImage","createElement","style","backgroundColor","borderRadius","isDefault","uri","key","source","styles","profilePicImage","colourBrandingMain","imageStyle","children","render","profilePicOuter","bordered","id","zIndex","flex","borderWidth","borderColor","mapStateToProps","profilePic"],"sources":["ProfilePic.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, ImageBackground } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport Config from \"../config\";\nimport { Spinner } from \"./Spinner\";\nimport { LINEGREY, getMainBrandingColourFromState } from \"../colours\";\n\nclass ProfilePic extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\timage: null,\n\t\t\timageBorderRadius: 18,\n\t\t\timageUploading: false,\n\t\t\tbackgroundFill: false,\n\t\t};\n\t}\n\n\tUNSAFE_componentWillMount() {\n\t\tthis.setState({\n\t\t\timage:\n\t\t\t\tthis.props.ProfilePic != null\n\t\t\t\t\t? this.props.ProfilePic\n\t\t\t\t\t: Config.env.defaultProfileImage,\n\t\t\timageDiameterStyle: {\n\t\t\t\theight: this.props.Diameter != null ? this.props.Diameter : 35,\n\t\t\t\twidth: this.props.Diameter != null ? this.props.Diameter : 35,\n\t\t\t},\n\t\t\timageBorderRadius:\n\t\t\t\tthis.props.Diameter != null ? this.props.Diameter / 2 : 18,\n\t\t\timageUploading: this.props.ImageUploading,\n\t\t\tbackgroundFill: this.props.ProfilePic === Config.env.tinyChatDefault,\n\t\t});\n\t}\n\n\tUNSAFE_componentWillReceiveProps(nextProps) {\n\t\tlet profPic = null;\n\t\tif (nextProps.ProfilePic) {\n\t\t\tprofPic = nextProps.ProfilePic;\n\t\t}\n\n\t\tthis.setState({\n\t\t\timage: profPic,\n\t\t\timageUploading: nextProps.ImageUploading,\n\t\t});\n\t}\n\n\trenderImage() {\n\t\tif (this.state.imageUploading) {\n\t\t\treturn (\n\t\t\t\t<Spinner\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: \"white\",\n\t\t\t\t\t\tborderRadius: this.state.imageBorderRadius,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tlet image = Config.env.defaultProfileImage;\n\t\tlet isDefault = true;\n\t\tif (this.state.image !== null && typeof this.state.image === \"string\") {\n\t\t\tif (\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg\"\n\t\t\t) {\n\t\t\t\timage = { uri: this.state.image };\n\t\t\t\tisDefault = false;\n\t\t\t}\n\t\t}\n\t\treturn (\n\t\t\t<ImageBackground\n\t\t\t\tkey=\"default\"\n\t\t\t\tsource={image}\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.profilePicImage,\n\t\t\t\t\t{ borderRadius: this.state.imageBorderRadius },\n\t\t\t\t\t(isDefault || this.state.backgroundFill) && {\n\t\t\t\t\t\tbackgroundColor: this.props.colourBrandingMain,\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t\timageStyle={{ borderRadius: this.state.imageBorderRadius }}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</ImageBackground>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.profilePicOuter,\n\t\t\t\t\tthis.state.imageDiameterStyle,\n\t\t\t\t\tthis.props.bordered && styles.bordered,\n\t\t\t\t\t{ borderRadius: this.state.imageBorderRadius },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t\tkey={this.props.id}\n\t\t\t>\n\t\t\t\t{this.renderImage()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tprofilePicOuter: {\n\t\theight: 35,\n\t\twidth: 35,\n\t\tzIndex: 1,\n\t\tbackgroundColor: LINEGREY,\n\t\t// overflow: 'hidden'\n\t},\n\tprofilePicImage: {\n\t\tflex: 1,\n\t\theight: null,\n\t\twidth: null,\n\t},\n\tbordered: {\n\t\tborderWidth: 1,\n\t\tborderColor: \"#fff\",\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst profilePic = connect(mapStateToProps, {})(ProfilePic);\nexport { profilePic as ProfilePic };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,eAAe,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,EAAEC,8BAA8B,QAAQ,YAAY;AAErE,MAAMC,UAAU,SAASR,SAAS,CAAC;EAClCS,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MACZC,KAAK,EAAE,IAAI;MACXC,iBAAiB,EAAE,EAAE;MACrBC,cAAc,EAAE,KAAK;MACrBC,cAAc,EAAE;IACjB,CAAC;EACF;EAEAC,yBAAyBA,CAAA,EAAG;IAC3B,IAAI,CAACC,QAAQ,CAAC;MACbL,KAAK,EACJ,IAAI,CAACF,KAAK,CAACF,UAAU,IAAI,IAAI,GAC1B,IAAI,CAACE,KAAK,CAACF,UAAU,GACrBJ,MAAM,CAACc,GAAG,CAACC,mBAAmB;MAClCC,kBAAkB,EAAE;QACnBC,MAAM,EAAE,IAAI,CAACX,KAAK,CAACY,QAAQ,IAAI,IAAI,GAAG,IAAI,CAACZ,KAAK,CAACY,QAAQ,GAAG,EAAE;QAC9DC,KAAK,EAAE,IAAI,CAACb,KAAK,CAACY,QAAQ,IAAI,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IAAI,EAAE,CAAC;IACP3B,MAAM,EAAE,IAAI;IACZE,KAAK,EAAE;EACR,CAAC;EACDsB,QAAQ,EAAE;IACTI,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACd;AACD,CAAC;AAED,MAAMC,eAAe,GAAIxC,KAAK,IAAK;EAClC,OAAO;IACN6B,kBAAkB,EAAEjC,8BAA8B,CAACI,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMyC,UAAU,GAAGjD,OAAO,CAACgD,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC3C,UAAU,CAAC;AAC3D,SAAS4C,UAAU,IAAI5C,UAAU","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { Text } from "@plusscommunities/pluss-core-app/components";
|
|
3
|
+
import { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet } from "react-native";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from "../colours";
|
|
5
6
|
class RadioButton extends PureComponent {
|
|
6
7
|
render() {
|
|
7
8
|
const {
|
|
@@ -53,16 +54,16 @@ const styles = StyleSheet.create({
|
|
|
53
54
|
container: {
|
|
54
55
|
borderColor: LINEGREY,
|
|
55
56
|
borderWidth: 1,
|
|
56
|
-
backgroundColor:
|
|
57
|
-
alignItems:
|
|
58
|
-
justifyContent:
|
|
57
|
+
backgroundColor: "#fff",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "center"
|
|
59
60
|
},
|
|
60
61
|
radioOption: {
|
|
61
|
-
flexDirection:
|
|
62
|
+
flexDirection: "row",
|
|
62
63
|
marginRight: 26
|
|
63
64
|
},
|
|
64
65
|
radioOptionText: {
|
|
65
|
-
fontFamily:
|
|
66
|
+
fontFamily: "sf-medium",
|
|
66
67
|
fontSize: 14,
|
|
67
68
|
color: TEXT_DARKEST
|
|
68
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","View","TouchableOpacity","TouchableWithoutFeedback","StyleSheet","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","Text","View","TouchableOpacity","TouchableWithoutFeedback","StyleSheet","connect","getMainBrandingColourFromState","LINEGREY","TEXT_DARKEST","RadioButton","render","size","isActive","value","onPress","colourBrandingMain","style","label","props","iconSize","innerSize","content","createElement","styles","container","width","height","borderRadius","backgroundColor","key","radioOption","hitSlop","top","left","bottom","right","radioOptionText","create","borderColor","borderWidth","alignItems","justifyContent","flexDirection","marginRight","fontFamily","fontSize","color","mapStateToProps","state","radioButton"],"sources":["RadioButton.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport {\n\tView,\n\tTouchableOpacity,\n\tTouchableWithoutFeedback,\n\tStyleSheet,\n} from \"react-native\";\nimport { connect } from \"react-redux\";\nimport {\n\tgetMainBrandingColourFromState,\n\tLINEGREY,\n\tTEXT_DARKEST,\n} from \"../colours\";\n\nclass RadioButton extends PureComponent {\n\trender() {\n\t\tconst { size, isActive, value, onPress, colourBrandingMain, style, label } =\n\t\t\tthis.props;\n\t\tconst iconSize = size || 20;\n\t\tconst innerSize = iconSize - 8;\n\n\t\tconst content = (\n\t\t\t<TouchableWithoutFeedback onPress={() => onPress(value)}>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.container,\n\t\t\t\t\t\t{ width: iconSize, height: iconSize, borderRadius: iconSize / 2 },\n\t\t\t\t\t\tstyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{isActive && (\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: innerSize,\n\t\t\t\t\t\t\t\theight: innerSize,\n\t\t\t\t\t\t\t\tborderRadius: innerSize / 2,\n\t\t\t\t\t\t\t\tbackgroundColor: colourBrandingMain,\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</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\n\t\tif (label) {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tonPress={() => onPress(value)}\n\t\t\t\t\tkey={label}\n\t\t\t\t\tstyle={styles.radioOption}\n\t\t\t\t\thitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n\t\t\t\t>\n\t\t\t\t\t{content}\n\t\t\t\t\t<Text style={styles.radioOptionText}>{label}</Text>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\n\t\treturn content;\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tborderColor: LINEGREY,\n\t\tborderWidth: 1,\n\t\tbackgroundColor: \"#fff\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tradioOption: {\n\t\tflexDirection: \"row\",\n\t\tmarginRight: 26,\n\t},\n\tradioOptionText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 14,\n\t\tcolor: TEXT_DARKEST,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst radioButton = connect(mapStateToProps, {})(RadioButton);\nexport { radioButton as RadioButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,6CAA6C;AAClE,SACCC,IAAI,EACJC,gBAAgB,EAChBC,wBAAwB,EACxBC,UAAU,QACJ,cAAc;AACrB,SAASC,OAAO,QAAQ,aAAa;AACrC,SACCC,8BAA8B,EAC9BC,QAAQ,EACRC,YAAY,QACN,YAAY;AAEnB,MAAMC,WAAW,SAASV,aAAa,CAAC;EACvCW,MAAMA,CAAA,E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AC;IAErB;IAEA,OAAOI,OAAO;EACf;AACD;AAEA,MAAME,MAAM,GAAGnB,UAAU,CAACiC,MAAM,CAAC;EAChCb,SAAS,EAAE;IACVc,WAAW,EAAE/B,QAAQ;IACrBgC,WAAW,EAAE,CAAC;IACdX,eAAe,EAAE,MAAM;IACvBY,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACjB,CAAC;EACDX,WAAW,EAAE;IACZY,aAAa,EAAE,KAAK;IACpBC,WAAW,EAAE;EACd,CAAC;EACDP,eAAe,EAAE;IAChBQ,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEtC;EACR;AACD,CAAC,CAAC;AAEF,MAAMuC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNjC,kBAAkB,EAAET,8BAA8B,CAAC0C,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,WAAW,GAAG5C,OAAO,CAAC0C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACtC,WAAW,CAAC;AAC7D,SAASwC,WAAW,IAAIxC,WAAW","ignoreList":[]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
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
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
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
|
|
5
|
-
import { View,
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { View, Image, TouchableOpacity } from "react-native";
|
|
6
|
+
import { Text } from "./Text";
|
|
7
|
+
import { connect } from "react-redux";
|
|
8
|
+
import _ from "lodash";
|
|
9
|
+
import { getReactions, getShadowStyle } from "../helper";
|
|
10
|
+
import { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from "../colours";
|
|
11
|
+
import { reactionActions } from "../apis";
|
|
11
12
|
class Reaction extends Component {
|
|
12
13
|
constructor(...args) {
|
|
13
14
|
super(...args);
|
|
@@ -23,12 +24,12 @@ class Reaction extends Component {
|
|
|
23
24
|
}
|
|
24
25
|
getStyleType() {
|
|
25
26
|
if (this.props.reactions[this.props.userId]) {
|
|
26
|
-
return
|
|
27
|
+
return "ThisHL";
|
|
27
28
|
}
|
|
28
29
|
if (this.props.anyHighlighted) {
|
|
29
|
-
return
|
|
30
|
+
return "OtherHL";
|
|
30
31
|
}
|
|
31
|
-
return
|
|
32
|
+
return "Default";
|
|
32
33
|
}
|
|
33
34
|
getTopReaction() {
|
|
34
35
|
return _.maxBy(Object.keys(this.props.reactions), key => {
|
|
@@ -58,14 +59,14 @@ class Reaction extends Component {
|
|
|
58
59
|
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
59
60
|
style: styles.touchable,
|
|
60
61
|
onPress: this.onPressReaction,
|
|
61
|
-
disabled: this.props.user.type ===
|
|
62
|
+
disabled: this.props.user.type === "KIOSK"
|
|
62
63
|
}, /*#__PURE__*/React.createElement(View, {
|
|
63
64
|
style: [styles.container, styles[`container${this.getStyleType()}`], this.props.style]
|
|
64
65
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
65
66
|
style: [styles.image, this.props.imageStyle],
|
|
66
67
|
source: this.props.reaction.icon
|
|
67
68
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
68
|
-
style: [styles.count, this.getStyleType() ===
|
|
69
|
+
style: [styles.count, this.getStyleType() === "ThisHL" && {
|
|
69
70
|
color: this.props.colourBrandingMain
|
|
70
71
|
}, this.props.countStyle]
|
|
71
72
|
}, Object.keys(this.props.reactions).length)));
|
|
@@ -82,8 +83,8 @@ const styles = {
|
|
|
82
83
|
height: 30,
|
|
83
84
|
borderRadius: 15,
|
|
84
85
|
backgroundColor: BG_GREY,
|
|
85
|
-
flexDirection:
|
|
86
|
-
alignItems:
|
|
86
|
+
flexDirection: "row-reverse",
|
|
87
|
+
alignItems: "center",
|
|
87
88
|
paddingHorizontal: 8
|
|
88
89
|
},
|
|
89
90
|
containerThisHL: {
|
|
@@ -95,13 +96,13 @@ const styles = {
|
|
|
95
96
|
image: {
|
|
96
97
|
width: 20,
|
|
97
98
|
height: 20,
|
|
98
|
-
resizeMode:
|
|
99
|
+
resizeMode: "contain"
|
|
99
100
|
},
|
|
100
101
|
count: {
|
|
101
|
-
fontFamily:
|
|
102
|
+
fontFamily: "sf-medium",
|
|
102
103
|
color: TEXT_DARK,
|
|
103
104
|
flex: 1,
|
|
104
|
-
textAlign:
|
|
105
|
+
textAlign: "center",
|
|
105
106
|
fontSize: 16
|
|
106
107
|
}
|
|
107
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","
|
|
1
|
+
{"version":3,"names":["React","Component","View","Image","TouchableOpacity","Text","connect","_","getReactions","getShadowStyle","BG_GREY","TEXT_DARK","getMainBrandingColourFromState","reactionActions","Reaction","constructor","args","_defineProperty","props","reactions","userId","add","entityId","entityType","reaction","key","site","onLike","remove","onUnlike","getStyleType","anyHighlighted","getTopReaction","maxBy","Object","keys","length","getIcon","topReaction","find","r","icon","render","topReactionOnly","createElement","style","styles","container","containerThisHL","image","imageStyle","source","count","countStyle","touchable","onPress","onPressReaction","disabled","user","type","color","colourBrandingMain","marginHorizontal","width","height","borderRadius","backgroundColor","flexDirection","alignItems","paddingHorizontal","containerOtherHL","opacity","resizeMode","fontFamily","flex","textAlign","fontSize","mapStateToProps","state"],"sources":["Reaction.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, Image, TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport _ from \"lodash\";\nimport { getReactions, getShadowStyle } from \"../helper\";\nimport { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from \"../colours\";\nimport { reactionActions } from \"../apis\";\n\nclass Reaction extends Component {\n\tonPressReaction = () => {\n\t\tif (!this.props.reactions[this.props.userId]) {\n\t\t\treactionActions.add(\n\t\t\t\tthis.props.entityId,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.reaction.key,\n\t\t\t\tthis.props.site,\n\t\t\t);\n\t\t\tthis.props.onLike();\n\t\t} else {\n\t\t\treactionActions.remove(\n\t\t\t\tthis.props.entityId,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.reaction.key,\n\t\t\t);\n\t\t\tthis.props.onUnlike();\n\t\t}\n\t};\n\n\tgetStyleType() {\n\t\tif (this.props.reactions[this.props.userId]) {\n\t\t\treturn \"ThisHL\";\n\t\t}\n\t\tif (this.props.anyHighlighted) {\n\t\t\treturn \"OtherHL\";\n\t\t}\n\t\treturn \"Default\";\n\t}\n\n\tgetTopReaction() {\n\t\treturn _.maxBy(Object.keys(this.props.reactions), (key) => {\n\t\t\treturn Object.keys(this.props.reactions[key]).length;\n\t\t});\n\t}\n\n\tgetIcon(topReaction) {\n\t\treturn _.find(getReactions(), (r) => {\n\t\t\treturn r.key === topReaction;\n\t\t}).icon;\n\t}\n\n\trender() {\n\t\tif (this.props.topReactionOnly) {\n\t\t\tconst topReaction = this.getTopReaction();\n\t\t\tif (!topReaction) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<View\n\t\t\t\t\tstyle={[styles.container, styles.containerThisHL, this.props.style]}\n\t\t\t\t>\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={[styles.image, this.props.imageStyle]}\n\t\t\t\t\t\tsource={this.getIcon(topReaction)}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text style={[styles.count, this.props.countStyle]}>\n\t\t\t\t\t\t{Object.keys(this.props.reactions[topReaction]).length}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={styles.touchable}\n\t\t\t\tonPress={this.onPressReaction}\n\t\t\t\tdisabled={this.props.user.type === \"KIOSK\"}\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.container,\n\t\t\t\t\t\tstyles[`container${this.getStyleType()}`],\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={[styles.image, this.props.imageStyle]}\n\t\t\t\t\t\tsource={this.props.reaction.icon}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.count,\n\t\t\t\t\t\t\tthis.getStyleType() === \"ThisHL\" && {\n\t\t\t\t\t\t\t\tcolor: this.props.colourBrandingMain,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.countStyle,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{Object.keys(this.props.reactions).length}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst styles = {\n\ttouchable: {\n\t\tmarginHorizontal: 4,\n\t\twidth: 60,\n\t\theight: 30,\n\t},\n\tcontainer: {\n\t\twidth: 60,\n\t\theight: 30,\n\t\tborderRadius: 15,\n\t\tbackgroundColor: BG_GREY,\n\t\tflexDirection: \"row-reverse\",\n\t\talignItems: \"center\",\n\t\tpaddingHorizontal: 8,\n\t},\n\tcontainerThisHL: {\n\t\t...getShadowStyle(),\n\t},\n\tcontainerOtherHL: {\n\t\topacity: 0.5,\n\t},\n\timage: {\n\t\twidth: 20,\n\t\theight: 20,\n\t\tresizeMode: \"contain\",\n\t},\n\tcount: {\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: TEXT_DARK,\n\t\tflex: 1,\n\t\ttextAlign: \"center\",\n\t\tfontSize: 16,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tuser: state.user,\n\t};\n};\n\nconst reaction = connect(mapStateToProps, {})(Reaction);\nexport { reaction as Reaction };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,KAAK,EAAEC,gBAAgB,QAAQ,cAAc;AAC5D,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,YAAY,EAAEC,cAAc,QAAQ,WAAW;AACxD,SAASC,OAAO,EAAEC,SAAS,EAAEC,8BAA8B,QAAQ,YAAY;AAC/E,SAASC,eAAe,QAAQ,SAAS;AAEzC,MAAMC,QAAQ,SAASb,SAAS,CAAC;EAAAc,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACd,MAAM;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,SAAS,CAAC,IAAI,CAACD,KAAK,CAACE,MAAM,CAAC,EAAE;QAC7CP,eAAe,CAACQ,GAAG,CAClB,IAAI,CAACH,KAAK,CAACI,QAAQ,EACnB,IAAI,CAACJ,KAAK,CAACK,UAAU,EACrB,IAAI,CAACL,KAAK,CAACM,QAAQ,CAACC,GAAG,EACvB,IAAI,CAACP,KAAK,CAACQ,IACZ,CAAC;QACD,IAAI,CAACR,KAAK,CAACS,MAAM,CAAC,CAAC;MACpB,CAAC,MAAM;QACNd,eAAe,CAACe,MAAM,CACrB,IAAI,CAACV,KAAK,CAACI,QAAQ,EACnB,IAAI,CAACJ,KAAK,CAACK,UAAU,EACrB,IAAI,CAACL,KAAK,CAACM,QAAQ,CAACC,G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MAAM,CAACC,IAAI,CAAC,IAAI,CAACjB,KAAK,CAACC,SAAS,CAAC,CAACiB,MAC9B,CACD,CACW,CAAC;EAErB;AACD;AAEA,MAAMU,MAAM,GAAG;EACdQ,SAAS,EAAE;IACVQ,gBAAgB,EAAE,CAAC;IACnBC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACT,CAAC;EACDjB,SAAS,EAAE;IACVgB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAExD,OAAO;IACxByD,aAAa,EAAE,aAAa;IAC5BC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACDrB,eAAe,EAAE;IAChB,GAAGvC,cAAc,CAAC;EACnB,CAAC;EACD6D,gBAAgB,EAAE;IACjBC,OAAO,EAAE;EACV,CAAC;EACDtB,KAAK,EAAE;IACNc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,UAAU,EAAE;EACb,CAAC;EACDpB,KAAK,EAAE;IACNqB,UAAU,EAAE,WAAW;IACvBb,KAAK,EAAEjD,SAAS;IAChB+D,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAMC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNjB,kBAAkB,EAAEjD,8BAA8B,CAACkE,KAAK,CAAC;IACzDpB,IAAI,EAAEoB,KAAK,CAACpB;EACb,CAAC;AACF,CAAC;AAED,MAAMlC,QAAQ,GAAGlB,OAAO,CAACuE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC/D,QAAQ,CAAC;AACvD,SAASU,QAAQ,IAAIV,QAAQ","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
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
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
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
|
|
5
|
-
import { View } from
|
|
6
|
-
import { getReactions, getUserPreview } from
|
|
7
|
-
import { Reaction } from
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { getReactions, getUserPreview } from "../helper";
|
|
7
|
+
import { Reaction } from "./Reaction";
|
|
8
8
|
class Reactions extends Component {
|
|
9
9
|
constructor(...args) {
|
|
10
10
|
super(...args);
|
|
@@ -62,9 +62,9 @@ class Reactions extends Component {
|
|
|
62
62
|
}
|
|
63
63
|
const styles = {
|
|
64
64
|
container: {
|
|
65
|
-
flexDirection:
|
|
66
|
-
justifyContent:
|
|
67
|
-
width:
|
|
65
|
+
flexDirection: "row",
|
|
66
|
+
justifyContent: "center",
|
|
67
|
+
width: "100%"
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
export { Reactions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","getReactions","getUserPreview","Reaction","Reactions","constructor","args","_defineProperty","reactions","getReaction","key","props","entity","onLike","user","uid","onUpdateReactions","onUnlike","render","createElement","style","styles","container","state","map","r","i","reaction","entityType","entityId","anyHighlighted","userId","bind","site","flexDirection","justifyContent","width"],"sources":["Reactions.js"],"sourcesContent":["import React, { Component } from
|
|
1
|
+
{"version":3,"names":["React","Component","View","getReactions","getUserPreview","Reaction","Reactions","constructor","args","_defineProperty","reactions","getReaction","key","props","entity","onLike","user","uid","onUpdateReactions","onUnlike","render","createElement","style","styles","container","state","map","r","i","reaction","entityType","entityId","anyHighlighted","userId","bind","site","flexDirection","justifyContent","width"],"sources":["Reactions.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View } from \"react-native\";\nimport { getReactions, getUserPreview } from \"../helper\";\nimport { Reaction } from \"./Reaction\";\n\nclass Reactions extends Component {\n\tstate = {\n\t\treactions: getReactions(),\n\t};\n\n\tgetReaction(key) {\n\t\tif (!this.props.entity) {\n\t\t\treturn {};\n\t\t}\n\t\tif (!this.props.entity.Reactions) {\n\t\t\tthis.props.entity.Reactions = {};\n\t\t}\n\t\treturn this.props.entity.Reactions[key] || {};\n\t}\n\n\tonLike(key) {\n\t\tif (!this.props.entity.Reactions) {\n\t\t\tthis.props.entity.Reactions = {};\n\t\t}\n\t\tif (!this.props.entity.Reactions[key]) {\n\t\t\tthis.props.entity.Reactions[key] = {};\n\t\t}\n\t\tthis.props.entity.Reactions[key][this.props.user.uid] = getUserPreview(\n\t\t\tthis.props.user,\n\t\t);\n\t\tthis.props.onUpdateReactions();\n\t}\n\n\tonUnlike(key) {\n\t\tif (!this.props.entity.Reactions) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.props.entity.Reactions[key]) {\n\t\t\treturn;\n\t\t}\n\t\tdelete this.props.entity.Reactions[key][this.props.user.uid];\n\t\tthis.props.onUpdateReactions();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.style]}>\n\t\t\t\t{this.state.reactions.map((r, i) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Reaction\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\treaction={r}\n\t\t\t\t\t\t\tentityType={this.props.entityType}\n\t\t\t\t\t\t\tentityId={this.props.entityId}\n\t\t\t\t\t\t\treactions={this.getReaction(r.key)}\n\t\t\t\t\t\t\tanyHighlighted={this.props.anyHighlighted}\n\t\t\t\t\t\t\tuserId={this.props.user.uid}\n\t\t\t\t\t\t\tonLike={this.onLike.bind(this, r.key)}\n\t\t\t\t\t\t\tonUnlike={this.onUnlike.bind(this, r.key)}\n\t\t\t\t\t\t\tsite={this.props.site}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"center\",\n\t\twidth: \"100%\",\n\t},\n};\n\nexport { Reactions };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,WAAW;AACxD,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,SAAS,SAASL,SAAS,CAAC;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBACzB;MACPC,SAAS,EAAEP,YAAY,CAAC;IACzB,CAAC;EAAA;EAEDQ,WAAWA,CAACC,GAAG,EAAE;IAChB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,MAAM,EAAE;MACvB,OAAO,CAAC,CAAC;IACV;IACA,IAAI,CAAC,IAAI,CAACD,KAAK,CAACC,MAAM,CAACR,SAAS,EAAE;MACjC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,GAAG,CAAC,CAAC;IACjC;IACA,OAAO,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,IAAI,CAAC,CAAC;EAC9C;EAEAG,MAAMA,CAACH,GAAG,EAAE;IACX,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,MAAM,CAACR,SAAS,EAAE;MACjC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,GAAG,CAAC,CAAC;IACjC;IACA,IAAI,CAAC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,EAAE;MACtC,IAAI,CAACC,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,GAAG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