kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
AccountTimeline: pinned post column settings
rodzic
1d18db3439
commit
fbeb8de2a0
|
@ -130,6 +130,7 @@ export const defaultSettings = ImmutableMap({
|
||||||
account_timeline: ImmutableMap({
|
account_timeline: ImmutableMap({
|
||||||
shows: ImmutableMap({
|
shows: ImmutableMap({
|
||||||
reblog: true,
|
reblog: true,
|
||||||
|
pinned: true,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,20 @@ class ColumnSettings extends React.PureComponent {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className='column-settings__row'>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,6 +17,7 @@ import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import { fetchPatronAccount } from '../../actions/patron';
|
import { fetchPatronAccount } from '../../actions/patron';
|
||||||
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
|
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
|
||||||
|
import { getSettings } from 'soapbox/actions/settings';
|
||||||
import { makeGetStatusIds } from 'soapbox/selectors';
|
import { makeGetStatusIds } from 'soapbox/selectors';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
@ -46,6 +47,7 @@ const makeMapStateToProps = () => {
|
||||||
|
|
||||||
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
||||||
const unavailable = (me === accountId) ? false : isBlocked;
|
const unavailable = (me === accountId) ? false : isBlocked;
|
||||||
|
const showPins = getSettings(state).getIn(['account_timeline', 'shows', 'pinned']) && !withReplies;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accountId,
|
accountId,
|
||||||
|
@ -54,7 +56,7 @@ const makeMapStateToProps = () => {
|
||||||
accountApId,
|
accountApId,
|
||||||
isAccount: !!state.getIn(['accounts', accountId]),
|
isAccount: !!state.getIn(['accounts', accountId]),
|
||||||
statusIds: getStatusIds(state, { type: `account:${path}`, prefix: 'account_timeline' }),
|
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']),
|
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),
|
||||||
hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']),
|
hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']),
|
||||||
me,
|
me,
|
||||||
|
|
Ładowanie…
Reference in New Issue