AccountTimeline: pinned post column settings

groups^2
Alex Gleason 2021-08-11 16:00:49 -05:00
rodzic 1d18db3439
commit fbeb8de2a0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -130,6 +130,7 @@ export const defaultSettings = ImmutableMap({
account_timeline: ImmutableMap({
shows: ImmutableMap({
reblog: true,
pinned: true,
}),
}),

Wyświetl plik

@ -19,7 +19,20 @@ class ColumnSettings extends React.PureComponent {
return (
<div>
<div className='column-settings__row'>
<SettingToggle prefix='account_timeline' settings={settings} settingPath={['shows', 'reblog']} onChange={onChange} label={<FormattedMessage id='home.column_settings.show_reblogs' defaultMessage='Show reposts' />} />
<SettingToggle
prefix='account_timeline'
settings={settings}
settingPath={['shows', 'pinned']}
onChange={onChange}
label={<FormattedMessage id='account_timeline.column_settings.show_pinned' defaultMessage='Show pinned posts' />}
/>
<SettingToggle
prefix='account_timeline'
settings={settings}
settingPath={['shows', 'reblog']}
onChange={onChange}
label={<FormattedMessage id='home.column_settings.show_reblogs' defaultMessage='Show reposts' />}
/>
</div>
</div>
);

Wyświetl plik

@ -17,6 +17,7 @@ import MissingIndicator from 'soapbox/components/missing_indicator';
import { NavLink } from 'react-router-dom';
import { fetchPatronAccount } from '../../actions/patron';
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
import { getSettings } from 'soapbox/actions/settings';
import { makeGetStatusIds } from 'soapbox/selectors';
import classNames from 'classnames';
@ -46,6 +47,7 @@ const makeMapStateToProps = () => {
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
const unavailable = (me === accountId) ? false : isBlocked;
const showPins = getSettings(state).getIn(['account_timeline', 'shows', 'pinned']) && !withReplies;
return {
accountId,
@ -54,7 +56,7 @@ const makeMapStateToProps = () => {
accountApId,
isAccount: !!state.getIn(['accounts', accountId]),
statusIds: getStatusIds(state, { type: `account:${path}`, prefix: 'account_timeline' }),
featuredStatusIds: withReplies ? ImmutableOrderedSet() : getStatusIds(state, { type: `account:${accountId}:pinned`, prefix: 'account_timeline' }),
featuredStatusIds: showPins ? getStatusIds(state, { type: `account:${accountId}:pinned`, prefix: 'account_timeline' }) : ImmutableOrderedSet(),
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),
hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']),
me,