about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/status/components/detailed_status.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-09-23 23:00:12 +0200
committerGitHub <noreply@github.com>2022-09-23 23:00:12 +0200
commit0d6b878808a02aa4a544e894f06419c0f612c163 (patch)
tree119723ea46dd8525c370fee1235c3c9d42e55937 /app/javascript/mastodon/features/status/components/detailed_status.js
parentd2f7e30a283a1dca1f7974884ac0c237b93903ad (diff)
Add user content translations with configurable backends (#19218)
Diffstat (limited to 'app/javascript/mastodon/features/status/components/detailed_status.js')
-rw-r--r--app/javascript/mastodon/features/status/components/detailed_status.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js
index 5c43c2038..320a847f7 100644
--- a/app/javascript/mastodon/features/status/components/detailed_status.js
+++ b/app/javascript/mastodon/features/status/components/detailed_status.js
@@ -37,6 +37,7 @@ class DetailedStatus extends ImmutablePureComponent {
     onOpenMedia: PropTypes.func.isRequired,
     onOpenVideo: PropTypes.func.isRequired,
     onToggleHidden: PropTypes.func.isRequired,
+    onTranslate: PropTypes.func.isRequired,
     measureHeight: PropTypes.bool,
     onHeightChange: PropTypes.func,
     domain: PropTypes.string.isRequired,
@@ -103,6 +104,11 @@ class DetailedStatus extends ImmutablePureComponent {
     window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');
   }
 
+  handleTranslate = () => {
+    const { onTranslate, status } = this.props;
+    onTranslate(status);
+  }
+
   render () {
     const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
     const outerStyle = { boxSizing: 'border-box' };
@@ -260,7 +266,12 @@ class DetailedStatus extends ImmutablePureComponent {
             <DisplayName account={status.get('account')} localDomain={this.props.domain} />
           </a>
 
-          <StatusContent status={status} expanded={!status.get('hidden')} onExpandedToggle={this.handleExpandedToggle} />
+          <StatusContent
+            status={status}
+            expanded={!status.get('hidden')}
+            onExpandedToggle={this.handleExpandedToggle}
+            onTranslate={this.handleTranslate}
+          />
 
           {media}