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:
4
shared/typings/index.d.ts
vendored
4
shared/typings/index.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
declare module "emoji-regex" {
|
||||
const RegExpFactory: () => RegExp;
|
||||
export = RegExpFactory;
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user