chore: Remove dependency on twemoji
This commit is contained in:
@@ -19,12 +19,16 @@ const PageTitle = ({ title, favicon }: Props) => {
|
|||||||
<title>
|
<title>
|
||||||
{team && team.name ? `${title} - ${team.name}` : `${title} - Outline`}
|
{team && team.name ? `${title} - ${team.name}` : `${title} - Outline`}
|
||||||
</title>
|
</title>
|
||||||
<link
|
{favicon ? (
|
||||||
rel="shortcut icon"
|
<link rel="shortcut icon" href={favicon} />
|
||||||
type="image/png"
|
) : (
|
||||||
href={favicon || cdnPath("/favicon-32.png")}
|
<link
|
||||||
sizes="32x32"
|
rel="shortcut icon"
|
||||||
/>
|
type="image/png"
|
||||||
|
href={cdnPath("/favicon-32.png")}
|
||||||
|
sizes="32x32"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
</Helmet>
|
</Helmet>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,23 +1,5 @@
|
|||||||
// @flow
|
// @flow
|
||||||
export function toCodePoint(unicodeSurrogates: string, sep: ?string) {
|
|
||||||
var r = [],
|
|
||||||
c = 0,
|
|
||||||
p = 0,
|
|
||||||
i = 0;
|
|
||||||
while (i < unicodeSurrogates.length) {
|
|
||||||
c = unicodeSurrogates.charCodeAt(i++);
|
|
||||||
if (p) {
|
|
||||||
r.push((0x10000 + ((p - 0xd800) << 10) + (c - 0xdc00)).toString(16));
|
|
||||||
p = 0;
|
|
||||||
} else if (0xd800 <= c && c <= 0xdbff) {
|
|
||||||
p = c;
|
|
||||||
} else {
|
|
||||||
r.push(c.toString(16));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return r.join(sep || "-");
|
|
||||||
}
|
|
||||||
|
|
||||||
export function emojiToUrl(text: string) {
|
export function emojiToUrl(text: string) {
|
||||||
return `https://twemoji.maxcdn.com/2/72x72/${toCodePoint(text)}.png`;
|
return `data:image/svg+xml;data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>${text}</text></svg>`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user