Further reduce differences with upstream
This commit is contained in:
parent
408d4710ed
commit
4b2ddaf106
|
@ -79,6 +79,7 @@ class Status extends ImmutablePureComponent {
|
||||||
previousId: PropTypes.string,
|
previousId: PropTypes.string,
|
||||||
nextInReplyToId: PropTypes.string,
|
nextInReplyToId: PropTypes.string,
|
||||||
rootId: PropTypes.string,
|
rootId: PropTypes.string,
|
||||||
|
onClick: PropTypes.func,
|
||||||
onReply: PropTypes.func,
|
onReply: PropTypes.func,
|
||||||
onFavourite: PropTypes.func,
|
onFavourite: PropTypes.func,
|
||||||
onReblog: PropTypes.func,
|
onReblog: PropTypes.func,
|
||||||
|
@ -109,7 +110,6 @@ class Status extends ImmutablePureComponent {
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
cacheMediaWidth: PropTypes.func,
|
cacheMediaWidth: PropTypes.func,
|
||||||
cachedMediaWidth: PropTypes.number,
|
cachedMediaWidth: PropTypes.number,
|
||||||
onClick: PropTypes.func,
|
|
||||||
scrollKey: PropTypes.string,
|
scrollKey: PropTypes.string,
|
||||||
deployPictureInPicture: PropTypes.func,
|
deployPictureInPicture: PropTypes.func,
|
||||||
settings: ImmutablePropTypes.map.isRequired,
|
settings: ImmutablePropTypes.map.isRequired,
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { store } from 'flavours/glitch/store';
|
||||||
const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`;
|
const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`;
|
||||||
|
|
||||||
const hydrateAction = hydrateStore(initialState);
|
const hydrateAction = hydrateStore(initialState);
|
||||||
|
|
||||||
store.dispatch(hydrateAction);
|
store.dispatch(hydrateAction);
|
||||||
|
|
||||||
// check for deprecated local settings
|
// check for deprecated local settings
|
||||||
|
@ -71,8 +72,8 @@ export default class Mastodon extends PureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldUpdateScroll (_, { location }) {
|
shouldUpdateScroll (prevRouterProps, { location }) {
|
||||||
return !(location.state?.mastodonModalKey);
|
return !(location.state?.mastodonModalKey && location.state?.mastodonModalKey !== prevRouterProps?.location?.state?.mastodonModalKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|
|
@ -38,7 +38,7 @@ class FeaturedTags extends ImmutablePureComponent {
|
||||||
name={featuredTag.get('name')}
|
name={featuredTag.get('name')}
|
||||||
href={featuredTag.get('url')}
|
href={featuredTag.get('url')}
|
||||||
to={`/@${account.get('acct')}/tagged/${featuredTag.get('name')}`}
|
to={`/@${account.get('acct')}/tagged/${featuredTag.get('name')}`}
|
||||||
uses={featuredTag.get('statuses_count')}
|
uses={featuredTag.get('statuses_count') * 1}
|
||||||
withGraph={false}
|
withGraph={false}
|
||||||
description={((featuredTag.get('statuses_count') * 1) > 0) ? intl.formatMessage(messages.lastStatusAt, { date: intl.formatDate(featuredTag.get('last_status_at'), { month: 'short', day: '2-digit' }) }) : intl.formatMessage(messages.empty)}
|
description={((featuredTag.get('statuses_count') * 1) > 0) ? intl.formatMessage(messages.lastStatusAt, { date: intl.formatDate(featuredTag.get('last_status_at'), { month: 'short', day: '2-digit' }) }) : intl.formatMessage(messages.empty)}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -76,7 +76,7 @@ export default class MediaItem extends ImmutablePureComponent {
|
||||||
if (['audio', 'video'].includes(attachment.get('type'))) {
|
if (['audio', 'video'].includes(attachment.get('type'))) {
|
||||||
content = (
|
content = (
|
||||||
<img
|
<img
|
||||||
src={attachment.get('preview_url') || attachment.getIn(['account', 'avatar_static'])}
|
src={attachment.get('preview_url') || status.getIn(['account', 'avatar_static'])}
|
||||||
alt={attachment.get('description')}
|
alt={attachment.get('description')}
|
||||||
lang={status.get('language')}
|
lang={status.get('language')}
|
||||||
onLoad={this.handleImageLoad}
|
onLoad={this.handleImageLoad}
|
||||||
|
|
|
@ -17,19 +17,21 @@ export default class NavigationBar extends ImmutablePureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
account: ImmutablePropTypes.map.isRequired,
|
account: ImmutablePropTypes.map.isRequired,
|
||||||
onLogout: PropTypes.func.isRequired,
|
onLogout: PropTypes.func.isRequired,
|
||||||
|
onClose: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const username = this.props.account.get('acct');
|
||||||
return (
|
return (
|
||||||
<div className='navigation-bar'>
|
<div className='navigation-bar'>
|
||||||
<Permalink className='avatar' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
<Permalink className='avatar' href={this.props.account.get('url')} to={`/@${username}`}>
|
||||||
<span style={{ display: 'none' }}>{this.props.account.get('acct')}</span>
|
<span style={{ display: 'none' }}>{username}</span>
|
||||||
<Avatar account={this.props.account} size={48} />
|
<Avatar account={this.props.account} size={46} />
|
||||||
</Permalink>
|
</Permalink>
|
||||||
|
|
||||||
<div className='navigation-bar__profile'>
|
<div className='navigation-bar__profile'>
|
||||||
<Permalink className='acct' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
<Permalink className='acct' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
||||||
<strong>@{this.props.account.get('acct')}</strong>
|
<strong className='navigation-bar__profile-account'>@{username}</strong>
|
||||||
</Permalink>
|
</Permalink>
|
||||||
|
|
||||||
{ profileLink !== undefined && (
|
{ profileLink !== undefined && (
|
||||||
|
|
|
@ -92,25 +92,6 @@ class Search extends PureComponent {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleBlur = () => {
|
|
||||||
this.setState({ expanded: false, selectedOption: -1 });
|
|
||||||
};
|
|
||||||
|
|
||||||
handleFocus = () => {
|
|
||||||
const { onShow, singleColumn } = this.props;
|
|
||||||
|
|
||||||
this.setState({ expanded: true, selectedOption: -1 });
|
|
||||||
onShow();
|
|
||||||
|
|
||||||
if (this.searchForm && !singleColumn) {
|
|
||||||
const { left, right } = this.searchForm.getBoundingClientRect();
|
|
||||||
|
|
||||||
if (left < 0 || right > (window.innerWidth || document.documentElement.clientWidth)) {
|
|
||||||
this.searchForm.scrollIntoView();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
const { selectedOption } = this.state;
|
const { selectedOption } = this.state;
|
||||||
const options = searchEnabled ? this._getOptions().concat(this.defaultOptions) : this._getOptions();
|
const options = searchEnabled ? this._getOptions().concat(this.defaultOptions) : this._getOptions();
|
||||||
|
@ -161,8 +142,23 @@ class Search extends PureComponent {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
findTarget = () => {
|
handleFocus = () => {
|
||||||
return this.searchForm;
|
const { onShow, singleColumn } = this.props;
|
||||||
|
|
||||||
|
this.setState({ expanded: true, selectedOption: -1 });
|
||||||
|
onShow();
|
||||||
|
|
||||||
|
if (this.searchForm && !singleColumn) {
|
||||||
|
const { left, right } = this.searchForm.getBoundingClientRect();
|
||||||
|
|
||||||
|
if (left < 0 || right > (window.innerWidth || document.documentElement.clientWidth)) {
|
||||||
|
this.searchForm.scrollIntoView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleBlur = () => {
|
||||||
|
this.setState({ expanded: false, selectedOption: -1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleHashtagClick = () => {
|
handleHashtagClick = () => {
|
||||||
|
|
|
@ -69,6 +69,7 @@ class SearchResults extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='drawer--results'>
|
<div className='drawer--results'>
|
||||||
<header className='search-results__header'>
|
<header className='search-results__header'>
|
||||||
|
|
Loading…
Reference in New Issue