Run prettier

This commit is contained in:
Stefano Pigozzi 2024-12-09 05:16:05 +01:00
parent 8715c50a3f
commit 299bcf9e91
No known key found for this signature in database
GPG key ID: 5ADA3868646C3FC0
5 changed files with 114 additions and 103 deletions

View file

@ -84,9 +84,10 @@ function NavMenu(props) {
const results = await blocksIterator.current.next();
return results;
}
const hasBubbleTimeline = supports("@akkoma/bubble-timeline") || supports("@chuckya/bubble-timeline");
const hasBubbleTimeline =
supports('@akkoma/bubble-timeline') || supports('@chuckya/bubble-timeline');
const buttonClickTS = useRef();
return (
<>

View file

@ -167,7 +167,7 @@ export const SHORTCUTS_META = {
local: t`Local`,
bubble: t`Bubble`,
federated: t`Federated`,
}[variant]),
})[variant],
subtitle: ({ instance }) => instance || api().instance,
path: ({ variant, instance }) => {
const suffix = {
@ -182,7 +182,7 @@ export const SHORTCUTS_META = {
local: 'building',
bubble: 'star2',
federated: 'earth',
}[variant]),
})[variant],
},
trending: {
id: 'trending',
@ -681,7 +681,7 @@ function ShortcutForm({
</p>
);
}
if (type === 'variant') {
return (
<p>
@ -696,15 +696,21 @@ function ShortcutForm({
defaultValue={editMode ? shortcut.variant : 'local'}
dir="auto"
>
<option value="local"><Trans>Local</Trans></option>
<option value="bubble"><Trans>Bubble</Trans></option>
<option value="federated"><Trans>Federated</Trans></option>
<option value="local">
<Trans>Local</Trans>
</option>
<option value="bubble">
<Trans>Bubble</Trans>
</option>
<option value="federated">
<Trans>Federated</Trans>
</option>
</select>
</label>
</p>
);
}
return (
<p>
<label>

170
src/locales/en.po generated
View file

@ -116,7 +116,7 @@ msgstr ""
#: src/pages/accounts.jsx:109
#: src/pages/hashtag.jsx:199
#: src/pages/list.jsx:157
#: src/pages/public.jsx:132
#: src/pages/public.jsx:134
#: src/pages/status.jsx:1212
#: src/pages/trending.jsx:471
msgid "More"
@ -286,14 +286,14 @@ msgid "Unable to copy link"
msgstr ""
#: src/components/account-info.jsx:1313
#: src/components/shortcuts-settings.jsx:1099
#: src/components/shortcuts-settings.jsx:1105
#: src/components/status.jsx:1186
#: src/components/status.jsx:3267
msgid "Copy"
msgstr ""
#: src/components/account-info.jsx:1328
#: src/components/shortcuts-settings.jsx:1117
#: src/components/shortcuts-settings.jsx:1123
#: src/components/status.jsx:1202
msgid "Sharing doesn't seem to work."
msgstr ""
@ -415,7 +415,7 @@ msgstr ""
#: src/components/report-modal.jsx:75
#: src/components/shortcuts-settings.jsx:247
#: src/components/shortcuts-settings.jsx:600
#: src/components/shortcuts-settings.jsx:823
#: src/components/shortcuts-settings.jsx:829
#: src/components/status.jsx:2992
#: src/components/status.jsx:3231
#: src/components/status.jsx:3731
@ -501,7 +501,7 @@ msgstr ""
#: src/components/account-info.jsx:2225
#: src/components/list-add-edit.jsx:149
#: src/components/shortcuts-settings.jsx:755
#: src/components/shortcuts-settings.jsx:761
#: src/pages/filters.jsx:554
#: src/pages/notifications.jsx:981
msgid "Save"
@ -524,7 +524,7 @@ msgid "Cloak mode enabled"
msgstr ""
#: src/components/columns.jsx:26
#: src/components/nav-menu.jsx:177
#: src/components/nav-menu.jsx:178
#: src/components/shortcuts-settings.jsx:139
#: src/components/timeline.jsx:437
#: src/pages/catchup.jsx:876
@ -640,9 +640,9 @@ msgid "Public"
msgstr ""
#: src/components/compose.jsx:1237
#: src/components/nav-menu.jsx:339
#: src/components/nav-menu.jsx:340
#: src/components/shortcuts-settings.jsx:167
#: src/components/shortcuts-settings.jsx:699
#: src/components/shortcuts-settings.jsx:700
#: src/components/status.jsx:94
msgid "Local"
msgstr ""
@ -683,7 +683,7 @@ msgstr ""
#: src/components/compose.jsx:1381
#: src/components/compose.jsx:3078
#: src/components/shortcuts-settings.jsx:755
#: src/components/shortcuts-settings.jsx:761
#: src/pages/list.jsx:359
msgid "Add"
msgstr ""
@ -716,7 +716,7 @@ msgstr ""
#: src/components/compose.jsx:1878
#: src/components/compose.jsx:1955
#: src/components/nav-menu.jsx:240
#: src/components/nav-menu.jsx:241
msgid "More…"
msgstr ""
@ -752,7 +752,7 @@ msgstr ""
#: src/components/compose.jsx:2511
#: src/components/compose.jsx:2761
#: src/components/shortcuts-settings.jsx:766
#: src/components/shortcuts-settings.jsx:772
#: src/pages/catchup.jsx:1074
#: src/pages/filters.jsx:412
msgid "Remove"
@ -987,7 +987,7 @@ msgid "The end."
msgstr ""
#: src/components/keyboard-shortcuts-help.jsx:43
#: src/components/nav-menu.jsx:366
#: src/components/nav-menu.jsx:367
#: src/pages/catchup.jsx:1619
msgid "Keyboard shortcuts"
msgstr ""
@ -1084,7 +1084,7 @@ msgid "<0>Ctrl</0> + <1>Enter</1> or <2>⌘</2> + <3>Enter</3>"
msgstr ""
#: src/components/keyboard-shortcuts-help.jsx:147
#: src/components/nav-menu.jsx:327
#: src/components/nav-menu.jsx:328
#: src/components/search-form.jsx:72
#: src/components/shortcuts-settings.jsx:52
#: src/components/shortcuts-settings.jsx:196
@ -1249,32 +1249,32 @@ msgstr ""
msgid "Post updated. Check it out."
msgstr ""
#: src/components/nav-menu.jsx:119
#: src/components/nav-menu.jsx:120
msgid "Menu"
msgstr ""
#: src/components/nav-menu.jsx:155
#: src/components/nav-menu.jsx:156
msgid "Reload page now to update?"
msgstr ""
#: src/components/nav-menu.jsx:167
#: src/components/nav-menu.jsx:168
msgid "New update available…"
msgstr ""
#. js-lingui-explicit-id
#: src/components/nav-menu.jsx:186
#: src/components/nav-menu.jsx:187
#: src/components/shortcuts-settings.jsx:140
#: src/pages/following.jsx:22
#: src/pages/following.jsx:141
msgid "following.title"
msgstr "Following"
#: src/components/nav-menu.jsx:193
#: src/components/nav-menu.jsx:194
#: src/pages/catchup.jsx:871
msgid "Catch-up"
msgstr ""
#: src/components/nav-menu.jsx:200
#: src/components/nav-menu.jsx:201
#: src/components/shortcuts-settings.jsx:58
#: src/components/shortcuts-settings.jsx:146
#: src/pages/home.jsx:224
@ -1285,7 +1285,7 @@ msgstr ""
msgid "Mentions"
msgstr ""
#: src/components/nav-menu.jsx:207
#: src/components/nav-menu.jsx:208
#: src/components/shortcuts-settings.jsx:49
#: src/components/shortcuts-settings.jsx:152
#: src/pages/filters.jsx:24
@ -1296,15 +1296,15 @@ msgstr ""
msgid "Notifications"
msgstr ""
#: src/components/nav-menu.jsx:210
#: src/components/nav-menu.jsx:211
msgid "New"
msgstr ""
#: src/components/nav-menu.jsx:221
#: src/components/nav-menu.jsx:222
msgid "Profile"
msgstr ""
#: src/components/nav-menu.jsx:229
#: src/components/nav-menu.jsx:230
#: src/components/shortcuts-settings.jsx:54
#: src/components/shortcuts-settings.jsx:212
#: src/pages/bookmarks.jsx:11
@ -1312,7 +1312,7 @@ msgstr ""
msgid "Bookmarks"
msgstr ""
#: src/components/nav-menu.jsx:249
#: src/components/nav-menu.jsx:250
#: src/components/shortcuts-settings.jsx:55
#: src/components/shortcuts-settings.jsx:218
#: src/pages/catchup.jsx:1446
@ -1323,13 +1323,13 @@ msgstr ""
msgid "Likes"
msgstr ""
#: src/components/nav-menu.jsx:255
#: src/components/nav-menu.jsx:256
#: src/pages/followed-hashtags.jsx:14
#: src/pages/followed-hashtags.jsx:44
msgid "Followed Hashtags"
msgstr ""
#: src/components/nav-menu.jsx:263
#: src/components/nav-menu.jsx:264
#: src/pages/account-statuses.jsx:331
#: src/pages/filters.jsx:54
#: src/pages/filters.jsx:93
@ -1337,63 +1337,63 @@ msgstr ""
msgid "Filters"
msgstr ""
#: src/components/nav-menu.jsx:271
#: src/components/nav-menu.jsx:272
msgid "Muted users"
msgstr ""
#: src/components/nav-menu.jsx:279
#: src/components/nav-menu.jsx:280
msgid "Muted users…"
msgstr ""
#: src/components/nav-menu.jsx:286
#: src/components/nav-menu.jsx:287
msgid "Blocked users"
msgstr ""
#: src/components/nav-menu.jsx:294
#: src/components/nav-menu.jsx:295
msgid "Blocked users…"
msgstr ""
#: src/components/nav-menu.jsx:306
#: src/components/nav-menu.jsx:307
msgid "Accounts…"
msgstr ""
#: src/components/nav-menu.jsx:316
#: src/components/nav-menu.jsx:317
#: src/pages/login.jsx:189
#: src/pages/status.jsx:835
#: src/pages/welcome.jsx:64
msgid "Log in"
msgstr ""
#: src/components/nav-menu.jsx:333
#: src/components/nav-menu.jsx:334
#: src/components/shortcuts-settings.jsx:57
#: src/components/shortcuts-settings.jsx:189
#: src/pages/trending.jsx:441
msgid "Trending"
msgstr ""
#: src/components/nav-menu.jsx:346
#: src/components/nav-menu.jsx:347
#: src/components/shortcuts-settings.jsx:168
#: src/components/shortcuts-settings.jsx:700
#: src/components/shortcuts-settings.jsx:703
msgid "Bubble"
msgstr "Bubble"
#: src/components/nav-menu.jsx:353
#: src/components/nav-menu.jsx:354
#: src/components/shortcuts-settings.jsx:169
#: src/components/shortcuts-settings.jsx:701
#: src/components/shortcuts-settings.jsx:706
msgid "Federated"
msgstr ""
#: src/components/nav-menu.jsx:376
#: src/components/nav-menu.jsx:377
msgid "Shortcuts / Columns…"
msgstr ""
#: src/components/nav-menu.jsx:386
#: src/components/nav-menu.jsx:400
#: src/components/nav-menu.jsx:387
#: src/components/nav-menu.jsx:401
msgid "Settings…"
msgstr ""
#: src/components/nav-menu.jsx:430
#: src/components/nav-menu.jsx:457
#: src/components/nav-menu.jsx:431
#: src/components/nav-menu.jsx:458
#: src/components/shortcuts-settings.jsx:50
#: src/components/shortcuts-settings.jsx:158
#: src/pages/list.jsx:126
@ -1402,7 +1402,7 @@ msgstr ""
msgid "Lists"
msgstr ""
#: src/components/nav-menu.jsx:438
#: src/components/nav-menu.jsx:439
#: src/components/shortcuts.jsx:215
#: src/pages/list.jsx:133
msgid "All Lists"
@ -1919,132 +1919,132 @@ msgstr ""
msgid "List"
msgstr ""
#: src/components/shortcuts-settings.jsx:828
#: src/components/shortcuts-settings.jsx:834
msgid "Import/Export <0>Shortcuts</0>"
msgstr ""
#: src/components/shortcuts-settings.jsx:838
#: src/components/shortcuts-settings.jsx:844
msgid "Import"
msgstr ""
#: src/components/shortcuts-settings.jsx:846
#: src/components/shortcuts-settings.jsx:852
msgid "Paste shortcuts here"
msgstr ""
#: src/components/shortcuts-settings.jsx:862
#: src/components/shortcuts-settings.jsx:868
msgid "Downloading saved shortcuts from instance server…"
msgstr ""
#: src/components/shortcuts-settings.jsx:891
#: src/components/shortcuts-settings.jsx:897
msgid "Unable to download shortcuts"
msgstr ""
#: src/components/shortcuts-settings.jsx:894
#: src/components/shortcuts-settings.jsx:900
msgid "Download shortcuts from instance server"
msgstr ""
#: src/components/shortcuts-settings.jsx:952
#: src/components/shortcuts-settings.jsx:958
msgid "* Exists in current shortcuts"
msgstr ""
#: src/components/shortcuts-settings.jsx:957
#: src/components/shortcuts-settings.jsx:963
msgid "List may not work if it's from a different account."
msgstr ""
#: src/components/shortcuts-settings.jsx:967
#: src/components/shortcuts-settings.jsx:973
msgid "Invalid settings format"
msgstr ""
#: src/components/shortcuts-settings.jsx:975
#: src/components/shortcuts-settings.jsx:981
msgid "Append to current shortcuts?"
msgstr ""
#: src/components/shortcuts-settings.jsx:978
#: src/components/shortcuts-settings.jsx:984
msgid "Only shortcuts that dont exist in current shortcuts will be appended."
msgstr ""
#: src/components/shortcuts-settings.jsx:1000
#: src/components/shortcuts-settings.jsx:1006
msgid "No new shortcuts to import"
msgstr ""
#: src/components/shortcuts-settings.jsx:1015
#: src/components/shortcuts-settings.jsx:1021
msgid "Shortcuts imported. Exceeded max {SHORTCUTS_LIMIT}, so the rest are not imported."
msgstr ""
#: src/components/shortcuts-settings.jsx:1016
#: src/components/shortcuts-settings.jsx:1040
#: src/components/shortcuts-settings.jsx:1022
#: src/components/shortcuts-settings.jsx:1046
msgid "Shortcuts imported"
msgstr ""
#: src/components/shortcuts-settings.jsx:1026
#: src/components/shortcuts-settings.jsx:1032
msgid "Import & append…"
msgstr ""
#: src/components/shortcuts-settings.jsx:1034
#: src/components/shortcuts-settings.jsx:1040
msgid "Override current shortcuts?"
msgstr ""
#: src/components/shortcuts-settings.jsx:1035
#: src/components/shortcuts-settings.jsx:1041
msgid "Import shortcuts?"
msgstr ""
#: src/components/shortcuts-settings.jsx:1049
#: src/components/shortcuts-settings.jsx:1055
msgid "or override…"
msgstr ""
#: src/components/shortcuts-settings.jsx:1049
#: src/components/shortcuts-settings.jsx:1055
msgid "Import…"
msgstr ""
#: src/components/shortcuts-settings.jsx:1058
#: src/components/shortcuts-settings.jsx:1064
msgid "Export"
msgstr ""
#: src/components/shortcuts-settings.jsx:1073
#: src/components/shortcuts-settings.jsx:1079
msgid "Shortcuts copied"
msgstr ""
#: src/components/shortcuts-settings.jsx:1076
#: src/components/shortcuts-settings.jsx:1082
msgid "Unable to copy shortcuts"
msgstr ""
#: src/components/shortcuts-settings.jsx:1090
#: src/components/shortcuts-settings.jsx:1096
msgid "Shortcut settings copied"
msgstr ""
#: src/components/shortcuts-settings.jsx:1093
#: src/components/shortcuts-settings.jsx:1099
msgid "Unable to copy shortcut settings"
msgstr ""
#: src/components/shortcuts-settings.jsx:1123
#: src/components/shortcuts-settings.jsx:1129
msgid "Share"
msgstr ""
#: src/components/shortcuts-settings.jsx:1162
#: src/components/shortcuts-settings.jsx:1168
msgid "Saving shortcuts to instance server…"
msgstr ""
#: src/components/shortcuts-settings.jsx:1169
#: src/components/shortcuts-settings.jsx:1175
msgid "Shortcuts saved"
msgstr ""
#: src/components/shortcuts-settings.jsx:1174
#: src/components/shortcuts-settings.jsx:1180
msgid "Unable to save shortcuts"
msgstr ""
#: src/components/shortcuts-settings.jsx:1177
#: src/components/shortcuts-settings.jsx:1183
msgid "Sync to instance server"
msgstr ""
#: src/components/shortcuts-settings.jsx:1185
#: src/components/shortcuts-settings.jsx:1191
msgid "{0, plural, one {# character} other {# characters}}"
msgstr ""
#: src/components/shortcuts-settings.jsx:1197
#: src/components/shortcuts-settings.jsx:1203
msgid "Raw Shortcuts JSON"
msgstr ""
#: src/components/shortcuts-settings.jsx:1210
#: src/components/shortcuts-settings.jsx:1216
msgid "Import/export settings from/to instance server (Very experimental)"
msgstr ""
@ -2490,7 +2490,7 @@ msgid "Nothing to see here yet."
msgstr ""
#: src/pages/account-statuses.jsx:506
#: src/pages/public.jsx:115
#: src/pages/public.jsx:117
#: src/pages/trending.jsx:449
msgid "Unable to load posts"
msgstr ""
@ -3050,25 +3050,25 @@ msgid "Add to Shortcuts"
msgstr ""
#: src/pages/hashtag.jsx:486
#: src/pages/public.jsx:164
#: src/pages/public.jsx:166
#: src/pages/trending.jsx:478
msgid "Enter a new instance e.g. \"mastodon.social\""
msgstr ""
#: src/pages/hashtag.jsx:489
#: src/pages/public.jsx:167
#: src/pages/public.jsx:169
#: src/pages/trending.jsx:481
msgid "Invalid instance"
msgstr ""
#: src/pages/hashtag.jsx:503
#: src/pages/public.jsx:181
#: src/pages/public.jsx:183
#: src/pages/trending.jsx:493
msgid "Go to another instance…"
msgstr ""
#: src/pages/hashtag.jsx:516
#: src/pages/public.jsx:194
#: src/pages/public.jsx:196
#: src/pages/trending.jsx:504
msgid "Go to my instance (<0>{currentInstance}</0>)"
msgstr ""
@ -3309,19 +3309,19 @@ msgstr "Bubble timeline"
msgid "Federated timeline"
msgstr ""
#: src/pages/public.jsx:114
#: src/pages/public.jsx:116
msgid "No one has posted anything yet."
msgstr ""
#: src/pages/public.jsx:140
#: src/pages/public.jsx:142
msgid "Switch to Local"
msgstr ""
#: src/pages/public.jsx:148
#: src/pages/public.jsx:150
msgid "Switch to Bubble"
msgstr "Switch to Bubble"
#: src/pages/public.jsx:156
#: src/pages/public.jsx:158
msgid "Switch to Federated"
msgstr ""

View file

@ -39,7 +39,9 @@ function Public({ variant = 'federated', columnMode, ...props }) {
}[variant];
const source = {
local: masto.v1.timelines.public.list,
bubble: supports('@akkoma/bubble-timeline') ? masto.v1.timelines.bubble.list : masto.v1.timelines.public.list,
bubble: supports('@akkoma/bubble-timeline')
? masto.v1.timelines.bubble.list
: masto.v1.timelines.public.list,
federated: masto.v1.timelines.public.list,
}[variant];
@ -53,7 +55,7 @@ function Public({ variant = 'federated', columnMode, ...props }) {
const opts = {
limit: LIMIT,
local: variant === 'local',
bubble: variant === 'bubble' && supports('@chuckya/bubble-timeline')
bubble: variant === 'bubble' && supports('@chuckya/bubble-timeline'),
};
if (variant === 'federated' && supports('@pixelfed/global-feed')) {
opts.remote = true;

View file

@ -29,8 +29,8 @@ const platformFeatures = {
'@chuckya/bubble-timeline': containChuckya,
};
const advertisedFeatures = {
'@akkoma/bubble-timeline': "bubble_timeline",
}
'@akkoma/bubble-timeline': 'bubble_timeline',
};
const supportsCache = {};
@ -40,7 +40,7 @@ function supports(feature) {
let version = instanceData.version;
let domain = instanceData.domain;
let pleroma = instanceData?.pleroma;
let softwareName = getCurrentNodeInfo()?.software?.name || 'mastodon';
if (softwareName === 'hometown') {
@ -54,10 +54,12 @@ function supports(feature) {
if (platformFeatures[feature]) {
return (supportsCache[key] = platformFeatures[feature].test(version));
}
// Advertised features
if(pleroma) {
return (supportsCache[key] = pleroma.metadata.features.includes(advertisedFeatures[feature]));
if (pleroma) {
return (supportsCache[key] = pleroma.metadata.features.includes(
advertisedFeatures[feature],
));
}
const range = features[feature];