From e116d164e88a1215509f7d6549571e93f38d1348 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 23 Sep 2024 04:39:07 +0200 Subject: [PATCH 1/6] Move spoiler text to inside the button --- src/components/status.jsx | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 9ae1aa1960..7d2030870e 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1889,21 +1889,12 @@ function Status({ <> {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && ( <> - {!!spoilerText && ( - - {' '} - - )} )} @@ -1946,17 +1937,6 @@ function Status({ <> {!!spoilerText && ( <> -
-

- -

-
{readingExpandSpoilers || previewMode ? (
Content warning @@ -1984,7 +1964,7 @@ function Status({ }} > {' '} - {showSpoiler ? t`Show less` : t`Show content`} + {!!spoilerText ? : showSpoiler ? t`Show less` : t`Show content`} )} From 0d60b222b44d1b89591cef5d916f8e0bab394695 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 23 Sep 2024 04:53:16 +0200 Subject: [PATCH 2/6] Tweak post spoiler style --- src/components/status.css | 5 +++++ src/components/status.jsx | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/status.css b/src/components/status.css index a05458276a..d8ba6cf56e 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -638,6 +638,11 @@ padding-bottom: 10px; } +:is(.spoiler-button, .spoiler-media-button) .spoiler-text { + color: var(--text-insignificant-color); + word-wrap: anywhere; +} + .status .content-container.has-spoiler :is(.spoiler-button, .spoiler-media-button):not([hidden]) { diff --git a/src/components/status.jsx b/src/components/status.jsx index 7d2030870e..81054ce77d 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1913,7 +1913,9 @@ function Status({ }} > {' '} - {spoilerText ? : showSpoiler ? t`Show less` : t`Show content`} + + {spoilerText ? : showSpoiler ? t`Show less` : t`Show content`} + )} @@ -1964,7 +1966,9 @@ function Status({ }} > {' '} - {!!spoilerText ? : showSpoiler ? t`Show less` : t`Show content`} + + {!!spoilerText ? : showSpoiler ? t`Show less` : t`Show content`} + )} From efc1191ebdf3ff886a7c8bff6897e90180cdab1e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 23 Sep 2024 05:04:34 +0200 Subject: [PATCH 3/6] Maybe a plain button would be best? --- src/components/status.css | 1 - src/components/status.jsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/status.css b/src/components/status.css index d8ba6cf56e..7da002072b 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -639,7 +639,6 @@ } :is(.spoiler-button, .spoiler-media-button) .spoiler-text { - color: var(--text-insignificant-color); word-wrap: anywhere; } diff --git a/src/components/status.jsx b/src/components/status.jsx index 81054ce77d..014531e4aa 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1890,7 +1890,7 @@ function Status({ {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && ( <>
) : ( @@ -2067,8 +2073,14 @@ function Status({ }} > {' '} - - {!!spoilerText ? : showSpoiler ? t`Show less` : t`Show content`} + + {!!spoilerText ? ( + + ) : showSpoiler ? ( + t`Show less` + ) : ( + t`Show content` + )} )} diff --git a/src/locales/en.po b/src/locales/en.po index 5f42b0e52c..8e9e56ff02 100644 --- a/src/locales/en.po +++ b/src/locales/en.po @@ -110,8 +110,8 @@ msgstr "" #: src/components/status.jsx:1737 #: src/components/status.jsx:1754 #: src/components/status.jsx:1878 -#: src/components/status.jsx:2474 -#: src/components/status.jsx:2477 +#: src/components/status.jsx:2486 +#: src/components/status.jsx:2489 #: src/pages/account-statuses.jsx:528 #: src/pages/accounts.jsx:109 #: src/pages/hashtag.jsx:199 @@ -180,7 +180,7 @@ msgid "Original" msgstr "" #: src/components/account-info.jsx:864 -#: src/components/status.jsx:2252 +#: src/components/status.jsx:2264 #: src/pages/catchup.jsx:71 #: src/pages/catchup.jsx:1445 #: src/pages/catchup.jsx:2056 @@ -288,7 +288,7 @@ msgstr "" #: src/components/account-info.jsx:1313 #: src/components/shortcuts-settings.jsx:1059 #: src/components/status.jsx:1186 -#: src/components/status.jsx:3251 +#: src/components/status.jsx:3263 msgid "Copy" msgstr "" @@ -416,9 +416,9 @@ msgstr "" #: src/components/shortcuts-settings.jsx:230 #: src/components/shortcuts-settings.jsx:583 #: src/components/shortcuts-settings.jsx:783 -#: src/components/status.jsx:2976 -#: src/components/status.jsx:3215 -#: src/components/status.jsx:3715 +#: src/components/status.jsx:2988 +#: src/components/status.jsx:3227 +#: src/components/status.jsx:3727 #: src/pages/accounts.jsx:36 #: src/pages/catchup.jsx:1581 #: src/pages/filters.jsx:224 @@ -624,7 +624,7 @@ msgid "Attachment #{i} failed" msgstr "" #: src/components/compose.jsx:1180 -#: src/components/status.jsx:2045 +#: src/components/status.jsx:2051 #: src/components/timeline.jsx:984 msgid "Content warning" msgstr "" @@ -692,7 +692,7 @@ msgstr "" #: src/components/status.jsx:929 #: src/components/status.jsx:1717 #: src/components/status.jsx:1718 -#: src/components/status.jsx:2370 +#: src/components/status.jsx:2382 msgid "Reply" msgstr "" @@ -1110,9 +1110,9 @@ msgstr "" #: src/components/keyboard-shortcuts-help.jsx:172 #: src/components/status.jsx:937 -#: src/components/status.jsx:2397 -#: src/components/status.jsx:2428 -#: src/components/status.jsx:2429 +#: src/components/status.jsx:2409 +#: src/components/status.jsx:2440 +#: src/components/status.jsx:2441 msgid "Boost" msgstr "" @@ -1122,8 +1122,8 @@ msgstr "" #: src/components/keyboard-shortcuts-help.jsx:180 #: src/components/status.jsx:1022 -#: src/components/status.jsx:2453 -#: src/components/status.jsx:2454 +#: src/components/status.jsx:2465 +#: src/components/status.jsx:2466 msgid "Bookmark" msgstr "" @@ -1227,9 +1227,9 @@ msgid "Filtered: {filterTitleStr}" msgstr "" #: src/components/media-post.jsx:133 -#: src/components/status.jsx:3545 -#: src/components/status.jsx:3641 -#: src/components/status.jsx:3719 +#: src/components/status.jsx:3557 +#: src/components/status.jsx:3653 +#: src/components/status.jsx:3731 #: src/components/timeline.jsx:973 #: src/pages/catchup.jsx:75 #: src/pages/catchup.jsx:1876 @@ -2065,18 +2065,18 @@ msgstr "" #: src/components/status.jsx:937 #: src/components/status.jsx:999 -#: src/components/status.jsx:2397 -#: src/components/status.jsx:2428 +#: src/components/status.jsx:2409 +#: src/components/status.jsx:2440 msgid "Unboost" msgstr "" #: src/components/status.jsx:953 -#: src/components/status.jsx:2412 +#: src/components/status.jsx:2424 msgid "Quote" msgstr "" #: src/components/status.jsx:961 -#: src/components/status.jsx:2421 +#: src/components/status.jsx:2433 msgid "Some media have no descriptions." msgstr "" @@ -2100,20 +2100,20 @@ msgstr "" #: src/components/status.jsx:1012 #: src/components/status.jsx:1727 -#: src/components/status.jsx:2441 +#: src/components/status.jsx:2453 msgid "Unlike" msgstr "" #: src/components/status.jsx:1013 #: src/components/status.jsx:1727 #: src/components/status.jsx:1728 -#: src/components/status.jsx:2441 -#: src/components/status.jsx:2442 +#: src/components/status.jsx:2453 +#: src/components/status.jsx:2454 msgid "Like" msgstr "" #: src/components/status.jsx:1022 -#: src/components/status.jsx:2453 +#: src/components/status.jsx:2465 msgid "Unbookmark" msgstr "" @@ -2130,7 +2130,7 @@ msgid "Edited: {editedDateText}" msgstr "" #: src/components/status.jsx:1221 -#: src/components/status.jsx:3220 +#: src/components/status.jsx:3232 msgid "Embed post" msgstr "" @@ -2200,17 +2200,17 @@ msgstr "" #: src/components/status.jsx:1728 #: src/components/status.jsx:1764 -#: src/components/status.jsx:2442 +#: src/components/status.jsx:2454 msgid "Liked" msgstr "" #: src/components/status.jsx:1761 -#: src/components/status.jsx:2429 +#: src/components/status.jsx:2441 msgid "Boosted" msgstr "" #: src/components/status.jsx:1771 -#: src/components/status.jsx:2454 +#: src/components/status.jsx:2466 msgid "Bookmarked" msgstr "" @@ -2219,7 +2219,7 @@ msgid "Pinned" msgstr "" #: src/components/status.jsx:1820 -#: src/components/status.jsx:2260 +#: src/components/status.jsx:2272 msgid "Deleted" msgstr "" @@ -2231,106 +2231,106 @@ msgstr "" msgid "Thread{0}" msgstr "" -#: src/components/status.jsx:2018 -#: src/components/status.jsx:2071 -#: src/components/status.jsx:2157 +#: src/components/status.jsx:2021 +#: src/components/status.jsx:2080 +#: src/components/status.jsx:2169 msgid "Show less" msgstr "" -#: src/components/status.jsx:2018 -#: src/components/status.jsx:2071 +#: src/components/status.jsx:2023 +#: src/components/status.jsx:2082 msgid "Show content" msgstr "" -#: src/components/status.jsx:2157 +#: src/components/status.jsx:2169 msgid "Show media" msgstr "" -#: src/components/status.jsx:2294 +#: src/components/status.jsx:2306 msgid "Edited" msgstr "" -#: src/components/status.jsx:2371 +#: src/components/status.jsx:2383 msgid "Comments" msgstr "" #. More from [Author] -#: src/components/status.jsx:2680 +#: src/components/status.jsx:2692 msgid "More from <0/>" msgstr "More from <0/>" -#: src/components/status.jsx:2981 +#: src/components/status.jsx:2993 msgid "Edit History" msgstr "" -#: src/components/status.jsx:2985 +#: src/components/status.jsx:2997 msgid "Failed to load history" msgstr "" -#: src/components/status.jsx:2990 +#: src/components/status.jsx:3002 #: src/pages/annual-report.jsx:46 msgid "Loading…" msgstr "" -#: src/components/status.jsx:3225 +#: src/components/status.jsx:3237 msgid "HTML Code" msgstr "" -#: src/components/status.jsx:3242 +#: src/components/status.jsx:3254 msgid "HTML code copied" msgstr "" -#: src/components/status.jsx:3245 +#: src/components/status.jsx:3257 msgid "Unable to copy HTML code" msgstr "" -#: src/components/status.jsx:3257 +#: src/components/status.jsx:3269 msgid "Media attachments:" msgstr "" -#: src/components/status.jsx:3279 +#: src/components/status.jsx:3291 msgid "Account Emojis:" msgstr "" -#: src/components/status.jsx:3310 -#: src/components/status.jsx:3355 +#: src/components/status.jsx:3322 +#: src/components/status.jsx:3367 msgid "static URL" msgstr "" -#: src/components/status.jsx:3324 +#: src/components/status.jsx:3336 msgid "Emojis:" msgstr "" -#: src/components/status.jsx:3369 +#: src/components/status.jsx:3381 msgid "Notes:" msgstr "" -#: src/components/status.jsx:3373 +#: src/components/status.jsx:3385 msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed." msgstr "" -#: src/components/status.jsx:3379 +#: src/components/status.jsx:3391 msgid "Polls are not interactive, becomes a list with vote counts." msgstr "" -#: src/components/status.jsx:3384 +#: src/components/status.jsx:3396 msgid "Media attachments can be images, videos, audios or any file types." msgstr "" -#: src/components/status.jsx:3390 +#: src/components/status.jsx:3402 msgid "Post could be edited or deleted later." msgstr "" -#: src/components/status.jsx:3396 +#: src/components/status.jsx:3408 msgid "Preview" msgstr "" -#: src/components/status.jsx:3405 +#: src/components/status.jsx:3417 msgid "Note: This preview is lightly styled." msgstr "" #. [Name] [Visibility icon] boosted -#: src/components/status.jsx:3649 +#: src/components/status.jsx:3661 msgid "<0/> <1/> boosted" msgstr ""