Merge pull request #2470 from ClearlyClaire/glitch-soc/cleanup

Clean up some more and reduce unwarranted differences with upstream further
This commit is contained in:
Claire 2023-11-16 17:49:36 +01:00 committed by GitHub
commit 7f5b164326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 35 deletions

View File

@ -211,7 +211,7 @@ export function bookmark(status) {
api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) { api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function (response) {
dispatch(importFetchedStatus(response.data)); dispatch(importFetchedStatus(response.data));
dispatch(bookmarkSuccess(status)); dispatch(bookmarkSuccess(status, response.data));
}).catch(function (error) { }).catch(function (error) {
dispatch(bookmarkFail(status, 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 => { api(getState).post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => {
dispatch(importFetchedStatus(response.data)); dispatch(importFetchedStatus(response.data));
dispatch(unbookmarkSuccess(status)); dispatch(unbookmarkSuccess(status, response.data));
}).catch(error => { }).catch(error => {
dispatch(unbookmarkFail(status, error)); dispatch(unbookmarkFail(status, error));
}); });
@ -238,10 +238,11 @@ export function bookmarkRequest(status) {
}; };
} }
export function bookmarkSuccess(status) { export function bookmarkSuccess(status, response) {
return { return {
type: BOOKMARK_SUCCESS, type: BOOKMARK_SUCCESS,
status: status, status: status,
response: response,
}; };
} }
@ -260,10 +261,11 @@ export function unbookmarkRequest(status) {
}; };
} }
export function unbookmarkSuccess(status) { export function unbookmarkSuccess(status, response) {
return { return {
type: UNBOOKMARK_SUCCESS, type: UNBOOKMARK_SUCCESS,
status: status, status: status,
response: response,
}; };
} }

View File

@ -6,7 +6,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { Skeleton } from 'flavours/glitch/components/skeleton'; import { Skeleton } from 'flavours/glitch/components/skeleton';
import { me } from 'flavours/glitch/initial_state';
import { me } from '../initial_state';
import { Avatar } from './avatar'; import { Avatar } from './avatar';
import { DisplayName } from './display_name'; import { DisplayName } from './display_name';
@ -14,7 +15,6 @@ import { IconButton } from './icon_button';
import Permalink from './permalink'; import Permalink from './permalink';
import { RelativeTimestamp } from './relative_timestamp'; import { RelativeTimestamp } from './relative_timestamp';
const messages = defineMessages({ const messages = defineMessages({
follow: { id: 'account.follow', defaultMessage: 'Follow' }, follow: { id: 'account.follow', defaultMessage: 'Follow' },
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },

View File

@ -28,7 +28,7 @@ export default class AutosuggestEmoji extends PureComponent {
} }
return ( return (
<div className='emoji'> <div className='autosuggest-emoji'>
<img <img
className='emojione' className='emojione'
src={url} src={url}

View File

@ -106,24 +106,24 @@ export default class IntersectionObserverArticle extends Component {
const { children, id, index, listLength, cachedHeight } = this.props; const { children, id, index, listLength, cachedHeight } = this.props;
const { isIntersecting, isHidden } = this.state; const { isIntersecting, isHidden } = this.state;
const style = {};
if (!isIntersecting && (isHidden || cachedHeight)) { if (!isIntersecting && (isHidden || cachedHeight)) {
style.height = `${this.height || cachedHeight || 150}px`;
style.opacity = 0;
style.overflow = 'hidden';
}
return ( return (
<article <article
ref={this.handleRef} ref={this.handleRef}
aria-posinset={index + 1} aria-posinset={index + 1}
aria-setsize={listLength} aria-setsize={listLength}
style={{ height: `${this.height || cachedHeight}px`, opacity: 0, overflow: 'hidden' }}
data-id={id} data-id={id}
tabIndex={0} tabIndex={-1}
style={style}
> >
{children && cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} {children && cloneElement(children, { hidden: true })}
</article>
);
}
return (
<article ref={this.handleRef} aria-posinset={index + 1} aria-setsize={listLength} data-id={id} tabIndex={-1}>
{children && cloneElement(children, { hidden: false })}
</article> </article>
); );
} }

View File

@ -14,8 +14,8 @@ export default class AutosuggestAccount extends ImmutablePureComponent {
const { account } = this.props; const { account } = this.props;
return ( return (
<div className='account small' title={account.get('acct')}> <div className='autosuggest-account' title={account.get('acct')}>
<div className='account__avatar-wrapper'><Avatar account={account} size={24} /></div> <div className='autosuggest-account-icon'><Avatar account={account} size={24} /></div>
<DisplayName account={account} inline /> <DisplayName account={account} inline />
</div> </div>
); );

View File

@ -33,7 +33,7 @@ class Blocks extends ImmutablePureComponent {
params: PropTypes.object.isRequired, params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
hasMore: PropTypes.bool, hasMore: PropTypes.bool,
domains: ImmutablePropTypes.list, domains: ImmutablePropTypes.orderedSet,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
multiColumn: PropTypes.bool, multiColumn: PropTypes.bool,
}; };

View File

@ -308,9 +308,9 @@
background: darken($ui-secondary-color, 10%); background: darken($ui-secondary-color, 10%);
} }
> .account, .autosuggest-account,
> .emoji, .autosuggest-emoji,
> .autosuggest-hashtag { .autosuggest-hashtag {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
@ -342,14 +342,15 @@
} }
} }
& > .account.small { .autosuggest-account-icon,
.display-name { .autosuggest-emoji img {
& > span { margin-inline-end: 8px;
}
.autosuggest-account .display-name > span {
color: $lighter-text-color; color: $lighter-text-color;
} }
} }
}
}
.compose-form__upload-wrapper { .compose-form__upload-wrapper {
overflow: hidden; overflow: hidden;