From 0e476f3c4fbbcab9b4895b8abff93075dfd2bf0c Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 26 Feb 2023 20:13:27 +0100 Subject: [Glitch] Add `lang` attribute to media and poll options Port d3eefead3014175b264cb56f6f4cb552cbaaeac6 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/ui/components/audio_modal.jsx | 7 +++++-- .../glitch/features/ui/components/compare_history_modal.jsx | 11 +++++++---- .../flavours/glitch/features/ui/components/image_loader.jsx | 5 ++++- .../flavours/glitch/features/ui/components/media_modal.jsx | 13 +++++++++++-- .../flavours/glitch/features/ui/components/video_modal.jsx | 12 ++++++++++-- .../glitch/features/ui/components/zoomable_image.jsx | 5 ++++- 6 files changed, 41 insertions(+), 12 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx index fc98cc6af..ff7687c1e 100644 --- a/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx @@ -7,15 +7,17 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import Footer from 'flavours/glitch/features/picture_in_picture/components/footer'; const mapStateToProps = (state, { statusId }) => ({ + language: state.getIn(['statuses', statusId, 'language']), accountStaticAvatar: state.getIn(['accounts', state.getIn(['statuses', statusId, 'account']), 'avatar_static']), }); -export default @connect(mapStateToProps) +export default @connect(mapStateToProps, null, null, { forwardRef: true }) class AudioModal extends ImmutablePureComponent { static propTypes = { media: ImmutablePropTypes.map.isRequired, statusId: PropTypes.string.isRequired, + language: PropTypes.string, accountStaticAvatar: PropTypes.string.isRequired, options: PropTypes.shape({ autoPlay: PropTypes.bool, @@ -29,7 +31,7 @@ class AudioModal extends ImmutablePureComponent { }; render () { - const { media, accountStaticAvatar, statusId, onClose } = this.props; + const { media, language, accountStaticAvatar, statusId, onClose } = this.props; const options = this.props.options || {}; return ( @@ -38,6 +40,7 @@ class AudioModal extends ImmutablePureComponent {