Merge commit 'd7bb36a64a842dfac52fb1cfb0fcd6646981fb38' into glitch-soc/merge-4.6
This commit is contained in:
commit
1285172f2a
17 files changed
+132
-36
No files matched your search
@@ -99,7 +99,7 @@
|
||||
margin: 12px 16px;
|
||||
padding: 8px;
|
||||
transition: border-color 0.2s ease-in-out;
|
||||
width: calc(100% - 48px);
|
||||
width: calc(100% - 32px);
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
|
||||
@@ -72,7 +72,7 @@ const DirectTimeline = ({ columnId, multiColumn }) => {
|
||||
scrollKey={`direct_timeline-${columnId}`}
|
||||
emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any private mentions yet. When you send or receive one, it will show up here." />}
|
||||
bindToDocument={!multiColumn}
|
||||
prepend={<div className='follow_requests-unlocked_explanation'><span><FormattedMessage id='compose_form.encryption_warning' defaultMessage='Posts on Mastodon are not end-to-end encrypted. Do not share any dangerous information over Mastodon.' /> <a href='/terms' target='_blank'><FormattedMessage id='compose_form.direct_message_warning_learn_more' defaultMessage='Learn more' /></a></span></div>}
|
||||
prepend={<div className='follow_requests-unlocked_explanation'><span><FormattedMessage id='compose_form.encryption_warning' defaultMessage='Posts on Mastodon are not end-to-end encrypted. Do not share any dangerous information over Mastodon.' /> <a href='https://docs.joinmastodon.org/user/posting/#private' rel='noreferrer' target='_blank'><FormattedMessage id='compose_form.direct_message_warning_learn_more' defaultMessage='Learn more' /></a></span></div>}
|
||||
alwaysPrepend
|
||||
/>
|
||||
|
||||
|
||||
@@ -15,16 +15,21 @@ import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { injectIntl } from '@/mastodon/components/intl';
|
||||
import Option from 'mastodon/features/report/components/option';
|
||||
import { languages as preloadedLanguages } from 'mastodon/initial_state';
|
||||
import { selectTimelinesByAccount } from '@/mastodon/selectors/timelines';
|
||||
|
||||
const messages = defineMessages({
|
||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||
});
|
||||
|
||||
const getAccountLanguages = createSelector([
|
||||
(state, accountId) => state.getIn(['timelines', `account:${accountId}`, 'items'], ImmutableList()),
|
||||
state => state.get('statuses'),
|
||||
], (statusIds, statuses) =>
|
||||
ImmutableSet(statusIds.map(statusId => statuses.get(statusId)).filter(status => !status.get('reblog')).map(status => status.get('language'))));
|
||||
const getAccountLanguages = createSelector(
|
||||
[selectTimelinesByAccount, (state) => state.get('statuses')],
|
||||
(timelines, statuses) => ImmutableSet(
|
||||
timelines
|
||||
.reduce((statusIds, timeline) => statusIds.concat(timeline.get('items')), ImmutableList())
|
||||
.map(statusId => statuses.get(statusId))
|
||||
.filter(status => !status.get('reblog'))
|
||||
.map(status => status.get('language'))
|
||||
));
|
||||
|
||||
const mapStateToProps = (state, { accountId }) => ({
|
||||
acct: state.getIn(['accounts', accountId, 'acct']),
|
||||
@@ -37,7 +42,6 @@ const mapDispatchToProps = (dispatch, { accountId }) => ({
|
||||
onSubmit (languages) {
|
||||
dispatch(followAccount(accountId, { languages }));
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
class SubscribedLanguagesModal extends ImmutablePureComponent {
|
||||
|
||||
+12
-8
@@ -52,13 +52,18 @@ export const ConfirmationModal: React.FC<
|
||||
noCloseOnConfirm = false,
|
||||
noFocusButton = false,
|
||||
}) => {
|
||||
const handleClick = useCallback(() => {
|
||||
if (!noCloseOnConfirm) {
|
||||
onClose();
|
||||
}
|
||||
const handleSubmit = useCallback(
|
||||
(e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
void onConfirm();
|
||||
}, [onClose, onConfirm, noCloseOnConfirm]);
|
||||
if (!noCloseOnConfirm) {
|
||||
onClose();
|
||||
}
|
||||
|
||||
void onConfirm();
|
||||
},
|
||||
[onClose, onConfirm, noCloseOnConfirm],
|
||||
);
|
||||
|
||||
const handleSecondary = useCallback(() => {
|
||||
onClose();
|
||||
@@ -66,7 +71,7 @@ export const ConfirmationModal: React.FC<
|
||||
}, [onClose, onSecondary]);
|
||||
|
||||
return (
|
||||
<ModalShell onSubmit={handleClick}>
|
||||
<ModalShell onSubmit={handleSubmit}>
|
||||
<ModalShellBody className={className}>
|
||||
{noFocusButton ? (
|
||||
<NavigationFocusTarget as='h1' id={titleId}>
|
||||
@@ -107,7 +112,6 @@ export const ConfirmationModal: React.FC<
|
||||
{/* eslint-disable jsx-a11y/no-autofocus -- we are in a modal and thus autofocusing is justified */}
|
||||
<Button
|
||||
type='submit'
|
||||
onClick={handleClick}
|
||||
loading={updating}
|
||||
disabled={disabled}
|
||||
autoFocus={!noFocusButton}
|
||||
|
||||
Reference in new issue
Block a user