+
+
+
diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.jsx b/app/javascript/flavours/glitch/features/account_timeline/index.jsx
index e5e8da6722..212ad79dc8 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/index.jsx
+++ b/app/javascript/flavours/glitch/features/account_timeline/index.jsx
@@ -7,12 +7,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';
-import { TimelineHint } from 'flavours/glitch/components/timeline_hint';
import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';
import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error';
import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map';
import { getAccountHidden } from 'flavours/glitch/selectors/accounts';
-import { useAppSelector } from 'flavours/glitch/store';
import { lookupAccount, fetchAccount } from '../../actions/accounts';
import { fetchFeaturedTags } from '../../actions/featured_tags';
@@ -20,6 +18,7 @@ import { expandAccountFeaturedTimeline, expandAccountTimeline } from '../../acti
import { LoadingIndicator } from '../../components/loading_indicator';
import StatusList from '../../components/status_list';
import Column from '../ui/components/column';
+import { RemoteHint } from 'flavours/glitch/components/remote_hint';
import { AccountHeader } from './components/account_header';
import { LimitedAccountHint } from './components/limited_account_hint';
@@ -46,11 +45,8 @@ const mapStateToProps = (state, { params: { acct, id, tagged }, withReplies = fa
return {
accountId,
- remote: !!(state.getIn(['accounts', accountId, 'acct']) !== state.getIn(['accounts', accountId, 'username'])),
- remoteUrl: state.getIn(['accounts', accountId, 'url']),
isAccount: !!state.getIn(['accounts', accountId]),
statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()),
- featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned${tagged ? `:${tagged}` : ''}`, 'items'], ImmutableList()),
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),
hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']),
suspended: state.getIn(['accounts', accountId, 'suspended'], false),
@@ -58,24 +54,6 @@ const mapStateToProps = (state, { params: { acct, id, tagged }, withReplies = fa
};
};
-const RemoteHint = ({ accountId, url }) => {
- const acct = useAppSelector(state => state.accounts.get(accountId)?.acct);
- const domain = acct ? acct.split('@')[1] : undefined;
-
- return (
-
}
- label={
{domain} }} />}
- />
- );
-};
-
-RemoteHint.propTypes = {
- url: PropTypes.string.isRequired,
- accountId: PropTypes.string.isRequired,
-};
-
class AccountTimeline extends ImmutablePureComponent {
static propTypes = {
@@ -87,15 +65,12 @@ class AccountTimeline extends ImmutablePureComponent {
accountId: PropTypes.string,
dispatch: PropTypes.func.isRequired,
statusIds: ImmutablePropTypes.list,
- featuredStatusIds: ImmutablePropTypes.list,
isLoading: PropTypes.bool,
hasMore: PropTypes.bool,
withReplies: PropTypes.bool,
isAccount: PropTypes.bool,
suspended: PropTypes.bool,
hidden: PropTypes.bool,
- remote: PropTypes.bool,
- remoteUrl: PropTypes.string,
multiColumn: PropTypes.bool,
};
@@ -164,7 +139,7 @@ class AccountTimeline extends ImmutablePureComponent {
};
render () {
- const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;
+ const { accountId, statusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;
if (isLoading && statusIds.isEmpty()) {
return (
@@ -192,8 +167,6 @@ class AccountTimeline extends ImmutablePureComponent {
emptyMessage = ;
}
- const remoteMessage = remote ? : null;
-
return (
@@ -201,10 +174,9 @@ class AccountTimeline extends ImmutablePureComponent {
}
alwaysPrepend
- append={remoteMessage}
+ append={}
scrollKey='account_timeline'
statusIds={forceEmptyState ? emptyList : statusIds}
- featuredStatusIds={featuredStatusIds}
isLoading={isLoading}
hasMore={!forceEmptyState && hasMore}
onLoadMore={this.handleLoadMore}
diff --git a/app/javascript/flavours/glitch/features/ui/index.jsx b/app/javascript/flavours/glitch/features/ui/index.jsx
index 015baf5032..22814f40e3 100644
--- a/app/javascript/flavours/glitch/features/ui/index.jsx
+++ b/app/javascript/flavours/glitch/features/ui/index.jsx
@@ -78,6 +78,7 @@ import {
About,
PrivacyPolicy,
TermsOfService,
+ AccountFeatured,
} from './util/async-components';
import { ColumnsContextProvider } from './util/columns_context';
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
@@ -247,6 +248,7 @@ class SwitchingColumnsArea extends PureComponent {
+
diff --git a/app/javascript/flavours/glitch/features/ui/util/async-components.js b/app/javascript/flavours/glitch/features/ui/util/async-components.js
index 82b60b15b3..79a43b47e9 100644
--- a/app/javascript/flavours/glitch/features/ui/util/async-components.js
+++ b/app/javascript/flavours/glitch/features/ui/util/async-components.js
@@ -70,6 +70,10 @@ export function AccountGallery () {
return import(/* webpackChunkName: "flavours/glitch/async/account_gallery" */'../../account_gallery');
}
+export function AccountFeatured() {
+ return import(/* webpackChunkName: "flavours/glitch/async/account_featured" */'../../account_featured');
+}
+
export function Followers () {
return import(/* webpackChunkName: "flavours/glitch/async/followers" */'../../followers');
}
diff --git a/app/javascript/flavours/glitch/hooks/useAccountId.ts b/app/javascript/flavours/glitch/hooks/useAccountId.ts
new file mode 100644
index 0000000000..406a062c9e
--- /dev/null
+++ b/app/javascript/flavours/glitch/hooks/useAccountId.ts
@@ -0,0 +1,37 @@
+import { useEffect } from 'react';
+
+import { useParams } from 'react-router';
+
+import { fetchAccount, lookupAccount } from 'flavours/glitch/actions/accounts';
+import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map';
+import { useAppDispatch, useAppSelector } from 'flavours/glitch/store';
+
+interface Params {
+ acct?: string;
+ id?: string;
+}
+
+export function useAccountId() {
+ const { acct, id } = useParams();
+ const accountId = useAppSelector(
+ (state) =>
+ id ??
+ (state.accounts_map.get(normalizeForLookup(acct)) as string | undefined),
+ );
+
+ const account = useAppSelector((state) =>
+ accountId ? state.accounts.get(accountId) : undefined,
+ );
+ const isAccount = !!account;
+
+ const dispatch = useAppDispatch();
+ useEffect(() => {
+ if (!accountId) {
+ dispatch(lookupAccount(acct));
+ } else if (!isAccount) {
+ dispatch(fetchAccount(accountId));
+ }
+ }, [dispatch, accountId, acct, isAccount]);
+
+ return accountId;
+}
diff --git a/app/javascript/flavours/glitch/hooks/useAccountVisibility.ts b/app/javascript/flavours/glitch/hooks/useAccountVisibility.ts
new file mode 100644
index 0000000000..e5fd40adba
--- /dev/null
+++ b/app/javascript/flavours/glitch/hooks/useAccountVisibility.ts
@@ -0,0 +1,20 @@
+import { getAccountHidden } from 'flavours/glitch/selectors/accounts';
+import { useAppSelector } from 'flavours/glitch/store';
+
+export function useAccountVisibility(accountId?: string) {
+ const blockedBy = useAppSelector(
+ (state) => !!state.relationships.getIn([accountId, 'blocked_by'], false),
+ );
+ const suspended = useAppSelector(
+ (state) => !!state.accounts.getIn([accountId, 'suspended'], false),
+ );
+ const hidden = useAppSelector((state) =>
+ accountId ? Boolean(getAccountHidden(state, accountId)) : false,
+ );
+
+ return {
+ blockedBy,
+ suspended,
+ hidden,
+ };
+}
diff --git a/app/javascript/flavours/glitch/locales/en.json b/app/javascript/flavours/glitch/locales/en.json
index 88a817d431..71ac1d26db 100644
--- a/app/javascript/flavours/glitch/locales/en.json
+++ b/app/javascript/flavours/glitch/locales/en.json
@@ -1,7 +1,6 @@
{
"about.fork_disclaimer": "Glitch-soc is free open source software forked from Mastodon.",
"account.disclaimer_full": "Information below may reflect the user's profile incompletely.",
- "account.featured_tags.title": "{name}'s featured hashtags",
"account.follows": "Follows",
"account.suspended_disclaimer_full": "This user has been suspended by a moderator.",
"account.view_full_profile": "View full profile",