fix: Emoji in title positioning (#2927)

* wip

* fix measure on first render

* wip

* refactor

* tsc

* remove fragment

* refactor (again)

* cleanup
This commit is contained in:
Tom Moor
2022-01-16 17:02:33 -08:00
committed by GitHub
parent 5abc73fabc
commit d0e7f2de65
8 changed files with 40 additions and 30 deletions

View File

@@ -14,7 +14,7 @@ export default function parseTitle(text = "") {
// find and extract first emoji
const matches = regex.exec(title);
const firstEmoji = matches ? matches[0] : null;
const startsWithEmoji = firstEmoji && title.startsWith(firstEmoji);
const startsWithEmoji = firstEmoji && title.startsWith(`${firstEmoji} `);
const emoji = startsWithEmoji ? firstEmoji : undefined;
return {