mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Emoji handling nested (#5609)

authored by

Eric Bailey and committed by
GitHub
d17da847 00486e94

+38 -26
+19 -12
src/components/Typography.tsx
··· 53 53 ) 54 54 } 55 55 56 - export function renderChildrenWithEmoji(children: StringChild) { 56 + export function renderChildrenWithEmoji( 57 + children: StringChild, 58 + props: Omit<TextProps, 'children'> = {}, 59 + ) { 57 60 const normalized = Array.isArray(children) ? children : [children] 58 61 59 62 return ( 60 - <UITextView> 63 + <UITextView {...props}> 61 64 {normalized.map(child => { 62 65 if (typeof child !== 'string') return child 63 66 ··· 68 71 } 69 72 70 73 return child.split(EMOJI).map((stringPart, index) => ( 71 - <UITextView key={index}> 74 + <UITextView key={index} {...props}> 72 75 {stringPart} 73 76 {emojis[index] ? ( 74 - <UITextView style={{color: 'black', fontFamily: 'System'}}> 77 + <UITextView 78 + {...props} 79 + style={[props?.style, {color: 'black', fontFamily: 'System'}]}> 75 80 {emojis[index]} 76 81 </UITextView> 77 82 ) : null} ··· 163 168 } 164 169 } 165 170 171 + const shared = { 172 + uiTextView: true, 173 + selectable, 174 + style: s, 175 + dataSet: Object.assign({tooltip: title}, dataSet || {}), 176 + ...rest, 177 + } 178 + 166 179 return ( 167 - <UITextView 168 - selectable={selectable} 169 - uiTextView 170 - style={s} 171 - {...rest} 172 - // @ts-ignore 173 - dataSet={Object.assign({tooltip: title}, dataSet || {})}> 174 - {isIOS && emoji ? renderChildrenWithEmoji(children) : children} 180 + <UITextView {...shared}> 181 + {isIOS && emoji ? renderChildrenWithEmoji(children, shared) : children} 175 182 </UITextView> 176 183 ) 177 184 }
+1 -1
src/view/com/util/ViewHeader.tsx
··· 100 100 </TouchableOpacity> 101 101 ) : null} 102 102 <View style={styles.titleContainer} pointerEvents="none"> 103 - <Text type="title" style={[pal.text, styles.title]}> 103 + <Text emoji type="title" style={[pal.text, styles.title]}> 104 104 {title} 105 105 </Text> 106 106 </View>
+18 -13
src/view/com/util/text/Text.tsx
··· 77 77 flattened.fontSize = flattened.fontSize * fonts.scaleMultiplier 78 78 } 79 79 80 + const shared = { 81 + uiTextView: true, 82 + selectable, 83 + style: flattened, 84 + ...props, 85 + } 86 + 80 87 return ( 81 - <UITextView 82 - style={flattened} 83 - selectable={selectable} 84 - uiTextView 85 - {...props}> 86 - {isIOS && emoji ? renderChildrenWithEmoji(children) : children} 88 + <UITextView {...shared}> 89 + {isIOS && emoji ? renderChildrenWithEmoji(children, shared) : children} 87 90 </UITextView> 88 91 ) 89 92 } ··· 104 107 flattened.fontSize = flattened.fontSize * fonts.scaleMultiplier 105 108 } 106 109 110 + const shared = { 111 + selectable, 112 + style: flattened, 113 + dataSet: Object.assign({tooltip: title}, dataSet || {}), 114 + ...props, 115 + } 116 + 107 117 return ( 108 - <RNText 109 - style={flattened} 110 - // @ts-ignore web only -esb 111 - dataSet={Object.assign({tooltip: title}, dataSet || {})} 112 - selectable={selectable} 113 - {...props}> 114 - {isIOS && emoji ? renderChildrenWithEmoji(children) : children} 118 + <RNText {...shared}> 119 + {isIOS && emoji ? renderChildrenWithEmoji(children, shared) : children} 115 120 </RNText> 116 121 ) 117 122 }