Authored by 于良

Merge branch 'local' into develop

@@ -28,7 +28,7 @@ const { @@ -28,7 +28,7 @@ const {
28 28
29 let {width, height} = Dimensions.get('window'); 29 let {width, height} = Dimensions.get('window');
30 let bannerHeight = Math.ceil((363 / 750) * width); 30 let bannerHeight = Math.ceil((363 / 750) * width);
31 -let sectionHeight = Math.ceil((435 / 750) * width); 31 +let sectionHeight = Math.ceil((419 / 750) * width);
32 32
33 export default class Home extends React.Component { 33 export default class Home extends React.Component {
34 34
@@ -220,11 +220,15 @@ export default class Home extends React.Component { @@ -220,11 +220,15 @@ export default class Home extends React.Component {
220 } else if (type == 1) { 220 } else if (type == 1) {
221 // hot 221 // hot
222 let postId = item.get('hot').get('postId') 222 let postId = item.get('hot').get('postId')
223 - this.props.onPressPost && this.props.onPressPost(postId); 223 + if (postId) {
  224 + this.props.onPressPost && this.props.onPressPost(postId);
  225 + }
224 } else if (type == 2) { 226 } else if (type == 2) {
225 // new 227 // new
226 let postId = item.get('new').get('postId') 228 let postId = item.get('new').get('postId')
227 - this.props.onPressPost && this.props.onPressPost(postId); 229 + if (postId) {
  230 + this.props.onPressPost && this.props.onPressPost(postId);
  231 + }
228 } 232 }
229 }} 233 }}
230 /> 234 />
@@ -249,6 +253,14 @@ export default class Home extends React.Component { @@ -249,6 +253,14 @@ export default class Home extends React.Component {
249 _renderSectionHeader(sectionData, sectionID) { 253 _renderSectionHeader(sectionData, sectionID) {
250 switch (sectionID) { 254 switch (sectionID) {
251 case 'recommendation': 255 case 'recommendation':
  256 + if (this.props.recommendation.size == 0) {
  257 + if (this.props.isLoadingMore && this.props.isFetching) {
  258 +
  259 + } else {
  260 + return null;
  261 + }
  262 + }
  263 +
252 return ( 264 return (
253 <View style={styles.sectionHeader}> 265 <View style={styles.sectionHeader}>
254 <Image style={styles.sectionHeaderImg} source={require('../../images/home/hot.png')}/> 266 <Image style={styles.sectionHeaderImg} source={require('../../images/home/hot.png')}/>
@@ -337,7 +349,7 @@ let styles = StyleSheet.create({ @@ -337,7 +349,7 @@ let styles = StyleSheet.create({
337 }, 349 },
338 sectionHeader: { 350 sectionHeader: {
339 flexDirection: 'row', 351 flexDirection: 'row',
340 - height: 32, 352 + height: 33,
341 alignItems: 'center', 353 alignItems: 'center',
342 backgroundColor: 'white', 354 backgroundColor: 'white',
343 // borderTopWidth: 0.5, // borderTopWidth 在iPhone 6P上显示有bug 355 // borderTopWidth: 0.5, // borderTopWidth 在iPhone 6P上显示有bug
@@ -7,6 +7,7 @@ import UserBrief from './UserBrief'; @@ -7,6 +7,7 @@ import UserBrief from './UserBrief';
7 import Thumbs from './Thumbs'; 7 import Thumbs from './Thumbs';
8 import SectionItem from './SectionItem'; 8 import SectionItem from './SectionItem';
9 import NumberButton from './NumberButton'; 9 import NumberButton from './NumberButton';
  10 +import emojiDecter from '../../utils/emojiDecter';
10 11
11 const { 12 const {
12 View, 13 View,
@@ -62,8 +63,25 @@ export default class ListCell extends React.Component { @@ -62,8 +63,25 @@ export default class ListCell extends React.Component {
62 let data = this.props.data.toJS(); 63 let data = this.props.data.toJS();
63 let {author, timeago, isOwner, isTop, isLike, id, title, desc, thumbs, section, commentCount, likeCount} = data; 64 let {author, timeago, isOwner, isTop, isLike, id, title, desc, thumbs, section, commentCount, likeCount} = data;
64 let likeImage = isLike ? require('../../images/home/like.png') : require('../../images/home/unlike.png'); 65 let likeImage = isLike ? require('../../images/home/like.png') : require('../../images/home/unlike.png');
  66 + let titleStyle = emojiDecter(title) ? null : {paddingTop: -(28 - 18) / 2};
  67 + let descStyle = emojiDecter(desc) ? null : {paddingTop: -(23 - 14) / 2};
65 let hideSection = this.props.hideSection; 68 let hideSection = this.props.hideSection;
66 let bottomStyle = hideSection ? {alignSelf: 'flex-end'} : null; 69 let bottomStyle = hideSection ? {alignSelf: 'flex-end'} : null;
  70 + let thumbMarginTop = 10;
  71 + let bottomMarginTop = 15;
  72 + if (title && !desc && thumbs.length == 0) {
  73 + bottomMarginTop = 8;
  74 + }
  75 + if (title && desc && thumbs.length == 0) {
  76 + bottomMarginTop = 10;
  77 + }
  78 + if (title && desc && thumbs.length > 0) {
  79 + thumbMarginTop = 14;
  80 + bottomMarginTop = 15;
  81 + }
  82 + if (title && !desc && thumbs.length > 0) {
  83 + thumbMarginTop = 9;
  84 + }
67 return ( 85 return (
68 <TouchableOpacity 86 <TouchableOpacity
69 style={styles.row} 87 style={styles.row}
@@ -84,10 +102,10 @@ export default class ListCell extends React.Component { @@ -84,10 +102,10 @@ export default class ListCell extends React.Component {
84 /> 102 />
85 {isTop ? <Text style={styles.topTag}>置顶</Text> : null} 103 {isTop ? <Text style={styles.topTag}>置顶</Text> : null}
86 </View> 104 </View>
87 - {title ? <Text style={styles.title} numberOfLines={2}>{title}</Text> : null}  
88 - {desc ? <Text style={styles.desc} numberOfLines={2}>{desc}</Text> : null}  
89 - {thumbs.length > 0 ? <Thumbs style={styles.thumbs} data={thumbs}/> : null}  
90 - <View style={[styles.bottom, bottomStyle]}> 105 + {title ? <Text style={[styles.title, titleStyle]} numberOfLines={2}>{title}</Text> : null}
  106 + {desc ? <Text style={[styles.desc, descStyle]} numberOfLines={2}>{desc}</Text> : null}
  107 + {thumbs.length > 0 ? <Thumbs style={[styles.thumbs, {marginTop: thumbMarginTop}]} data={thumbs}/> : null}
  108 + <View style={[styles.bottom, bottomStyle, {marginTop: bottomMarginTop}]}>
91 {hideSection ? null : <SectionItem 109 {hideSection ? null : <SectionItem
92 name={section.name} 110 name={section.name}
93 onPressSection={() => { 111 onPressSection={() => {
@@ -141,23 +159,23 @@ let styles = StyleSheet.create({ @@ -141,23 +159,23 @@ let styles = StyleSheet.create({
141 paddingTop: 4.5, 159 paddingTop: 4.5,
142 }, 160 },
143 title: { 161 title: {
  162 + marginTop: -6,
144 fontSize: 18, 163 fontSize: 18,
145 lineHeight: 28, 164 lineHeight: 28,
146 - paddingTop: -(28 - 18) / 2 - 2,  
147 }, 165 },
148 desc: { 166 desc: {
  167 + marginTop: 3,
149 fontSize: 14, 168 fontSize: 14,
150 lineHeight: 23, 169 lineHeight: 23,
151 color: '#888888', 170 color: '#888888',
152 - paddingTop: -(23 - 14) / 2,  
153 }, 171 },
154 thumbs: { 172 thumbs: {
155 - marginTop: 15, 173 + marginTop: 10,
156 }, 174 },
157 bottom: { 175 bottom: {
158 flexDirection: 'row', 176 flexDirection: 'row',
159 justifyContent: 'space-between', 177 justifyContent: 'space-between',
160 - marginTop: 15, 178 + marginTop: 12,
161 marginBottom: 15, 179 marginBottom: 15,
162 }, 180 },
163 buttonContainer: { 181 buttonContainer: {
@@ -86,11 +86,13 @@ let styles = StyleSheet.create({ @@ -86,11 +86,13 @@ let styles = StyleSheet.create({
86 notice: { 86 notice: {
87 marginLeft: 15, 87 marginLeft: 15,
88 marginRight: 5, 88 marginRight: 5,
89 - paddingVertical: 5,  
90 - paddingHorizontal: 10, 89 + paddingTop: 4,
91 backgroundColor: 'black', 90 backgroundColor: 'black',
92 fontSize: 12, 91 fontSize: 12,
93 color: 'white', 92 color: 'white',
  93 + width: 42,
  94 + height: 20,
  95 + textAlign: 'center',
94 }, 96 },
95 banner: { 97 banner: {
96 98
@@ -14,7 +14,7 @@ const { @@ -14,7 +14,7 @@ const {
14 } = ReactNative; 14 } = ReactNative;
15 15
16 let {width, height} = Dimensions.get('window'); 16 let {width, height} = Dimensions.get('window');
17 -let thumbHeight = Math.ceil((214 / (750 - 34)) * (width - 34)); 17 +let thumbHeight = Math.ceil(214 / 750 * width);
18 let marginLeft = Math.ceil(width - 34 - thumbHeight * 3) / 2; 18 let marginLeft = Math.ceil(width - 34 - thumbHeight * 3) / 2;
19 19
20 export default class Thumbs extends React.Component { 20 export default class Thumbs extends React.Component {
@@ -15,7 +15,6 @@ const { @@ -15,7 +15,6 @@ const {
15 15
16 let {width, height} = Dimensions.get('window'); 16 let {width, height} = Dimensions.get('window');
17 let thumbHeight = Math.ceil(276 / 750 * width); 17 let thumbHeight = Math.ceil(276 / 750 * width);
18 -let marginLeft = Math.ceil(width - 34 - thumbHeight * 3) / 2;  
19 18
20 export default class SectionHeader extends React.Component { 19 export default class SectionHeader extends React.Component {
21 20
@@ -58,12 +57,14 @@ let styles = StyleSheet.create({ @@ -58,12 +57,14 @@ let styles = StyleSheet.create({
58 flexDirection: 'column', 57 flexDirection: 'column',
59 // alignItems: 'center', 58 // alignItems: 'center',
60 backgroundColor: '#b0b0b0', 59 backgroundColor: '#b0b0b0',
  60 + width: width,
  61 + height: thumbHeight,
61 }, 62 },
62 desc: { 63 desc: {
63 color: 'white', 64 color: 'white',
64 // fontFamily: 'SourceHanSansCN Normal', 65 // fontFamily: 'SourceHanSansCN Normal',
65 fontSize: 24, 66 fontSize: 24,
66 - marginTop: 44, 67 + marginTop: 42,
67 textAlign: 'center', 68 textAlign: 'center',
68 backgroundColor: 'transparent', 69 backgroundColor: 'transparent',
69 }, 70 },
@@ -72,7 +73,7 @@ let styles = StyleSheet.create({ @@ -72,7 +73,7 @@ let styles = StyleSheet.create({
72 flexDirection: 'row', 73 flexDirection: 'row',
73 justifyContent: 'space-between', 74 justifyContent: 'space-between',
74 alignItems: 'center', 75 alignItems: 'center',
75 - marginTop: 15, 76 + marginTop: 18,
76 marginBottom: 44, 77 marginBottom: 44,
77 }, 78 },
78 content: { 79 content: {
@@ -106,7 +106,7 @@ export default class UserThatNotMe extends React.Component { @@ -106,7 +106,7 @@ export default class UserThatNotMe extends React.Component {
106 _renderSectionHeader(sectionData, sectionID) { 106 _renderSectionHeader(sectionData, sectionID) {
107 switch (sectionID) { 107 switch (sectionID) {
108 case 'posts': 108 case 'posts':
109 - if (this.props.endReached && this.props.posts.size == 0) { 109 + if (this.props.posts.size == 0) {
110 return null; 110 return null;
111 } 111 }
112 112
@@ -179,5 +179,6 @@ export default keyMirror({ @@ -179,5 +179,6 @@ export default keyMirror({
179 MESSAGE_INFO_REQUEST: null, 179 MESSAGE_INFO_REQUEST: null,
180 MESSAGE_INFO_SUCCESS: null, 180 MESSAGE_INFO_SUCCESS: null,
181 MESSAGE_INFO_FAILURE: null, 181 MESSAGE_INFO_FAILURE: null,
  182 + MESSAGE_CLEAN: null,
182 183
183 }); 184 });
@@ -104,7 +104,6 @@ class HomeContainer extends React.Component { @@ -104,7 +104,6 @@ class HomeContainer extends React.Component {
104 (reminder) => { 104 (reminder) => {
105 let uid = reminder.uid; 105 let uid = reminder.uid;
106 this.props.actions.setUid(uid); 106 this.props.actions.setUid(uid);
107 - this.props.actions.syncUserWithSSOUid(uid);  
108 this.triggerPullToRefresh(); 107 this.triggerPullToRefresh();
109 } 108 }
110 ); 109 );
@@ -120,9 +119,7 @@ class HomeContainer extends React.Component { @@ -120,9 +119,7 @@ class HomeContainer extends React.Component {
120 } 119 }
121 120
122 componentDidMount() { 121 componentDidMount() {
123 - InteractionManager.runAfterInteractions(() => {  
124 - this.props.actions.syncUserInfo(false);  
125 - }); 122 +
126 } 123 }
127 124
128 componentWillUnmount() { 125 componentWillUnmount() {
@@ -172,6 +169,10 @@ class HomeContainer extends React.Component { @@ -172,6 +169,10 @@ class HomeContainer extends React.Component {
172 169
173 _onRefresh() { 170 _onRefresh() {
174 InteractionManager.runAfterInteractions(() => { 171 InteractionManager.runAfterInteractions(() => {
  172 + let uid = this.props.user.profile.uid;
  173 + if (uid) {
  174 + this.props.actions.syncUserWithSSOUid(uid);
  175 + }
175 this.props.actions.bannerNoticeSection(); 176 this.props.actions.bannerNoticeSection();
176 this.props.actions.recommendation(true); 177 this.props.actions.recommendation(true);
177 }); 178 });
@@ -60,6 +60,9 @@ class MessageCenterContainer extends React.Component { @@ -60,6 +60,9 @@ class MessageCenterContainer extends React.Component {
60 this._onPressSystemCell = this._onPressSystemCell.bind(this); 60 this._onPressSystemCell = this._onPressSystemCell.bind(this);
61 } 61 }
62 62
  63 + componentWillUnmount() {
  64 + this.props.actions.messageClean();
  65 + }
63 66
64 _onPressAvatar(uid) { 67 _onPressAvatar(uid) {
65 this.props.actions.goToUserThatNotMe(uid); 68 this.props.actions.goToUserThatNotMe(uid);
@@ -204,19 +204,6 @@ export function recommendation(ptr = false) { @@ -204,19 +204,6 @@ export function recommendation(ptr = false) {
204 }; 204 };
205 } 205 }
206 206
207 -export function increaseErrorCount(number) {  
208 - return {  
209 - type: INCREASE_ERROR_COUNT,  
210 - payload: number,  
211 - };  
212 -}  
213 -  
214 -export function resetErrorCount() {  
215 - return {  
216 - type: RESET_ERROR_COUNT,  
217 - };  
218 -}  
219 -  
220 function parseBNS(json) { 207 function parseBNS(json) {
221 let {resourceList, forumInfo} = json; 208 let {resourceList, forumInfo} = json;
222 let {advertList, textNoticeList} = resourceList; 209 let {advertList, textNoticeList} = resourceList;
@@ -21,12 +21,19 @@ const { @@ -21,12 +21,19 @@ const {
21 MESSAGE_SYST_REQUEST, 21 MESSAGE_SYST_REQUEST,
22 MESSAGE_SYST_SUCCESS, 22 MESSAGE_SYST_SUCCESS,
23 MESSAGE_SYST_FAILURE, 23 MESSAGE_SYST_FAILURE,
  24 + MESSAGE_CLEAN,
24 25
25 } = require('../../constants/actionTypes').default; 26 } = require('../../constants/actionTypes').default;
26 27
27 28
28 const LIMIT = 10; 29 const LIMIT = 10;
29 30
  31 +export function messageClean() {
  32 + return {
  33 + type: MESSAGE_CLEAN,
  34 + };
  35 +}
  36 +
30 export function likeMessageRequest(ptr) { 37 export function likeMessageRequest(ptr) {
31 return { 38 return {
32 39
@@ -19,7 +19,7 @@ const { @@ -19,7 +19,7 @@ const {
19 MESSAGE_SYST_SUCCESS, 19 MESSAGE_SYST_SUCCESS,
20 MESSAGE_SYST_FAILURE, 20 MESSAGE_SYST_FAILURE,
21 USER_DID_LOGOUT, 21 USER_DID_LOGOUT,
22 - 22 + MESSAGE_CLEAN,
23 23
24 } = require('../../constants/actionTypes').default; 24 } = require('../../constants/actionTypes').default;
25 25
@@ -31,6 +31,7 @@ export default function message(state = initialState, action) { @@ -31,6 +31,7 @@ export default function message(state = initialState, action) {
31 31
32 switch (action.type) { 32 switch (action.type) {
33 case USER_DID_LOGOUT: 33 case USER_DID_LOGOUT:
  34 + case MESSAGE_CLEAN:
34 return initialState; 35 return initialState;
35 break; 36 break;
36 case GO_TO_SYS_MESSAGE: { 37 case GO_TO_SYS_MESSAGE: {
  1 +'use strict';
  2 +
  3 +export default function hasEmoji(string) {
  4 + if (!string.length) {
  5 + return false;
  6 + }
  7 +
  8 + let emojiRegex = /(?:0\u20E3|1\u20E3|2\u20E3|3\u20E3|4\u20E3|5\u20E3|6\u20E3|7\u20E3|8\u20E3|9\u20E3|#\u20E3|\*\u20E3|\uD83C(?:\uDDE6\uD83C(?:\uDDE8|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDEE|\uDDF1|\uDDF2|\uDDF4|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFC|\uDDFD|\uDDFF)|\uDDE7\uD83C(?:\uDDE6|\uDDE7|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDEE|\uDDEF|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFB|\uDDFC|\uDDFE|\uDDFF)|\uDDE8\uD83C(?:\uDDE6|\uDDE8|\uDDE9|\uDDEB|\uDDEC|\uDDED|\uDDEE|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF5|\uDDF7|\uDDFA|\uDDFB|\uDDFC|\uDDFD|\uDDFE|\uDDFF)|\uDDE9\uD83C(?:\uDDEA|\uDDEC|\uDDEF|\uDDF0|\uDDF2|\uDDF4|\uDDFF)|\uDDEA\uD83C(?:\uDDE6|\uDDE8|\uDDEA|\uDDEC|\uDDED|\uDDF7|\uDDF8|\uDDF9|\uDDFA)|\uDDEB\uD83C(?:\uDDEE|\uDDEF|\uDDF0|\uDDF2|\uDDF4|\uDDF7)|\uDDEC\uD83C(?:\uDDE6|\uDDE7|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDEE|\uDDF1|\uDDF2|\uDDF3|\uDDF5|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFC|\uDDFE)|\uDDED\uD83C(?:\uDDF0|\uDDF2|\uDDF3|\uDDF7|\uDDF9|\uDDFA)|\uDDEE\uD83C(?:\uDDE8|\uDDE9|\uDDEA|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF6|\uDDF7|\uDDF8|\uDDF9)|\uDDEF\uD83C(?:\uDDEA|\uDDF2|\uDDF4|\uDDF5)|\uDDF0\uD83C(?:\uDDEA|\uDDEC|\uDDED|\uDDEE|\uDDF2|\uDDF3|\uDDF5|\uDDF7|\uDDFC|\uDDFE|\uDDFF)|\uDDF1\uD83C(?:\uDDE6|\uDDE7|\uDDE8|\uDDEE|\uDDF0|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFB|\uDDFE)|\uDDF2\uD83C(?:\uDDE6|\uDDE8|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF5|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFB|\uDDFC|\uDDFD|\uDDFE|\uDDFF)|\uDDF3\uD83C(?:\uDDE6|\uDDE8|\uDDEA|\uDDEB|\uDDEC|\uDDEE|\uDDF1|\uDDF4|\uDDF5|\uDDF7|\uDDFA|\uDDFF)|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C(?:\uDDE6|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF7|\uDDF8|\uDDF9|\uDDFC|\uDDFE)|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C(?:\uDDEA|\uDDF4|\uDDF8|\uDDFA|\uDDFC)|\uDDF8\uD83C(?:\uDDE6|\uDDE7|\uDDE8|\uDDE9|\uDDEA|\uDDEC|\uDDED|\uDDEE|\uDDEF|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF7|\uDDF8|\uDDF9|\uDDFB|\uDDFD|\uDDFE|\uDDFF)|\uDDF9\uD83C(?:\uDDE6|\uDDE8|\uDDE9|\uDDEB|\uDDEC|\uDDED|\uDDEF|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF7|\uDDF9|\uDDFB|\uDDFC|\uDDFF)|\uDDFA\uD83C(?:\uDDE6|\uDDEC|\uDDF2|\uDDF8|\uDDFE|\uDDFF)|\uDDFB\uD83C(?:\uDDE6|\uDDE8|\uDDEA|\uDDEC|\uDDEE|\uDDF3|\uDDFA)|\uDDFC\uD83C(?:\uDDEB|\uDDF8)|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C(?:\uDDEA|\uDDF9)|\uDDFF\uD83C(?:\uDDE6|\uDDF2|\uDDFC)))|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2694\u2696\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD79\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED0\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3]|\uD83E[\uDD10-\uDD18\uDD80-\uDD84\uDDC0]/g;
  9 + if (string.match(emojiRegex)) {
  10 + return true;
  11 + } else {
  12 + return false;
  13 + }
  14 +}