Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Enable tags inside of quotes (#3041)

* enable tags for quote posts

* mentions too

* just disable pointer events instead

* apply fix for both web and native

* minimize diff

authored by

Hailey and committed by
GitHub
f016cdbc e950463f

+22 -25
+18 -24
src/components/RichText.tsx
··· 78 78 const link = segment.link 79 79 const mention = segment.mention 80 80 const tag = segment.tag 81 - if ( 82 - mention && 83 - AppBskyRichtextFacet.validateMention(mention).success && 84 - !disableLinks 85 - ) { 81 + if (mention && AppBskyRichtextFacet.validateMention(mention).success) { 86 82 els.push( 87 83 <InlineLink 88 84 selectable={selectable} 89 85 key={key} 90 86 to={`/profile/${mention.did}`} 91 - style={[...styles, {pointerEvents: 'auto'}]} 87 + style={[...styles, {pointerEvents: disableLinks ? 'none' : 'auto'}]} 92 88 // @ts-ignore TODO 93 89 dataSet={WORD_WRAP}> 94 90 {segment.text} 95 91 </InlineLink>, 96 92 ) 97 93 } else if (link && AppBskyRichtextFacet.validateLink(link).success) { 98 - if (disableLinks) { 99 - els.push(toShortUrl(segment.text)) 100 - } else { 101 - els.push( 102 - <InlineLink 103 - selectable={selectable} 104 - key={key} 105 - to={link.uri} 106 - style={[...styles, {pointerEvents: 'auto'}]} 107 - // @ts-ignore TODO 108 - dataSet={WORD_WRAP}> 109 - {toShortUrl(segment.text)} 110 - </InlineLink>, 111 - ) 112 - } 94 + els.push( 95 + <InlineLink 96 + selectable={selectable} 97 + key={key} 98 + to={link.uri} 99 + style={[...styles, {pointerEvents: disableLinks ? 'none' : 'auto'}]} 100 + // @ts-ignore TODO 101 + dataSet={WORD_WRAP}> 102 + {toShortUrl(segment.text)} 103 + </InlineLink>, 104 + ) 113 105 } else if ( 114 - !disableLinks && 115 106 enableTags && 116 107 tag && 117 108 AppBskyRichtextFacet.validateTag(tag).success ··· 124 115 style={styles} 125 116 selectable={selectable} 126 117 authorHandle={authorHandle} 118 + disableLinks={disableLinks} 127 119 />, 128 120 ) 129 121 } else { ··· 136 128 <Text 137 129 selectable={selectable} 138 130 testID={testID} 139 - style={styles} 131 + style={[styles, {pointerEvents: disableLinks ? 'none' : 'auto'}]} 140 132 numberOfLines={numberOfLines} 141 133 // @ts-ignore web only -prf 142 134 dataSet={WORD_WRAP}> ··· 151 143 style, 152 144 selectable, 153 145 authorHandle, 146 + disableLinks, 154 147 }: { 155 148 text: string 156 149 tag: string 157 150 selectable?: boolean 158 151 authorHandle?: string 152 + disableLinks?: boolean 159 153 } & TextStyleProp) { 160 154 const t = useTheme() 161 155 const {_} = useLingui() ··· 204 198 style={[ 205 199 style, 206 200 { 207 - pointerEvents: 'auto', 201 + pointerEvents: disableLinks ? 'none' : 'auto', 208 202 color: t.palette.primary_500, 209 203 }, 210 204 web({
+4 -1
src/view/com/util/post-embeds/QuoteEmbed.tsx
··· 91 91 const richText = React.useMemo( 92 92 () => 93 93 quote.text.trim() 94 - ? new RichTextAPI({text: quote.text, facets: quote.facets}) 94 + ? new RichTextAPI({ 95 + text: quote.text, 96 + facets: quote.facets, 97 + }) 95 98 : undefined, 96 99 [quote.text, quote.facets], 97 100 )