mirror of
https://iceshrimp.dev/blueb/Chuckya-fe-standalone.git
synced 2026-01-11 13:33:21 -08:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
7cbfc6b4ac
344 changed files with 3967 additions and 1611 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React, { PureComponent, Fragment } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { createPortal } from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
import { fromJS } from 'immutable';
|
||||
|
|
@ -29,19 +29,20 @@ export default class MediaContainer extends PureComponent {
|
|||
state = {
|
||||
media: null,
|
||||
index: null,
|
||||
lang: null,
|
||||
time: null,
|
||||
backgroundColor: null,
|
||||
options: null,
|
||||
};
|
||||
|
||||
handleOpenMedia = (media, index) => {
|
||||
handleOpenMedia = (media, index, lang) => {
|
||||
document.body.classList.add('with-modals--active');
|
||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||
|
||||
this.setState({ media, index });
|
||||
this.setState({ media, index, lang });
|
||||
};
|
||||
|
||||
handleOpenVideo = (options) => {
|
||||
handleOpenVideo = (lang, options) => {
|
||||
const { components } = this.props;
|
||||
const { media } = JSON.parse(components[options.componentIndex].getAttribute('data-props'));
|
||||
const mediaList = fromJS(media);
|
||||
|
|
@ -49,7 +50,7 @@ export default class MediaContainer extends PureComponent {
|
|||
document.body.classList.add('with-modals--active');
|
||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||
|
||||
this.setState({ media: mediaList, options });
|
||||
this.setState({ media: mediaList, lang, options });
|
||||
};
|
||||
|
||||
handleCloseMedia = () => {
|
||||
|
|
@ -94,7 +95,7 @@ export default class MediaContainer extends PureComponent {
|
|||
}),
|
||||
});
|
||||
|
||||
return ReactDOM.createPortal(
|
||||
return createPortal(
|
||||
<Component {...props} key={`media-${i}`} />,
|
||||
component,
|
||||
);
|
||||
|
|
@ -105,6 +106,7 @@ export default class MediaContainer extends PureComponent {
|
|||
<MediaModal
|
||||
media={this.state.media}
|
||||
index={this.state.index || 0}
|
||||
lang={this.state.lang}
|
||||
currentTime={this.state.options?.startTime}
|
||||
autoPlay={this.state.options?.autoPlay}
|
||||
volume={this.state.options?.defaultVolume}
|
||||
|
|
|
|||
|
|
@ -221,12 +221,12 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
|
|||
dispatch(mentionCompose(account, router));
|
||||
},
|
||||
|
||||
onOpenMedia (statusId, media, index) {
|
||||
dispatch(openModal('MEDIA', { statusId, media, index }));
|
||||
onOpenMedia (statusId, media, index, lang) {
|
||||
dispatch(openModal('MEDIA', { statusId, media, index, lang }));
|
||||
},
|
||||
|
||||
onOpenVideo (statusId, media, options) {
|
||||
dispatch(openModal('VIDEO', { statusId, media, options }));
|
||||
onOpenVideo (statusId, media, lang, options) {
|
||||
dispatch(openModal('VIDEO', { statusId, media, lang, options }));
|
||||
},
|
||||
|
||||
onBlock (status) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue