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({
|
||||
shows: ImmutableMap({
|
||||
reblog: true,
|
||||
pinned: true,
|
||||
}),
|
||||
}),
|
||||
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
|
|
|
@ -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,
|
||||
|
|
Ładowanie…
Reference in New Issue