= 2 same shortcodes
+ alt={word}
/>
);
}
+
return word;
});
+
return elements;
}
-export default mem(EmojiText);
-
-// export default memo(
-// EmojiText,
-// (oldProps, newProps) =>
-// oldProps.text === newProps.text &&
-// oldProps.emojis?.length === newProps.emojis?.length,
-// );
+export default EmojiText;
diff --git a/src/components/name-text.jsx b/src/components/name-text.jsx
index c34eddc3..b7bfcfae 100644
--- a/src/components/name-text.jsx
+++ b/src/components/name-text.jsx
@@ -1,10 +1,8 @@
import './name-text.css';
import { useLingui } from '@lingui/react';
-import { memo } from 'preact/compat';
import { api } from '../utils/api';
-import getDomain from '../utils/get-domain';
import mem from '../utils/mem';
import states from '../utils/states';
@@ -55,8 +53,6 @@ function NameText({
if (!instance) instance = api().instance;
- const accountInstance = getDomain(url);
-
const trimmedUsername = username.toLowerCase().trim();
const trimmedDisplayName = (displayName || '').toLowerCase().trim();
const shortenedDisplayName = trimmedDisplayName
@@ -113,7 +109,12 @@ function NameText({
{displayName && !short ? (
<>
-
+
{!showAcct && !hideUsername && (
<>
@@ -148,11 +149,4 @@ function NameText({
);
}
-export default mem(NameText);
-
-// export default memo(NameText, (oldProps, newProps) => {
-// // Only care about account.id, the other props usually don't change
-// const { account } = oldProps;
-// const { account: newAccount } = newProps;
-// return account?.acct === newAccount?.acct;
-// });
+export default NameText;
diff --git a/src/locales/en.po b/src/locales/en.po
index b526b85c..e6442fd2 100644
--- a/src/locales/en.po
+++ b/src/locales/en.po
@@ -13,62 +13,62 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"
-#: src/components/account-block.jsx:139
+#: src/components/account-block.jsx:143
msgid "Locked"
msgstr ""
#. placeholder {0}: shortenNumber(statusesCount)
-#: src/components/account-block.jsx:146
+#: src/components/account-block.jsx:150
msgid "Posts: {0}"
msgstr ""
#. placeholder {0}: niceDateTime(lastStatusAt, { hideTime: true, })
-#: src/components/account-block.jsx:151
+#: src/components/account-block.jsx:155
msgid "Last posted: {0}"
msgstr ""
-#: src/components/account-block.jsx:166
+#: src/components/account-block.jsx:170
#: src/components/account-info.jsx:678
msgid "Automated"
msgstr ""
-#: src/components/account-block.jsx:173
+#: src/components/account-block.jsx:177
#: src/components/account-info.jsx:683
#: src/components/status.jsx:569
msgid "Group"
msgstr ""
-#: src/components/account-block.jsx:183
+#: src/components/account-block.jsx:187
msgid "Mutual"
msgstr ""
-#: src/components/account-block.jsx:187
+#: src/components/account-block.jsx:191
#: src/components/related-actions.jsx:882
msgid "Requested"
msgstr ""
-#: src/components/account-block.jsx:191
+#: src/components/account-block.jsx:195
#: src/components/related-actions.jsx:873
msgid "Following"
msgstr ""
-#: src/components/account-block.jsx:195
+#: src/components/account-block.jsx:199
#: src/components/related-actions.jsx:182
msgid "Follows you"
msgstr ""
-#: src/components/account-block.jsx:203
+#: src/components/account-block.jsx:207
msgid "{followersCount, plural, one {# follower} other {# followers}}"
msgstr ""
-#: src/components/account-block.jsx:212
+#: src/components/account-block.jsx:216
#: src/components/account-info.jsx:726
msgid "Verified"
msgstr ""
#. placeholder {0}: niceDateTime(createdAt, { hideTime: true, })
#. placeholder {0}: niceDateTime(createdAt, { hideTime: true, })
-#: src/components/account-block.jsx:227
+#: src/components/account-block.jsx:231
#: src/components/account-info.jsx:865
msgid "Joined <0>{0}0>"
msgstr ""
@@ -120,7 +120,7 @@ msgstr ""
#: src/components/status.jsx:2267
#: src/components/status.jsx:2955
#: src/components/status.jsx:2958
-#: src/pages/account-statuses.jsx:540
+#: src/pages/account-statuses.jsx:544
#: src/pages/accounts.jsx:118
#: src/pages/hashtag.jsx:203
#: src/pages/list.jsx:171
@@ -2958,31 +2958,31 @@ msgstr ""
msgid "Showing posts in {0}"
msgstr "Showing posts in {0}"
-#: src/pages/account-statuses.jsx:517
+#: src/pages/account-statuses.jsx:521
msgid "Nothing to see here yet."
msgstr ""
-#: src/pages/account-statuses.jsx:518
+#: src/pages/account-statuses.jsx:522
#: src/pages/public.jsx:99
#: src/pages/trending.jsx:452
msgid "Unable to load posts"
msgstr ""
-#: src/pages/account-statuses.jsx:559
-#: src/pages/account-statuses.jsx:589
+#: src/pages/account-statuses.jsx:563
+#: src/pages/account-statuses.jsx:593
msgid "Unable to fetch account info"
msgstr ""
#. placeholder {0}: accountInstance ? ( <> {' '} ({punycode.toUnicode(accountInstance)}) > ) : null
-#: src/pages/account-statuses.jsx:566
+#: src/pages/account-statuses.jsx:570
msgid "Switch to account's instance {0}"
msgstr ""
-#: src/pages/account-statuses.jsx:596
+#: src/pages/account-statuses.jsx:600
msgid "Switch to my instance (<0>{currentInstance}0>)"
msgstr ""
-#: src/pages/account-statuses.jsx:669
+#: src/pages/account-statuses.jsx:673
msgid "Month"
msgstr ""
diff --git a/src/pages/account-statuses.jsx b/src/pages/account-statuses.jsx
index eae4c753..1f38a1a3 100644
--- a/src/pages/account-statuses.jsx
+++ b/src/pages/account-statuses.jsx
@@ -505,7 +505,11 @@ function AccountStatuses() {
// }}
>
-
+
@{acct}
diff --git a/src/utils/get-gif-first-frame.js b/src/utils/get-gif-first-frame.js
new file mode 100644
index 00000000..da4ed4d0
--- /dev/null
+++ b/src/utils/get-gif-first-frame.js
@@ -0,0 +1,24 @@
+import GIFrame from 'giframe';
+
+export async function getGifFirstFrame(gifUrl) {
+ try {
+ const giframe = new GIFrame(0, {
+ usePNG: true,
+ });
+ const base64Promise = giframe.getBase64();
+
+ const response = await fetch(gifUrl);
+ const buf = await response.arrayBuffer();
+ giframe.feed(new Uint8Array(buf));
+
+ const base64 = await base64Promise;
+ // Convert data URI to blob
+ // More memory-efficient if same image is rendered multiple times
+ const blob = await (await fetch(base64)).blob();
+ const staticUrl = URL.createObjectURL(blob);
+ return staticUrl;
+ } catch (e) {
+ // Fail silently if giframe fails
+ return null;
+ }
+}