Skip to content

Commit 436845e

Browse files
authored
react button again (#28892)
1 parent 2c09530 commit 436845e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,5 @@ go/keybase_netbsd
8787
go/keybase_openbsd
8888

8989
.cursor
90+
.claude
91+
CLAUDE.md

shared/chat/conversation/messages/react-button.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ const ReactButtonContainer = React.memo(function ReactButtonContainer(p: OwnProp
109109
const markdownOverride: StyleOverride = Kb.Styles.isMobile
110110
? {
111111
customEmoji: {
112-
height: 24,
113-
transform: [{translateY: C.isAndroid ? 0 : 3.5}],
114-
width: 24,
112+
height: 20,
113+
transform: [{translateY: 4}],
114+
width: 20,
115115
},
116116
emoji: {
117-
lineHeight: C.isAndroid ? 26 : 28.5,
117+
fontSize: 15,
118118
},
119119
emojiSize: {size: 24},
120+
paragraph: C.isAndroid ? ({height: 28, textAlignVertical: 'center'} as StyleOverride['paragraph']) : {},
120121
}
121122
: {
122123
customEmoji: {height: 18, width: 18},

shared/common-adapters/emoji/native-emoji.native.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@ import Text from '../text'
66

77
import type {Props} from './native-emoji'
88

9-
const familyOverride = isAndroid ? {fontFamily: ''} : {}
10-
119
const sizes = [16, 18, 22, 24, 26, 28, 32, 36] as const
1210
const sizeStyle = new Map<(typeof sizes)[number], Styles.StylesCrossPlatform>(
13-
sizes.map(size => [size, {fontSize: size - 2, lineHeight: undefined, ...familyOverride}])
11+
sizes.map(size => [size, {fontSize: size - 2, lineHeight: undefined}])
1412
)
1513

14+
// Android fails to paint emoji glyphs in mixed-content Text nodes when the
15+
// variant selector (VS16 / U+FE0F) is appended to codepoints that already
16+
// have Emoji_Presentation. iOS and desktop handle it fine.
17+
const emojiVariantSuffix = isAndroid ? '' : '\ufe0f'
18+
1619
const EmojiWrapper = React.memo(function EmojiWrapper(props: Props) {
1720
const {emojiName, size} = props
18-
const emojiVariantSuffix = '\ufe0f' // see http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/
1921
return (
2022
<Text
2123
type="Body"
22-
style={Styles.collapseStyles([sizeStyle.get(size), props.style])} // Mobile emoji need to be smaller with Proxima Nova
24+
style={Styles.collapseStyles([sizeStyle.get(size), props.style])}
2325
allowFontScaling={props.allowFontScaling}
2426
>
2527
{emojiIndexByName[emojiName] ? emojiIndexByName[emojiName] + emojiVariantSuffix : emojiName}

0 commit comments

Comments
 (0)