From f69f1e9429b7cd46640681101f8462c62ba3af10 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 15 Nov 2023 21:52:19 +0100 Subject: [PATCH 1/4] Fix code discrepancies with upstream --- app/javascript/flavours/glitch/actions/interactions.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/actions/interactions.js b/app/javascript/flavours/glitch/actions/interactions.js index ebc7e8c50f..7d0144438a 100644 --- a/app/javascript/flavours/glitch/actions/interactions.js +++ b/app/javascript/flavours/glitch/actions/interactions.js @@ -211,7 +211,7 @@ export function bookmark(status) { api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) { dispatch(importFetchedStatus(response.data)); - dispatch(bookmarkSuccess(status)); + dispatch(bookmarkSuccess(status, response.data)); }).catch(function (error) { dispatch(bookmarkFail(status, error)); }); @@ -224,7 +224,7 @@ export function unbookmark(status) { api(getState).post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => { dispatch(importFetchedStatus(response.data)); - dispatch(unbookmarkSuccess(status)); + dispatch(unbookmarkSuccess(status, response.data)); }).catch(error => { dispatch(unbookmarkFail(status, error)); }); @@ -238,10 +238,11 @@ export function bookmarkRequest(status) { }; } -export function bookmarkSuccess(status) { +export function bookmarkSuccess(status, response) { return { type: BOOKMARK_SUCCESS, status: status, + response: response, }; } @@ -260,10 +261,11 @@ export function unbookmarkRequest(status) { }; } -export function unbookmarkSuccess(status) { +export function unbookmarkSuccess(status, response) { return { type: UNBOOKMARK_SUCCESS, status: status, + response: response, }; } From 09a5a785275f717e918365142c16ed695fe0f05b Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 15 Nov 2023 21:58:43 +0100 Subject: [PATCH 2/4] Fix discrepancy for `autosuggest-emoji` class --- .../glitch/components/autosuggest_emoji.jsx | 2 +- .../components/autosuggest_account.jsx | 4 ++-- .../styles/components/compose_form.scss | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx index 7c4f758b0f..eb25f5a643 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx +++ b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx @@ -28,7 +28,7 @@ export default class AutosuggestEmoji extends PureComponent { } return ( -
+
-
+
+
); diff --git a/app/javascript/flavours/glitch/styles/components/compose_form.scss b/app/javascript/flavours/glitch/styles/components/compose_form.scss index db20ff49ac..0f64c0dcc1 100644 --- a/app/javascript/flavours/glitch/styles/components/compose_form.scss +++ b/app/javascript/flavours/glitch/styles/components/compose_form.scss @@ -308,9 +308,9 @@ background: darken($ui-secondary-color, 10%); } - > .account, - > .emoji, - > .autosuggest-hashtag { + .autosuggest-account, + .autosuggest-emoji, + .autosuggest-hashtag { display: flex; flex-direction: row; align-items: center; @@ -342,12 +342,13 @@ } } - & > .account.small { - .display-name { - & > span { - color: $lighter-text-color; - } - } + .autosuggest-account-icon, + .autosuggest-emoji img { + margin-inline-end: 8px; + } + + .autosuggest-account .display-name > span { + color: $lighter-text-color; } } From 4101057b9a7f89e3728842441c425d9a855a9fab Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 15 Nov 2023 22:45:43 +0100 Subject: [PATCH 3/4] Fix various code discrepancies --- .../intersection_observer_article.jsx | 28 +++++++++---------- .../glitch/features/domain_blocks/index.jsx | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx index 455b4cf978..8efa969f9b 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx @@ -106,24 +106,24 @@ export default class IntersectionObserverArticle extends Component { const { children, id, index, listLength, cachedHeight } = this.props; const { isIntersecting, isHidden } = this.state; - const style = {}; - if (!isIntersecting && (isHidden || cachedHeight)) { - style.height = `${this.height || cachedHeight || 150}px`; - style.opacity = 0; - style.overflow = 'hidden'; + return ( +
+ {children && cloneElement(children, { hidden: true })} +
+ ); } return ( -
- {children && cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} +
+ {children && cloneElement(children, { hidden: false })}
); } diff --git a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx index 26020a4dd2..9e63b2f817 100644 --- a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx @@ -33,7 +33,7 @@ class Blocks extends ImmutablePureComponent { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, hasMore: PropTypes.bool, - domains: ImmutablePropTypes.list, + domains: ImmutablePropTypes.orderedSet, intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, }; From 36f25ea0671f491ed98a8049e9ae04b275b54586 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 15 Nov 2023 22:44:47 +0100 Subject: [PATCH 4/4] Fix more import discrepancies --- app/javascript/flavours/glitch/components/account.jsx | 4 ++-- .../flavours/glitch/components/edited_timestamp/index.jsx | 2 +- .../glitch/components/picture_in_picture_placeholder.jsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx index 518464b040..8aaafc18b9 100644 --- a/app/javascript/flavours/glitch/components/account.jsx +++ b/app/javascript/flavours/glitch/components/account.jsx @@ -6,7 +6,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Skeleton } from 'flavours/glitch/components/skeleton'; -import { me } from 'flavours/glitch/initial_state'; + +import { me } from '../initial_state'; import { Avatar } from './avatar'; import { DisplayName } from './display_name'; @@ -14,7 +15,6 @@ import { IconButton } from './icon_button'; import Permalink from './permalink'; import { RelativeTimestamp } from './relative_timestamp'; - const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx index 3dbac58b54..5aaaf3e357 100644 --- a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx +++ b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx @@ -6,7 +6,7 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { openModal } from 'flavours/glitch/actions/modal'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; import InlineAccount from 'flavours/glitch/components/inline_account'; import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp'; diff --git a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx index 1a290c91de..9a103bdb0c 100644 --- a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx +++ b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx @@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { removePictureInPicture } from 'flavours/glitch/actions/picture_in_picture'; -import { Icon } from 'flavours/glitch/components/icon'; +import { Icon } from 'flavours/glitch/components/icon'; class PictureInPicturePlaceholder extends PureComponent {